Archive for January, 2010

DVD to mp4

$ mplayer -dvd-device /mnt/disk dvd://<title >

$ mplayer dvd://1 -dumpstream -dumpfile dump.vob

ffmpeg -t 15 -i VTS_01_1.VOB -deinterlaceĀ -acodec libfaac -ab 160k -vcodec libx264 -vpre hq -b 5000k -threads 0 output.mp4

References

No Comments

MATLAB: urlread

Just found out about urlread.m. I can make some matlab and octave webpage pullers now.

No Comments

Wake On LAN

I’ve decided to use Wake On LAN (WOL) to save power on my file server. It’s mostly a media server, so I only need it one when I need to access media. Most of the time it can be off. To turn on the computer you just send it a magic packet. This can be done over the internet too.

Enable it in the bios

Enable it in the OS

query ethernet adapter

$ ethtool eth0

Enable wol

$ ethtool -s eth0 wol g

Add to /etc/rc.d/rc.local

ethtool -s eth0 wol g

Windows

http://magicpacket.free.fr/

OS X

http://www.readpixel.com/wakeonlan/

Linux

$ wol

Python

#!/usr/bin/env python
import socket
s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto('\xff'*6+'\xFF\xFF\xFF\xFF\xFF\xFF'*16, ('192.168.1.255', 80))

References

No Comments

Aquarium Residents in Detail

Betta (Betta splendens)

  • Keep males apart, because they will fight
  • Keep one or three females to establish hierarchy
  • Males will nip at long-tailed similar fish
  • Fast moving fish nips will abuse betta
  • Stays near surface
  • Can breath on surface
  • Eats flake food, blood worms, brine shrimp
  • Builds bubble nest
  • Frys eat brine shrimp and hard boiled egg yolks

Cardinal Tetra (Paracheirodon axelrodi)

  • South America, slow moving, well-planted aquarium best
  • Schools, keep 6 or more
  • Eats flake food, tubifex, bloodworms, brine shrimp, daphina

Neon Blue Dwarf Gourami (Colisa lalia)

  • Looks like large cardinal
  • Dark substrate
  • Similar to Betta
  • Eats algae-based flake food, tubifex, bloodworms, brine shrimp

Panda Cory Cat (Corydoras panda)

  • Schools, keep 6 or more
  • Eats flake and pellet food, brine shrimp, worms, algae tablets
  • Avoid rough substrate to protect barbels
  • Feed before turning off lights

Red Cherry Shrimp (Neocaridina denticulata sinensis)

  • Copper kills invertebrates
  • Avoid crossbreeding
  • Breeds easily
  • Eats algae and left over food, supplement with algae tablets

Food

  • Meaty flake food
  • Algae flake food
  • Sinking algae tablets
  • Brine shrimp
  • Bloodworms

Feed twice a day for 2-3 minutes, don’t feed one day a week to clear out intestinal tract. Special treat day for brine shrimp or bloodworms. Feed catfish before lights out.

References

No Comments

Hiking Hydration

Avoid caffeinated drinks (diuretic just like chocolate).

Add Gatorade or lemonade to your water to decrease freezing point.

diuretics – drug that increases rate of urination

References

No Comments

Soda Can Stove

Handy soda can stove.

Construction

  1. Cut bottom piece 1 1/8″ from bottom of can.
  2. Cut center wall 1 1/2″ x 7″ from center of can.
  3. Stretch bottom piece on full can.
  4. Cut notches on bottom of middle wall to allow alcohol to flow.
  5. Cut top piece 7/8″ from bottom of can.
  6. Pierce fill holes in middle of top piece.
  7. Place center wall inside of top piece.
  8. Stuff cotton balls inside center wall.
  9. Sand edges of bottom piece.
  10. Push bottom piece on outside of top piece to connect.

Usage

Fill top, place penny to block fill port. Preheat. Then light jets.

Principle

Alcohol evaporates, but it only can go through the vents on the rim since the fill port is covered with a penny. If too much pressure builds up, the penny is pushed up relieving pressure. If the alcohol evaporates fast enough, it can be lit on fire, which heats up the alcohol in the cotton ball reservoir maintaining the cycle. The middle wall helps build up the pressure and force the alcohol through the vents. The holes in the bottom of the wall let the alcohol escape from the central reservoir. This is similar to lighter, but without a wick.

References

No Comments

Pdf Command Line Manipulation

Combine Pages

$ gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf \
source1.pdf source2.pdf source3.pdf etc.pdf

Extract Pages

  $ gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
       -dFirstPage=22 -dLastPage=36 \
       -sOutputFile=outfile_p22-p36.pdf 100p-inputfile.pdf

References

No Comments

Bookbinding

Here’s some MATLAB code to calculate the order of pages to print when doing a booklet with signatures of a certain size. Assuming you take a sheet of 8.5″ x 11″ and fold it over to make 4 pages. I should be able to combine this with pdftk to turn reorder any pdf to make it print into a booklet for those printers that don’t have booklet functions.

Npages = 310; % total pages
signature_size = 8; % sheets of paper  in a signature
N = signature_size*4;
Nsignature = floor(Npages/4/signature_size);
% do complete signatures
p = [];
for nj = 0:Nsignature-1
  c= N/2 + nj*N
  for ni = 0:N/4 -1
    p = [p c - 2*ni c + 1 + 2*ni c + 2*(ni+1) c - 1 - 2*ni];
  end
end
% do left over signature
Npagesleft = Npages - Nsignature*N;
Npagesleft = ceil(Npagesleft/4)*4
c = Npagesleft/2 + Nsignature*N
for ni = 0:Npagesleft/4 -1
  p = [p c - 2*ni c + 1 + 2*ni c + 2*(ni+1) c - 1 - 2*ni];
end
p % order of pages to print

No Comments

Gigabit Ethernet

It’s about time I switch to gigabit ethernet since it is becoming a choke point.

No Comments

Survival Kits

In light of Haiti and recent power outages, it is prudent to reaccess emergency preparedness. There are many categories of survival kits. I’m still trying figure out what I need.

Pocketable Kit

Along the lines of the Combat Survival Tin and Survival Kit in a Sardine Can.

  • Altoids Tin, attach aluminum foil to top lip to use as signaling device
  • Plastic bag, to keep things in Altoid Tin water proof
  • Pain killer
  • Bandaids
  • Neosporin
  • Condom
  • Compass
  • Whistle
  • Fishing Line
  • Matches
  • Fresnel Lens Credit Card
  • Pocket Knife, Leatherman Micra?
  • Safety Pinx3, can be used as hook for fishing
  • cotton balls
  • Wire Saw
  • candle
  • Salt
  • Alcohol pad
  • pencil
  • paper
  • tea bag
  • water purification tablet
  • hard candy

Hiking and Camping Kit

  • Clean Drinking Water in Kleen Kanteen
  • FM 3-05.70 SURVIVAL MANUAL
  • Flashlight
  • Nonperishable food
  • Medication
  • First Aid Kit
  • Zippo Lighter
  • Poncho
  • Firesteel
  • Knife – SOG Seal Pup Elite?
  • Multitool – Leatherman Wave
  • Compass – Suunto
  • Signaling Mirror
  • Whistle
  • Radio
  • Shovel
  • Topographical Map
  • Paracord
  • Survival Paracord Bracelet
  • Needle
  • Tarp
  • Aluminum Foil
  • Condoms
  • Duct Tape
  • Fishing kit
  • Shovel

Winter Kit

  • Blanket

Car Kit

  • First Aid Kit
  • Tire pressure gauge
  • Leatherman Multitool
  • Flashlight
  • Paracord
  • Blanket

Emergency Home 3 Day Kit

  • Water
  • Nonperishable Foods (jerky, nuts, dried fruit)

3 of anything signals distress

No Comments