Archive for ‘Linux’ Category

Remote OSX server install via Apple Remote Desktop or VNC….

datePosted on 12:11, August 28th, 2008 by Many Ayromlou

Came across this issue a few weeks ago and never got around to posting it until today. Yes, you can avoid using the Server Assistant program and go straight to ARD to install your server. For this to work your server and remote desktop machines need to be on the same subnet. You boot the server using the 10.5 CD/DVD and note it’s serial number. Now you need to find out the IP address of the server and connect to it from your remote desktop machine. For this, you can run ARD and scan the subnet and find your new server. Once you’ve found it connect to it and login using the first eight characters of the machines serial number and leave the username blank. This even works from Windows/Linux machines using VNC which is great for those who use Windows/Linux on their desktop.

UNetbootin takes care of all your USB Linux installtion blues….

datePosted on 11:46, August 28th, 2008 by Many Ayromlou

I’d covered Fedora’s Live USB creator a while back. But for those of you wanting to install other flavours of linux on a USB stick (or a HD even), the process was lengthy and cumbersome. That was before UNetbootin, the Universal Netboot Installer. You see UNetbootin can be run from Linux or Windows and will enable you to install a fully functional linux distro to a USB stick or even a spare partition.

The current version has built-in support for the following distributions:

So go ahead and try some of those acquired flavors of Linux, or that FreeBSD you always wanted to install, but were too scared to. After all it’s only a USB stick, if it screws up just format and reinstall in 5-10 minutes using UNetbootin again.

UNetbootin can also be used to load various system utilities, including:

  • Parted Magic, a partition manager that can resize, repair, backup, and restore partitions.
  • Super Grub Disk, a boot utility that can restore and repair overwritten and misconfigured GRUB installs or directly boot various operating systems
  • Backtrack, a utility used for network analysis and penetration testing.
  • Ophcrack, a utility which can recover Windows passwords.
  • NTPasswd, a utility which can reset Windows passwords and edit the registry.
  • Gujin, a graphical bootloader that can also be used to boot various operating systems and media.
  • Smart Boot Manager (SBM), which can boot off CD-ROM and floppy drives on computers with a faulty BIOS.
  • FreeDOS, which can run BIOS flash and other legacy DOS utilities.

So have fun and happy installing…..

JumpBox: Super simple way of getting web services deployed.

datePosted on 15:48, June 27th, 2008 by Many Ayromlou


If you read our “Open Source Lovin’ for your Server” earlier this year and thought “that’s too much trouble”, here is an even easier way to sample preconfigured Open Source Application Servers at your own leasure. Be it for developement, fun, backup or even production, you can not beat JumpBox at simplicity. What they’ve done is basically created a virtual machine running linux with all the preconfigurations done for you. What this means is that I can — just by downloading a ~160MB file — run a full blown, preconfigured WordPress site in 2-3 minutes — of which 1-2 minutes are used up by parallels to boot the JumpBox virtual machine. You can even jump over to their blog and check out how you can setup your JumpBox to run off Amazon’s EC2 service…..Cloud Computing for the masses……yeah baby :-).

I used their parallel configuration on the Mac — JumpBoxes will run on all of the popular virtualization platforms including VMWare, Parallels, Microsoft Virtual PC/Server, Virtual Iron and Xen — and the static IP was all I had to configure to get the server up and running. If you have DHCP on your subnet/homerouter it’s even easier…..no thinking involved.

Well kids are you ready for todays lesson in transcoding DV video. So first you need a decent machine. I’m using a P4 2.4Ghz oldie that has Firewire on-board and am chewing up 50% CPU for NTSC encoding. Then you need to get Ubuntu 8.04 installed. Once that’s done use the following command to install vlc (Video Lan Client):
sudo apt-get install vlc
Then either follow this guide or if you’re using 8.04 (Hardy Heron) ONLY, use the following command to add Medibuntu to your repository sources.list:
sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
followed by
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
to add the GPG key for Medibuntu Repository. You may be asked to accept this package even though it cannot be authenticated. This is normal; typing “Yes” means you trust Medibuntu.
Now do the following commands to get libdvdcss and other codecs installed on your machine:
sudo apt-get install libdvdcss2
sudo apt-get install w32codecs (for i386 architecture) OR
sudo apt-get install w64codecs (for amd64 architecture)

Now that we have all the goodies installed and ready to go you can go ahead and connect that DV camera to your Ubuntu box using Firewire. Make sure it’s in Camera mode (NOT VCR) and open up a command line and type in the following command to get the encoder setup:
sudo -i (This will put you in superuser mode.....ie: root account)
cat /dev/dv1394/0 | vlc - :demux=rawdv -I dummy --sout '#transcode{vcodec=mp4v,vb=1024,acodec=mpga,ab=192,scale=1,width=720,height=480}:duplicate{dst=std{access=udp,mux=ts,dst=IPAddressofDestinationMachine:PortNumber}}'

You could also run the above command from your user account by adding sudo infront of it and supply your password followed by Enter key.

The above command (in case you’re wondering) will literally open device zero on the firewire chain and redirect it’s raw output into the VLC program. VLC is told to accept input from a pipe in rawdv format and to transcode it to mpeg4 Video @ 1Mb/s with mpeg1-layer3 audio @ 192 Kb/s.

Once the above command is running you’ll need to go to your receiving machine (the machine who’s IP you supplied in the command above), run VLC and from the File menu choose “Open Network Stream” and go with the default UDP/RTP on port 1234 (or whatever port you chose in the encoder command line).

Another neat thing you can do with your new found opensource goody bag is capture DV from your camera/settop box and save it in mpeg4 format for archival purposes (or mpeg2 for editing maybe). I’m not gonna get into the details, but assuming you’ve done the above commands, skip the encoder command and issue the following command to get your DV stream saved:
sudo -i
cat /dev/dv1394/0 | ffmpeg -f dv -i - -f mp4 -s 720x480 -vcodec mpeg4 -acodec aac -ab 128 -ar 44100 -deinterlace -b 3000k -y yourfilename.mp4

This command will take rawdv from the camera, pass it to ffmpeg, which will chew on it and spit it out as mpeg4 video @ 3Mb/s with AAC audio @ 128Kb/s into a file named yourfilename.mp4 (if the file exists it will overwrite it). Stopping is accomplished by CTRL-C. More info on this command can be found on ffmpeg’s man page.

Have Fun….

Tunnel to locally running mysql server using ssh

datePosted on 12:35, June 17th, 2008 by Many Ayromlou

Running and administrating mysql can sometimes be a hassle especially if you’re running a semi-secure environment. This usually means that your mysql server will not accept connections from outside and only localhost connections are allowed. There is a quick way of getting around this if you’re stuck somewhere and really need to use that graphical admin/browser tool to get to your DB server. All you really need to do is forward port 3306 on your local machine to port 3306 on the DB server through a ssh tunnel. Here is the ssh command you need to issue to start things up:
ssh -L 3306:127.0.0.1:3306 yoursshloginid@yourserver.yourdomain.com
Once you supply the password for the ssh session you’re in business, the encrypted tunnel is up and running. All you need now is to point Mysql Administrator graphical tool at host 127.0.0.1 (localhost) and port 3306 like the picture below:The only thing you want to make sure you get right is the 127.0.0.1, DO NOT use localhost. The tools you’re using automatically assume a local socket connection to the DB when you use “localhost” as the Server Hostname. Another thing is that all checks that mysql administrator does locally on the server files will not work (ie: the interface will report that the server is down since it can’t find mysqld.pid), but all users/schema manipulation works fine since they are network based.

If you have mysql daemon installed on your local machine (the machine you initiated ssh from) you need to change the local port to something else other than 3306 and the command will look something like this:
ssh -L 7777:127.0.0.1:3306 yoursshloginid@yourserver.yourdomain.com
In this case I’m using local port 7777 which means I also have to tell mysql administrator to connect through port 7777. You get the idea……

Four little Security tools you should install in Ubuntu

datePosted on 14:41, June 12th, 2008 by Many Ayromlou

These should probably also be installed under other linux distros (might already be). But for the sake of completeness here they are:

1) denyhosts: great little package that’s already 98% configured after apt-get install process. It runs as a daemon and monitors /var/log/auth.log file for unsuccessful ssh logins and takes measures to ban the originating IP in /etc/hosts.deny. The cool part is that it does not need access to firewall or anything. Config file is /etc/denyhosts.conf and is pretty self explanatory. Ubuntu package is called “denyhosts” and needs python to work.

2) chkrootkit: another little gem that you install via apt-get install process. Ubuntu package is called “chkrootkit”. After install do “man chkrootkit” for more info, but the gist of it is that when run from command line it uses it’s own utils (located in /usr/lib/chkrootkit) to see if the system is infected.

3) rkhunter: this util is really a giant shell script, but it’s really nice and easy to use. Again use Ubuntu package name “rkhunter” to install it. It’s config file goes into /etc/rkhunter.conf and is pretty nicely setup by default. Next run “rkhunter –update” to update the discription/signature files from their website, then run “rkhunter –propupd” to grab a snapshot of the various files installed on your system. This will be used later, every time you run the command to see if anything has been changed by trojans/rootkits. Finally run “rkhunter –check” to actually run all the tests and see if you’re good to go. At the end if there are warnings check /var/log/rkhunter.log for a list of explanations about those warnings (suspicious filenames, hidden file locations, etc.)

4) ufw: The netfilter (firewall) interface for the rest of us. If you’re like me too dense to remember the iptables lingo, this might be for you. See this page for a good introduction.

Have fun and remember kids Vitamin U(buntu) is good for you.

Twitter from Unix/Linux/OSX command line

datePosted on 11:33, June 12th, 2008 by Many Ayromlou

Yep, you can. Here is the recipe:

1) You need to install “curl” for your OS. OSX comes with it by default which is nice. Most unices out there also have it installed or have it available for download (Ubuntu, Debian users can use “sudo apt-get install curl” to install).
2) Edit a text file using your favourite editor and add the following line in there:
curl --basic --user "youruserid:yourpassword" --data-ascii "status=`echo $@|tr ' ' '+'`" "http://twitter.com/statuses/update.json" -o /dev/null
3) Make sure you replace youruserid and yourpassword with appropriate strings.
4) Save the file as something like twitter.sh and make it executable by issuing this command:
chmod 700 ./twitter.sh
5) Twitter away by using the following command line:
./twitter.sh "Put your twit in here and press Enter"
6) Done.

Have fun commandline twittering :-).

Some Unix/Linux Coolness…..

datePosted on 17:53, June 11th, 2008 by Many Ayromlou

I think every admin must do something stupid atleast once….right? Well my brain fart happened during a System upgrade (another story I’ll be ranting about later). I made backups of all the files I thought were important (/home, /etc, /var/lib/mysql and other userdata we had on the system) and installed Ubuntu 8.04 on the server. Well, of course the second person who walks in to report problems, asks me about his personal crontab……DOOOHHHHH!!!! Yeah I forgot to back that sucker up. Now, the lucky part of all this is that I just deleted the old directories on that partition, I did not format it. So once I realized that, I figured why not just search for it. I mean I knew something about the file, why shouldn’t I be able to just search the raw disk and look for a specific string I know existed in the crontab file. Well guess what you can and it works like a charm….here is how:

grep --binary-files=text -10 "DO NOT EDIT THIS FILE" /dev/sda9 >/tmp/output

This command was issued on a ext3 partition and found the portion of the file I was looking for in about 20 minutes (the partition is about 450GB). The Unix utils are marvelous and just using a single grep command (above) allows me to look for the string “DO NOT DELETE THIS FILE” (which I knew for fact was in my deleted file) and output 10 lines of text above and below that line into a temporary file. Now that’s power kids, don’t try this on your Winblows machine :-).

G rocks!!!…Linux users rejoice.

datePosted on 21:33, June 6th, 2008 by Many Ayromlou

Yeah, in case you haven’t figured it out yet, I LIKE GOOGLE. I like their spirit and I like the way they do their business. They just made my day (again) by releasing their desktop based google gadgets for linux for free and totally open sourced under Apache License 2.0 to boot. This is fantastic news for all Linux fanatics, as now you can leave those closed source OSes behind, format your harddisk and enjoy a great looking desktop on a OS that actually works (for a change).

Now if only MS and it’s minion (Carl Icahn) would leave Yahoo alone so they can port the Pipes engine to the linux desktop I’d be a happy man :-)

Glide OS 3.0 Webtop syncs with you Desktop now

datePosted on 12:16, May 30th, 2008 by Many Ayromlou


For those of you who haven’t tried it, you should really head over to glideos.com and create an account. It’s an excellent Webtop that provides a widerange of application plus 5GB of online storage for free (there are also commercial accounts for a small fee). Not only do they have one of the cleanest interfaces out there, they’ve also developed a cross platform application called glide that allows you to sync your webtop with your physical desktop machine. This is really useful specially if you’re in a situation where you use windows and linux at work and osx or something else at home. The glide application can sync all your online data between the different platforms.

12345678PreviousNext