Mac Madness

June 4, 2006 on 11:19 pm | In Blah Blah, Sysadmin | Comments Off

Macbook BlackSo I got a Macbook… and I have to say it is a fine piece of machinery (and the black one also looks nice). Almost everything about it is fantastic. The size of it, the keyboard, wifi and magsafe connector - all exceeded my expectations. Glossy screen - I have mixed feelings about. On one side it looks really nice in the dark, but it is rather annoying in the sun. But that’s not a real problem… the only real problem is the heat this thing puts off - boy, it gets hot!

With this laptop notebook it makes you want to work away from a desk, in bed, on the couch, but don’t start compiling something with it sitting on your lap - I get it as hot as 85C sometimes - and you really can’t touch the bottom of it… On the upside, if you take it camping - you could cook something on it.

With that “too much thermal paste” issue turning out to be a myth I guess only a firmware upgrade could boost the fan activity a little. I guess I would prefer to have the fans turn on before I go sterile.

So without further rambling, there are some links to software (mostly free) that has made my life on the mac more enjoyable. Mostly it’s the piece of software called Parallels that made me switch to the mac (coupled with Virtue Desktops - it makes switching between desktops wonderful). I use it to run XP & Ubuntu Dapper on top of OSX .

I will make a separate post about how I got my Treo 650 to sync with the macbook, and how to go online through bluetooth.

Enjoy!

Resources

Linux Terminal Server for Home Media PCs

March 7, 2006 on 2:28 am | In Blah Blah, Sysadmin | 19 Comments

AOpen Pandora MiniPCSo I bought this new AOpen Pandora box (yes - a beige box Mac Mini ripoff). I got a Pentium M 1.73GHz and 512Mb of RAM. It comes with a DVD Reader/CDRW and I didn’t buy a harddisk or anything else. My goal was to run a single terminal server for all the Media PCs in my apartment (I have 1 in the living room & 1 in the bedroom… thinking of putting one in the bathroom).

I figured my main computer can be the Terminal Server, but as I started building it I realized that building an i386 client image on an AMD64 box was an utter pain (the script that generated it complained all the time, even after I hardcoded my arch values into it). So I figured I will just create it inside VMWare running a i386. Luckily I had latest flight of Dapper there already.

The result is a VMWare image of a Terminal Server for Media PCs (running Freevo or MythTV) that can be deployed anywhere with the free VMWare player or just by coping the files to a bootable filesystem.

Preparation

To setup a Media PC Terminal Server: I installed the latest Ubuntu Dapper Flight 4 release i386 under VMWare. It is still very rough, but usable. I figured that running a terminal server in VMWare should be sufficient for testing, and if it is too slow I can always transfer the client images to be served from my main computer.
I started by reading this:

The key line I was looking for is how to use the local resources for certain applications, in my case a video player. I found it in the section about local applications:

In an LTSP environment, you have a choice of running the applications locally on the workstation, or remotely on the server (Source).

Actually it turned out that this wasn’t what I would need, but would still be useful for running Firefox, Amarok, etc using local resources, rather then the Terminal Server’s. Nevertheless, I decided to get my hands dirty.

Hit the command-line

AOpen Pandora MiniPC
This post is not intended as a HowTo - it is more of a journal of my adventure and notes to avoid my mistakes. While I talk about Freevo & VMWare a lot - they are not required. This same process will work for any application you want to run on the local resources of a terminal client or server. I imagine many people, who setup Linux media PCs, would benefit from a centralized client image and PXE boot ability.

I will not willy-nilly around the process. Here is the meat of setting it up:

On the Terminal Server box (in my case VMWare VM):

  sudo apt-get install ltsp-server-standalone \
           ltsp-utils student-control-panel \
           openssh-server
	
  sudo ltsp-build-client
  sudo ltsp-update-sshkeys

Configure the DHCP server (turn off any other ones if you have them):

/etc/ltsp/dhcpd.conf
	
  authoritative;
  default-lease-time            21600;
  max-lease-time                21600;
	
  subnet 10.0.0.0 netmask 255.255.255.0 {
    range 10.0.0.10 10.0.0.50;
    option domain-name “domain.com”;
    option domain-name-servers 10.0.0.1;
    option broadcast-address 10.0.0.255;
    option routers 10.0.0.1;
    option subnet-mask 255.255.255.0;
	
    filename “/ltsp/pxelinux.0″;
    option root-path “/opt/ltsp/i386″;
  }
	
  group   {
    use-host-decl-names       on;
    option log-servers        10.0.0.2;
	
    host pandora {
        hardware ethernet     00:00:00:00:00:00;
        fixed-address         10.0.0.3;
    }
  }

For the sake of this example my gateway is 10.0.0.1, my terminal server is 10.0.0.2, my terminal client (new AOpen box) is 10.0.0.3. All other terminal clients will get an address from .10 to .50

The picture there is my test environment. Laptop booted of PXE running Freevo on the right, 1TB storage computer under the desk, main computer running VMWare in the center & the AOpen Pandora box on my desk powering the right screen - showing the login prompt to the terminal server.

First Tests & First Problems

Now simply reboot the Terminal Server (or just restart tftp, nfs, portmap, dhcp, etc services). When the terminal server comes up - check that DHCP server is up too.

Pick any other computer (or another VMWare machine) and boot it off the network (PXE only). You should see it talk to the tftp server, get and IP and start to boot a kernel.

Now, this is where the problems will start.

Very briefly:

  • If nothing happens - be sure your BIOS settings are set to PXE boot or network boot (if on a laptop use the onboard lan, not the wireless)
  • If PXE comes up but doesn’t pick up the kernel - check TFTP and dhcp settings;
  • If kernel boots and you see the ubuntu boot splash - you are on the right track.
  • If it crashes mounting the root fs - check your NFS config (/etc/exports) also check that your are not binding portmapper on to localhost /etc/default/portmap).
  • If X doesn’t start check out the /etc/X11/xorg.conf on the client system (because the host’s version gets modified in the process of the boot). I personally hate configuring X (I’ve been doing it since 1999, when it was hip) so if looking at that file gives you a headache - here is a good trick: boot Ubuntu Live CD and copy it from there (presuming it booted fine). In case you do need to replace the xorg.conf file - don’t bother editing it on the system - it is running in a tmpfs and your changes will be lost. Instead read on to how to configure lts.conf file.
  • If you got a login prompt, but it doesn’t let you log in - well you’re on your own… read some logs… check the ssh keys…

If you are lucky (or careful) you will just get a prompt - login using an account that works on the terminal server - and enjoy the remote desktop. Also try the CTRL-ALT-F1…F6 - you should get vterms and be able to login locally (but only as the user that exists on the terminal client image - you will have to create one)

Configuring Terminal Clients

My Terminal Server is not solely for MediaPCs. I am planning to use for just general desktop as well (if it works well). So I decided to get a client working the way I like it.

First off, it doesn’t hurt to read over the ltsp setup script: /opt/ltsp/i386/etc/init.d/ltsp-client-setup. Refer to this script to understand why crazy things are happening to your client. Also, this is a the place to include /etc/hosts information and /etc/fstab what will be used by the clients - these files are generated by the script (among others).

Next I configured the /opt/ltsp/i386/etc/lts.conf with the following info:

[Default]
        SERVER = 10.0.0.2
        SOUND = Y
        SOUND_DAEMON = esd
        VOLUME = 75
	
# Pandora Specific
[10.0.0.3]
        XF86CONFIG_FILE = /etc/xorg.conf.pandora
        LOCAL_APPS = Y
        LOCAL_DEVICE_01 = /dev/hdb:cdrom
        LOCAL_DEVICE_02 = /dev/sda:usb
        SCREEN_01 = freevo

As you can see - I enable sound by default, but for the AOpen Pandora (my MediaPC) I issues a custom xorg.conf file (which is actually placed in that location on the client image), local cdrom and USB. I also set the SCREEN_01 to start freevo.

To enable the freevo screen script - go to this folder: /opt/ltsp/i386/usr/lib/ltsp/screen.d and add this script:

/opt/ltsp/i386/usr/lib/ltsp/screen.d/freevo
	
   #!/bin/bash
   killall esd
   su - tv /usr/bin/xinit /usr/bin/freevo
	

Be sure the script is chmod’ed 755.

In the script I kill esd (which I start it in the terminal server setup) this may seem silly, but it works such that if you boot into the desktop you have sound over esd, and if you start Freevo you have sound over oss.

Both sound & local media were rather problematic. I googled around and settled on following the advice of these pages:

Local Media Config - http://wiki.ltsp.org/twiki/bin/view/Ltsp/LocalMedia#Configuration
Sound Config - http://wiki.ltsp.org/twiki/bin/view/Ltsp/Sound

Getting Freevo into the Local Client Image

Installing things to the client image couldn’t be easier. On the host system, just update the sources.list in /opt/ltsp/i386/etc/apt/sources.list and chroot to the image:

   sudo chroot /opt/ltsp/i386
	
   apt-get update
   apt-get dist-upgrade

This is assuming you have the sources for freevo and mplayer as well as universe and multiverse. If you don’t know what I mean - check out this sources.list file.

After chrooting to the system and upgrading - I just ran this:

  apt-get install freevo mencoder tvtime xine-ui \
                           w32codecs libdvdcss2 libdvdcss \
                           libxine-extracodecs libjpeg-progs \
                           exiftran lame flac cdparanoia
   freevo setup
   freevo plugins -a

Last command lists all the installed modules. Most are not activated, but look over them and pick what you might think is useful.

Configure your Freevo as you like - edit the /etc/freevo/local_conf.py (if you are still chrooted). This post isn’t really about Freevo, as much as LTSP. You should have the same success with MythTV (also an excellent piece of software) or any other such application (for Linux, or course).

Just as a small tip, if you are using Freevo, add this to your local_conf.py

    plugin.activate('headlines', level=45)
    HEADLINES_LOCATIONS = [
       ('Slashdot', 'http://rss.slashdot.org/Slashdot/slashdot'),
       ('Digg', 'http://digg.com/rss/index.xml'),
       ('BBC World', 'http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml'),
       ('CNN', 'http://www.cnn.com/services/rss/')]

(Note: Freevo config (Python) doesn’t allow leading spaces - the parameter has to be the first character of the line)

Some useful Freevo pages:

If you are going to be starting freevo after a login (as a session or from a specific user) - this may be helpful. To have the user auto-login:

/etc/X11/gdm/gdm.conf
	
   AutomaticLoginEnable=true
   AutomaticLogin=USER

Where USER is the Freevo-enabled user. Then add this script:

AOpen Pandora MiniPC

/usr/share/xsessions/freevo.desktop
	
  [Desktop Entry]
  Encoding=UTF-8
  Name=Freevo
  Comment=Freevo
  TryExec=/usr/bin/freevo
  Exec=/usr/bin/freevo
  Icon=
  Type=Application

Last you will need to add a ~/.dmrc file to the home dir of the freevo users that says:

  [Desktop]
  Session=freevo

Now just restart gdm (/etc/init.d/gdm restart) and freevo will just come up.

To make the folder look nice - follow this advice:

Moreover you can specify an image to display in the folder’s parent menu by adding an image to the folder called cover.jpg or cover.png. The size of the image depends on the current type of the menu. For movies you have something like DVD covers or movie poster, for audio a cd cover. So the image will be resized to 280×200 for movies, 200×200 for audio and 200×160 for images. These sizes will also be used for the directory images. (Source Freevo Wiki)

The picture is my finished bedroom setup. The Pandora box boots off PXE, mounts root filesystem and all the media shares (music, videos, pictures). Headlines are provided by the rss streams described above.

All your remote are belong to lirc

I will shoot myself before I finish my lirc setup… but lots of people online talk about it working… Sooner or later I will fill in this section. For now I got a USB keyboard and a long cable. UPDATE: I just got a wireless keyboard with multimedia buttons - I think it is even better then a remote - because I can type emails or just browse the web with it.

Can’t blog anymore… Gotta go watch something.

If this helped someone - I am glad… I sure tried to find a guide like this while reading every script in ltsp. In the end - it works! And it works great! Uses 5% on my client system resources to play video and uses the VMWare terminal server for NFS only (1-2% occasionally). Everything is fast, the sound is synced, video is crispy.

Now, am I going to keep it on VMWare or move it to the main system? I sort of did this in VMWare as a testbed, but now I think I will keep it. It runs fast. It is portable, so I can have it setup on several computers. I can take to a friend’s house. The whole image (both server and client) works out to be just under 3Gb - easily fits on a DVD with the free VMWare player.

Post a comment if you have questions.

Alex Pachikov - 2006 - Digg this Page

RAID on a Remote Debian Box

August 24, 2005 on 10:11 pm | In Sysadmin | Comments Off

I am addicted to RAID. If there are 2 disks in a computer - there needs to be at least 1 RAID partition. If there are 2 identical disks - well then it almost begs to be a full RAID1 - grub, root, home, swap. If this box is a server - then it is a must.

The fun part is doing this on a remote box to which you have limited physical access. And by limited I mean - you can call a guy who may or may not be able to read the console and push the reset button when you can’t boot.

So I decided to do this… and I took some notes… I added a some comments, but otherwise it is a complete no-fluff doc of commands and output you should be seeing to get a non-raid system moved a raid1 with grub, root, home and swap ready for a failure of one disk.

The tricky bit is initrd and grub config, but I got it working in a couple dozen or so commands.

Hope this helps.

Resources:

Nice looking Mac

August 20, 2005 on 1:05 am | In Blah Blah, Sysadmin | Comments Off

I don\'t think this is a Mac

Who said that Apple’s Intel switch is a slap in the face to IBM?!

OSX running in VMWare

August 15, 2005 on 11:55 am | In Blah Blah, Sysadmin | Comments Off

OSX running in VMWare

There has been lots of people reporting OSX running on PC hardware and in VMWare, but it is never enough until you see it for yourself: screenshot.

I am not going to say whos fully legal, for-demo-purposes-only, screenshot this is - but it boots, it works (sort of slowly) and it is OSX.

The only question remains - is this part of Steve’s Intel switch plan? Or a side-effect of hackers who can’t sit still? I think it is a little of both.

Extreme Ironing

August 10, 2005 on 6:24 pm | In Blah Blah | Comments Off

Extreme Ironing (BBC)Just read about this interesting new sport. At first seemed like a joke on some guys’s site (Extreme Ironing) but a quick Google images search turned up a whole lot more:

Google Images for EI
BBC Article

“Extreme ironing is the latest danger sport that combines the thrills
of an extreme outdoor activity with the satisfaction of a well pressed shirt.”

Bro Intrusion Detection System

August 10, 2005 on 6:24 pm | In Sysadmin | Comments Off

This is something that I have read about and thinking about trying out:

Bro Intrusion Detection System - Bro Overview
Bro is a Unix-based Network Intrusion Detection System (IDS). Bro monitors network traffic and detects intrusion attempts based on the traffic characteristics and content. Bro detects intrusions by comparing network traffic against rules describing events that are deemed troublesome. These rules might describe activities (e.g., certain hosts connecting to certain services), what activities are worth alerting (e.g., attempts to a given number of different hosts constitutes a “scan”), or signatures describing known attacks or access to known vulnerabilities. If Bro detects something of interest, it can be instructed to either issue a log entry or initiate the execution of an operating system command.

Bro targets high-speed (Gbps), high-volume intrusion detection. By judiciously leveraging packet filtering techniques, Bro is able to achieve the performance necessary to do so while running on commercially available PC hardware, and thus can serve as a cost effective means of monitoring a site’s Internet connection.

I’ll post more about it once I give it a spin…

Blue Security - AntiSpam

July 21, 2005 on 5:45 pm | In Sysadmin | 3 Comments


Recently I stumbled over this company: Blue Security

They basically keep track of the spam you forward to them and file complaints on your behalf. I have had it running for 2-3 days now, but I haven’t yet noticed any reduction in the spam that I receive (about 100/day on my personal account).

Here is a quote from their site: “The Do Not Intrude Registry is enforced by the Blue Community and uses Blue Security’s Active Deterrence, a patent-pending technology that disrupts the business of merchants, advertisers and spammers who choose to ignore the Do Not Intrude Registry.”

I am going to continue using it for a while and see if it helps… if so I will post about it again… Meanwhile I think it is a cool idea and that it has some potential for positive results.

Birthday present from NASA

July 21, 2005 on 2:08 pm | In Blah Blah | Comments Off

On the day of my 25th birthday, presumably as a present to me, NASA decided to launch the Discovery Shuttle. While I am very happy for such a wonderful present, I read something in their report that didn’t make much sense: “Shuttle engineers investigating the anomaly believe that electromagnetic interference from existing or new hardware, such as additional cameras or heaters attached to the bipod fitting that connects Discovery to its external tank, and a small grounding issue with sensor wiring may be the culprit.” From space.com.

So what is it, a grounding problem or EM interference? I looked at some of the diagrams (http://www.nasa.gov/images/content/122488main_ECO_sensors.jpg) and it looks like it is shielded pretty well inside the tank… so how is EM messing with it? And why is it only messing with one of four sensors? Much more likely is the grounding problem, but I can’t find much details about it…

Good luck to NASA!

Magic Tar

July 20, 2005 on 3:53 pm | In Sysadmin | 2 Comments

People ask me all the time what the hell is ‘magic tar’ and why should anyone use it. I learned about this from a sys-admin at the University of Colorodo, Boulder - Andrew Scrivner - and have always been thankful for it.

Here is a sample of the command:

Magic Tar:
tar cf - . | (cd /where; tar xf -)

Here is the same command modified to run over SSH:

Magic Tar over SSH:
tar cf - . | ssh user@host "cd /where; tar cf -"

Use it or suffer from losing permissions, links, owner/group, etc…

So, this is some sort of a blog…

July 20, 2005 on 12:55 pm | In Blah Blah | Comments Off

Been a little while that I wanted to have a blog, but never knew if I would post anything useful there…

Today - I don’t have an answer to this question, but at least now I have a blog and I have posted something…

http://moon.google.com - is pretty sweet… too bad it is only a tiny portion of the moon and isn’t at a good resolution… I want to see the flag that they left there… What we don’t have telescopes powerful enough to see it? How about photos that we taken by the Eagle as it was taking off? There has got to be something…

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds. Valid XHTML and CSS. ^Top^