Sunday, November 28, 2010

Debian Lenny Xen Setup (Guest Domain)

xen-create-image --ip= --hostname=greenbox --role udev --debootstrap
xen-create-image --ip= --hostname=yellowbox --role udev --debootstrap

xm create -c /etc/xen/greenbox.cfg
xm create -c /etc/xen/yellowbox.cfg

reboot (not neccesary, but I dig it)

After a fairly lengthy reboot process you should have machines on .80, .81, and .82 all running.

Inside the VMs

aptitude install -R avahi-daemon
adduser awesomeusername

You can now ssh greenbox.local and use an account that isn't root.

Check this link if you want to setup a LAMP server.
Check this link if you want to setup a TomCat server.

Debian Lenny Xen Setup (Domain Zero)


For this setup, I want to install Debian Lenny with several Xen virtual machines.  The hardware is an older Dell something in a black case, so the dom0 domain will be called "blackbox" and the domU domains will be known by other colors.  I don't need any GUI stuff for this install since it'll just be doing server-ish terminal stuff.


Install Debian from the net install CD. From the screen to select "choose software to install" deselect the Desktop Environment unless you want it for some reason. Leave Standard System selected.

This Debian install doesn't come with sudo so just use su instead. You can install sudo if you really want to but then you'll have to configure it.

I like to setup the system so I can SSH to the box and I don't have to spend all my time in the basement.

aptitude install -R openssh-server
aptitude install openssh-blacklist-extra
aptitude install -R avahi-daemon

Remote Control

From the comfort of a computer not in a server room or basement ssh to box.  Just to test it properly, I like to remote in, and reboot the machine.  If that works you know you have full remote control of the box.

ssh blackbox.local

Static IP

By default if Debian can use DHCP, it will, but since we are running a server we probably want it to have a static IP address.  So get in there and change it.  You should be careful, because if you screw it up you have to head back to the physical machine and update it.

vim /etc/network/interfaces
(edit this line)
iface eth0 inet dhcp

(change it to this, in my case)
iface eth0 inet static
When you've got it perfect run I prefer to reboot (reboot) the system again just for good measure.  Some people will prefer to just restart the networking bits on the system (/etc/init.d/networking restart).

You'll be disconnected from your ssh session but should be able to reconnect with ssh blackbox.local again.

Setup Xen

Up until this point, the rest of that junk was pretty basic setup that would apply to all Debian Lenny installs, but here's where we actually get specialized.

aptitude install -R bridge-utils
aptitude install -R xen-linux-system-2.6.26-2-xen-686
aptitude install -R xen-utils-3.2-1
aptitude install -R xen-shell
aptitude install -R xen-tools

uname -r
... make sure it that "xen" is included in the name of the kernel

vim /etc/xen/xend-config.sxp
... uncomment (network-script network-bridge)
... comment (network-script network-dummy)

vim /etc/modules
... edit loop to loop max_loop=64

vim /etc/xen-tools/xen-tools.conf
... uncomment dir = /home/xen
... edit dist = etch  to dist = lenny 
... uncomment gateway   =
... uncomment netmask   =
... uncomment broadcast =
... edit network addresses to match your configuration
... uncomment passwd = 1

reboot (just for good measure)


Now everything should be setup properly.  Cross your fingers

Friday, November 26, 2010

Debian Xen Lenny Setup

Install Debian Lenny.  Minimal Net Install CD.
You won't get sudo out of the box, so just use su all the time instead.

So I can ssh to the machine name.local instead of IP, install some avahi stuff (I'll have to test to see what's most useful).. one or more of these, probably not discover.  I'd guess, start with libnss-mdns.

  • sudo apt-get install avahi-utils
  • sudo apt-get install avahi-daemon
  • sudo apt-get install avahi-discover
  • sudo apt-get install libnss-mdns

Set a name for DHCP server in the dhclient.conf.  This is so my DHCP server knows who is getting what address.  It's helpful.

vim /etc/dhcp3/dhclient.conf
send host-name "Yellow";
Untested hypothesis:  Setting the name that the machine reports to the DHCP server allows me to easily access the machine without the "ssh yellow.local" style naming configuration.  It allows me to simply use "ssh yellow"

Probably need to find the proper versions of this stuff via "apt-cache search xen-*whatever*"
  • apt-get install xen-hypervisor-3.2-1-i386
  • apt-get install xen-linux-system-2.6.26-1-xen-686
  • apt-get install xenwatch
  • apt-get install xen-shell
I stole that from this line: apt-get install xen-hypervisor-3.2-1-amd64 xen-linux-system-2.6.26-1-xen-amd64 xen-utils-3.2-1 xenstore-utils xenwatch xen-shell xen-tools

Follow this link now

Also use this link

1. add to /etc/xen-tools/xen-tools.conf:
serial_device = hvc0
2. and make domU with:
xen-create-image --hostname HOSTNAME (more options...) --role udev

Use DHCP for stuff.

xen-create-image --hostname=greenbox --dir=/vserver/images --dist=lenny --debootstrap

cd /etc/xen/

xm create -c greenbox.cfg
xm list
xm shutdown greenbox

Friday, September 3, 2010

Step By Step TiVo App Setup

  • Copy web structure to /var/www/
  • Untar to /var/www/tivo/
  • sudo vim /etc/apache2/sites-enabled/000-default
    • set "DocumentRoot /var/www/tivo/public"
    • set first two "AllowOverride All"
    • set "Directory /var/www/tivo/public/"
  • Make sure target directory is writeable.
  • Change permissions on /var/www/tivo/ if you so desire.

Sunday, August 29, 2010

Step By Step LAMP Zend Framework Setup

  • sudo apt-get install lamp-server^
    • (yes include carat)
  • sudo a2enmod rewrite
  • sudo apt-get install zend-framework
    • (it is not, nor will it ever be, the current version)
  • sudo apt-get install libapache2-mod-auth-mysql phpmyadmin
  • sudo apt-get install curl
  • sudo apt-get install vim
  • sudo vim /etc/php5/apache2/php.ini
    • Edit error handling around line 500
    • Edit paths around line 780.  Add:
      • include_path = ".:/usr/share/php/libzend-framework-php"
    • Edit Execution Time
      • max_execution_time = 0
      • max_input_time = -1
  • sudo /etc/init.d/apache2 restart
If I get "apache2: Could not reliably determine the server's fully qualified domain name, using for ServerName"
  • sudo vim /etc/apache2/httpd.conf
  • paste:
    • ServerName localhost
  • save
  • sudo /etc/init.d/apache2 restart
Now is probably also a good time to setup read/write permissions on /var/www as well.  It took me too long to figure out how to do it exactly, but the general idea is to add the group www-data to the user you are using for most programming and data entry or whatever.  Remember to log out and log back in when you change groups.  Then set your /var/www folder to the www-data group as well.  That's it.  Remembering to log out is the important part.

Step By Step Tivo Decode Machine Setup

On Local Machine

  • Install Ubuntu Minimal
  • sudo apt-get install openssh-server


  • Install Medibuntu
  • sudo apt-get install build-essential
  • Install tivodecode
    • wget
    • tar xvfz tivodecode-0.2pre4.tar.gz
    • cd tivodecode-0.2pre4/
    • ./configure
    • make
    • sudo make install
    • which tivodecode
  • sudo apt-get install mencoder
  • sudo apt-get install avahi-utils
  • sudo apt-get install atomicparsley
Do something about the domain name.  Any time you sudo you'll get an warning like "Could not reliably determine the server's fully qualified domain name" or such.

    Sunday, August 22, 2010

    Transfer TiVo MetaData to iTunes

    You need a proper tool to edit metadata on your mp4 files that were created. is available, and you can even get it from aptitude on some systems.

    sudo apt-get install atomicparsley

    AtomicParsley "TelevisionShow.mp4" --stick "TV Show"  --description "Michael Pardue escaped from prison three times after being convicted for two murders, but his convictions for murder and escape were later overturned. Copyright Tribune Media Services, Inc." --TVNetwork "AETVHD" --TVShowName "American Justice" --TVEpisode "Shotgun Justice"--overWrite

    Maybe mp4v2 works better?
    The make portion took a long time on my system, and there are some extra weird dependancies.

    sudo apt-get install build-essential
    tar -xf mp4v2-1.9.1.tar.bz2
    cd mp4v2-1.9.1
    sudo make install

    Saturday, August 21, 2010

    Setup Linux for TiVo video to iPad video conversion

    1) Install TiVo File Decoder

    Download source from the 0.2pre4 version works fine for me.  Extract the source and build it.

    sudo make install

    Use "which tivodecode" to make sure it was installed properly in /ur/local/bin

    2) Install Mencoder

    Enable Medibuntu
    sudo apt-get install mencoder

    Convert TiVo video to iPad video in Linux

    Steps in General
    1) Download the Video
    2) Decode the Video
    3) Re-encode the Video

    Steps in Detail
    1) Find the URL for the TiVo file however you like.  Find your TiVos MAK however you like.  Set the output file location.

    curl '$url' --digest -k -u tivo:$mak -c /tmp/cookies.txt --retry 12 --retry-delay 10 -o $target

    $c = "";
    $c .= "curl '$url' "; //source
    $c .= "--digest -k "; //tivo needs these??
    $c .= "-u tivo:$mak "; //username and password
    $c .= "-c /tmp/cookies.txt "; //storing cookies is necessary, we just don't want them.
    $c .= "--retry 12 --retry-delay 10 "; //help retry??
    $c .= "-o $target"; //output

    2) Find your TiVos MAK however you like.  Set the input file location.  Set the output file location.

    tivodecode $input -m $mak -o $output

    $d = "";
    $d .= "tivodecode $input ";
    $d .= "-m $mak ";
    $d .= "-o $output ";

    3) Set the input file location.  Set the output file location.

    mencoder $input -o '$output' -ss 00:00:02 -ovc x264 -x264encopts qcomp=0.8:nocabac:level_idc=30:bframes=0:global_header:threads=auto:bitrate=1200 -vf pp=lb,scale=1024:-10,harddup -oac faac -faacopts mpeg=4:object=2:raw:br=128 -af volnorm=1 -of lavf -lavfopts format=mp4

    $m = "";
    $m .= "mencoder $input -o '$output' ";
    $m .= "-ss 00:00:02 ";
    $m .= "-ovc x264 ";
    $m .= "-x264encopts qcomp=0.8:nocabac:level_idc=30:bframes=0:global_header:threads=auto:bitrate=1200 ";
    $m .= "-vf pp=lb,scale=1024:-10,harddup ";
    $m .= "-oac faac ";
    $m .= "-faacopts mpeg=4:object=2:raw:br=128 ";
    $m .= "-af volnorm=1 ";
    $m .= "-of lavf ";
    $m .= "-lavfopts format=mp4";

    UPDATE: Normalized Audio.

    Monday, March 8, 2010

    My Review of Sharpie Retractable Porous Point Pen

    Originally submitted at Discount Office

    Sharpie Retractable Pen features a soft grip for added writing comfort and fine point tip size for everyday writing and precise lines. Quick-drying ink prevents smearing. Water-resistant, acid-free ink is permanent on paper and won't bleed through paper. Color indicator on plunger helps disting...

    A good Sharpie Pen

    By Jim from Beaver Dam, WI on 3/8/2010


    4out of 5

    Pros: Ink Dries Quickly

    Describe Yourself: Value Oriented

    Primary use: Business

    This is basically a very thin tip Sharpie marker that is retractable instead of having a cap. It has an extra long plunger because of the different mechanism to keep it from drying out.


    Wednesday, February 17, 2010

    P3P Explained: Compact Privacy Policies in 2010

    Your first point of reference for P3P should be the wikipedia page. It'll give you a good overview. Here's the basics:
    • Microsoft helped pay for it.
    • Microsoft browsers are the only browsers that still use it.
    • Microsoft browsers have never used it correctly.
    When Internet Explorer (IE6 - IE8) is in the "High" Privacy mode it "Blocks all cookies from websites that do not have a compact privacy policy." So if you want to set a cookie on an IE browser in "High" Privacy, you need a compact privacy policy.  You don't need a well formed policy, you don't need a valid policy, you can put swears in your policy and it'll still be accepted.

    In PHP:
    <?php header('P3P: CP="JUNK DATA"'); >