Archive for the ‘ubuntu’ Category

HOWTO: Install Citrix ICA Client on Ubuntu 8.10 64-bit

Monday, February 2nd, 2009

First off, go ahead and install some libraries:

sudo apt-get install libxaw7 libmotif3

Go to http://www.citrix.com , click on “Downloads”, then click on “Citrix XenApp”, then select Linux clients. Download the tarball for Motif in your preferred language. Place it on your Desktop, and open a terminal.

cd ~/Desktop
mkdir citrix && mv ./en.linuxx86.tar.gz ./citrix && cd ./citrix
tar xvzf en.linuxx86.tar.gz

sudo ./setupwfc

The install prompts should accept default input.

Now we’re going to need to go grab a 32-bit copy of libmotif3. Click here and select a mirror. Download the file to your Desktop.

Open up a terminal again, we’re going to pluck out the 32-bit motif libraries that we need.
cd ~/Desktop
mkdir motif
mv libmotif* ./motif/ && cd ./motif
ar -x ./libmotif*
tar xvzf data.tar.gz
cd ./usr/lib/
cp * /usr/lib32/

Now go on and run wfcmgr!

Citrix ICA Client running on Ubuntu 8.10 64-bit

Ta-da!

-LightningCrash

Making Ubuntu boot in 19 seconds, pt2

Friday, September 14th, 2007

I wrote before about my experiments in Ubuntu boot times and mentioned doing a fresh install and just disabling the dhcp and network manager. I got a lot of good input and wanted to expand upon that.

Setup
My secondary workstation is a Dell GX270 with a 3.0GHz P4 processor, 1GB of RAM and a 40GB Seagate ST340014A hard drive. I blew away the existing install again, reinstalled Feisty with the default settings, specified my static IP, and updated via apt-get. The current kernel version is 2.6.20-16-generic i686.

Getting started
I installed bootchart via sudo apt-get install bootchart and rebooted. My boot time was 29 seconds.
My /etc/network/interfaces file again contained entries for eth1, eth2, ath0 and wlan0. I deleted all of these.
Again, the if-up, if-down, and pre and post-up had entries for wireless and avahi stuff i didn’t want, so I removed the following
sudo -s
rm /etc/network/if-down.d/avahi-autoipd
rm /etc/network/if-post-down.d/wireless-tools
rm /etc/network/if-pre-up.d/wireless-tools
rm /etc/network/if-up.d/avahi-autoipd
rm /etc/network/if-up.d/avahi-daemon
exit

I rebooted and checked my boot time again

I reprofiled my boot sequence, then rebooted: 23 seconds.

Sysv-rc-conf
At this point I installed and fired up sysv-rc-conf (sudo apt-get install sysv-rc-conf)
I disabled the following:

bluetooth
cupsys
hotkey-setup
hplip
powernowd
rsync
wpa-ifupdown

Boot time after removing the services: 22 seconds

At this point, bootchart seems to be limited by a few particular processes:
Disk-related:
khubd
scsi_eh 1
modprobe
rc

CPU Related:
udevd
ckbcomp
hald
Xorg

It looks like udevd is still loading wacom junk
sudo find /etc -name '*wacom*' -type f -delete
hehe, took care of that.
I also enabled concurrent shell scripts while I was at it.
Still at 22 seconds.
I cleaned up /etc/acpi, as there were a ton of modules loaded that I didn’t use: 22 seconds.
I installed prelinking and then rebooted: 22 seconds.
I blacklisted ipv6 and a handful of other modules that were loaded for no reason whatsoever: 22 seconds.
I reprofiled and rebooted: 20 seconds.
At this point it looks like readahead itself takes up about 5 seconds of uninterruptable I/O.

Now to try out some of the stuff that my readers posted.
mgarces said to try initNG. So I grabbed the deb files for initng and the initng ifiles from initng.org and did a dpkg -i initng*.deb
But it didn’t boot……so I googled and ran across this page. I followed the directions there and got it to boot. HAL is complaining and I don’t feel like troubleshooting it right now.
But wait, bootchart isn’t working either. Crap.
Oh, even better, eth0 didn’t come up.
sudo dpkg -r initng
sudo dpkg -r initng-ifiles
Bye-bye initng!

So I figured, why not play with the schedulers?
CFQ=22 seconds
deadline=23 seconds
noop=23 seconds
as=23 seconds

So, even now, nothing really helps.

Well, I’m really getting burned out, maybe there will be a part 3 for this sometime.

Until next time!
-LightningCrash

Digg.com Ubuntu popular headline analysis

Saturday, September 8th, 2007

I was curious what the most popular keywords were in the Ubuntu headlines, since it seemed like some of them seemed identical.
So I saved the top 10 pages of results for the search term Ubuntu, sorted by Most Diggs.
With all of the pages in a directory, I cut out the headlines and stripped the HTML with the following command:

$ cat *.html|grep news-body|sed -e 's/<[^<>]*>//g' > diggubuntuheadlines.txt

Now I have a list of each headline. Unfortunately, though, this also returns headlines from articles that just mention Ubuntu, so I killed the lines that didn’t have Ubuntu.

$ grep -i ubuntu diggubuntuheadlines.txt > diggubuntuheadlines2.txt

Now I want to pull out a list of unique words in the file, the number of occurences of each word, sorted by the most occurences descending. Thanks to this short perl script posted by planetscape, I have a solution.

I paste the contents into a file, change the first line to read /usr/bin/perl, save it, then chmod +x the file.

Next I pipe the contents of the file into the script, and save the output.

$ cat diggubuntuheadlines2.txt | ./countwords.pl > diggheadlinecount.txt

Well, I guess that’s enough foreplay, what’s the verdict?

117 ubuntu
25 to
22 linux
20 windows
19 a
14 in
14 dell
12 with
12 on
12 for
11 the
9 and
8 install
7 vista
7 of
7 how
6 your
6 you
6 from
5 released
5 pcs
5 out
5 new
5 is
5 guide
5 feisty
5 by
4 without
4 what
4 users
4 than
4 s
4 has
4 free
4 best
3 xp
3 video
3 ultimate
3 time
3 switching
3 should
3 running
3 run
3 over
3 os
3 official
3 mythtv
3 more
3 microsoft
3 media
3 logo
3 like
3 know
3 installing
3 get
3 fawn
3 fast
3 edition
3 edgy
3 dock
3 boot
3 based
3 as
3 anything
3 about
2 x
2 world
2 will
2 way
2 vs
2 vote
2 using
2 up
2 tutorial
2 top
2 this
2 there
2 t
2 support
2 studio
2 stickers
2 side
2 shuttleworth
2 review
2 read
2 powered
2 pic
2 pc
2 password
2 osx
2 online
2 one
2 officially
2 now
2 need
2 multimedia
2 mount
2 mce
2 mark
2 make
2 magazine
2 looks
2 look
2 laptop
2 it
2 installed
2 gifting
2 full
2 eye
2 ever
2 dual
2 distribution
2 desktop
2 days
2 core
2 completely
2 compiz
2 cheap
2 center
2 cd
2 candy
2 breezy
2 box
2 books
2 beryl
2 be
2 are
2 applications
2 almost
1 year
1 xps
1 xorg
1 xgl
1 write
1 writabable
1 wpics
1 would
1 working
1 wireless
1 winxp
1 wins
1 wine
1 why
1 whole
1 while
1 wga
1 wep
1 welcome
1 web
1 weapons
1 we
1 was
1 warranty
1 warcraft
1 want
1 wall
1 voted
1 vmware
1 virus
1 victorious
1 versus
1 validates
1 uses
1 user
1 useful
1 us
1 unmount
1 ui
1 ugly
1 tweaks
1 tweaking
1 tutorials
1 try
1 truth
1 triple
1 tricks
1 transparent
1 transform
1 today
1 tips
1 tier
1 thursday
1 thinks
1 things
1 their
1 ten
1 technical
1 tad
1 system
1 switches
1 switch
1 supported
1 super
1 sun
1 strip
1 story
1 still
1 sticker
1 steps
1 stable
1 squad
1 spread
1 spotted
1 spiffing
1 software
1 smoke
1 single
1 simple
1 shrink
1 shirt
1 shift
1 shell
1 server
1 searched
1 seamless
1 screwup
1 screenshots
1 screen
1 satanic
1 root
1 rom
1 rising
1 right
1 reviewit
1 repository
1 reported
1 release
1 redesign
1 really
1 readable
1 ran
1 ram
1 quietly
1 purchase
1 progress
1 products
1 preview
1 prettier
1 preinstalled
1 prebuilt
1 pre
1 posters
1 possibly
1 popularity
1 popular
1 pm
1 player
1 picture
1 physics
1 photoshop
1 performance
1 perfectly
1 partition
1 part
1 parliament
1 or
1 onto
1 office
1 offers
1 offering
1 ntfs
1 nrg
1 notebooks
1 not
1 non
1 next
1 network
1 n
1 mod
1 million
1 might
1 mdf
1 mcgee
1 mcdonalds
1 marketplace
1 manufacturers
1 makes
1 macbook
1 mac
1 looking
1 links
1 lifehacker
1 life
1 less
1 just
1 issue
1 iso
1 introducing
1 internet
1 interface
1 instlux
1 installer
1 installation
1 insane
1 inaccurate
1 impressed
1 immediately
1 images
1 image
1 if
1 i
1 hungry
1 howto
1 house
1 hours
1 hot
1 holy
1 hippo
1 heron
1 hell
1 hardy
1 happen
1 guy
1 gui
1 growing
1 great
1 gnu
1 gnome
1 glass
1 girl
1 getting
1 gets
1 genuine
1 fusion
1 french
1 forces
1 followup
1 fixed
1 first
1 firefox
1 finally
1 few
1 father
1 faster
1 fantastic
1 extended
1 explains
1 explained
1 expensive
1 expect
1 existing
1 excellent
1 exactly
1 everything
1 everyone
1 engine
1 embargo
1 eft
1 easyubuntu
1 easy
1 easier
1 dvddecrypter
1 dvd
1 dualview
1 drops
1 drivers
1 download
1 door
1 doesn
1 does
1 do
1 disturbing
1 distributing
1 dismissed
1 diggers
1 demo
1 debian
1 customs
1 customization
1 cst
1 cs
1 cracking
1 could
1 converts
1 controls
1 confirmed
1 conf
1 computers
1 complete
1 comparison
1 community
1 commercial
1 coming
1 com
1 colors
1 click
1 cleartext
1 cleaning
1 circle
1 choose
1 card
1 canonical
1 building
1 build
1 bug
1 booting
1 black
1 bittorrent
1 billboard
1 better
1 been
1 beautiful
1 basics
1 badger
1 awesome
1 award
1 available
1 at
1 artwork
1 arrives
1 arrived
1 april
1 apps
1 any
1 an
1 american
1 amd
1 amazing
1 alumni
1 after
1 advantages
1 administrator

No surprises here, but it may be helpful when you go to write your next Digg headline. :)

Until next time

-LightningCrash

Making Ubuntu boot in 19 seconds

Tuesday, August 28th, 2007

Foreword
I started to take it upon myself to speed up the boot process of my secondary workstation, but I decided I needed a way to quantitatively measure the boot process. I wanted to document my results in a way that could be reproduced, and I wanted to be very methodical in the process.

Setup
My secondary workstation is a Dell GX270 with a 3.0GHz P4 processor, 1GB of RAM and a 40GB Seagate ST340014A hard drive. I blew away the existing install, reinstalled Feisty with the default settings, specified my static IP, and updated via apt-get. The kernel is 2.6.20-16-generic #2 SMP i686.
To measure the boot times, I turned Automatic Login on for my user account. Then I made a file called imup.sh in my home directory, with the following contents, and put it in my session startup:
nc mymaindesktop 89 -z

This meant that when GNOME was up and running, my secondary desktop would attempt a TCP connection to my primary desktop. This I can quantify. First, I got a root shell by executing ‘sudo -s,’ and then I typed the following command into my console:
time nc -l -p 89 -vvn

I don’t execute it just yet. I hit the power button on my test machine and the Enter key on my primary desktop simultaneously. When the test machine hits the desktop, I’m presented with output similar to the following on my main desktop:

listening on [any] 89 … connect to [10.1.1.1] from (UNKNOWN) [10.1.1.2] 30958 sent 0, rcvd 0 real 0m46.919s
user 0m0.000s

sys 0m0.004s

So at this point, I know it took about 47 seconds to boot all the way to the GNOME desktop from a cold start. I repeat all my tests 3 times to make sure that the number is accurate. In the descriptions of each boot, save the Base Install, I’ll try to link to a page detailing how to replicate my process.

Some Results
Base Install (Fresh install, updated via apt-get):
47 seconds
Prelinking installed and run: 49 seconds
Disabling hplip: 47 seconds
Disabling various services: 49 seconds
(I also disabled brltty in the above)
Running prelink again after the above: 47 seconds

Bootchart
At this point, I installed bootchart via apt-get ( sudo apt-get install bootchart) and rebooted.
Then I began to examine just what was using up the most time during my boot process.
It looks like under S40Networking, dhclient is being run and then executing a sleep. Funny because I have specified a STATIC IP. So I went into /etc/network , and edited out all of the extra interfaces from /etc/network/interfaces. Only eth0 and lo remained. I also went into all of the directories inside /etc/network and moved all of those files to backup folders elsewhere. I don’t use avahi and I don’t use WPA, so those things shouldn’t run, right? So I removed those and went along my way.

But wait, bootchart tells you how long it took to boot! Which, after removing those files, appears to have decreased from 30 seconds to 24 seconds. Now we’re getting somewhere, and this article is going to take a different turn.

Avahi
Next, remember how I removed the avahi bits from /etc/network/? Avahi is still running. I don’t care to discover what’s on my network, and I want it to go. I just have to edit /etc/defaults/avahi and set that =1 to =0. If all goes well, it won’t run next boot.

25 seconds.
Oh well.

More Results
Next, I enabled concurrent init shell scripts.: 24 seconds.
I disabled usplash: 24 seconds
I reprofiled the bootup and restarted: 20 seconds
I went into /etc/readahead/ and edited every line containing hlip, blue, or avahi from the files boot and desktop: 20 seconds
I disabled readahead altogether: 25 seconds
Turned readahead back on, reprofiled: 20 seconds

Trying to optimize readahead
Next, I sorted through the /etc/readahead/boot file and sorted out the list by time last accessed.
Which did nothing, because readahead had accessed them all in the order that they were in /etc/readahead/boot.
So I disabled readahead, rebooted, and went back through and sorted the list again. Some of the files had not been accessed in the past 24hrs, or in the last boot, so I omitted those from the list.
This made the boot time 22 seconds. Oops. Maybe I shouldn’t have omitted those files that haven’t been accessed in the last 24hrs.
Out of the blue, I removed ipv6 from the modules list: 21 seconds
So I sorted the original list again, and didn’t prune anything from the list: 21 seconds
I put the original list back: 20 seconds
I disabled the kinit resume function: 20 seconds
I blacklisted xpad, the Xbox controller module: 20 seconds
Next, I went into the BIOS and disabled all of the stuff I didn’t need, like the floppy controller, serial ports, parallel port, etc: 20 seconds
I disabled the wacom lines in xorg.conf, and turned on boot logging: 20 seconds
I noticed that something to do with Wacom was still being loaded, so I went through all of the /etc/rcX.d directories and disabled them: still at 20 seconds
I don’t have a printer connected to this computer, nor will I ever, so I disabled cups: 19 seconds
I found that /etc/inittab does nothing now. The extra ttys are spawned in /etc/event.d, so I removed tty3, 4, 5, and 6, then rebooted: 19 seconds
Next, since I have a static IP and a completely static connection, I removed the packages for dhcdbd, network-manager, and network-manager-gnome, then rebooted: 19 seconds.
I generated another initramfs: 19 seconds.

I could go further, since I have no need for sound, or anacron, but at this point I’m severely I/O limited, according to the bootchart. Maybe 90% of the boot process is spent in I/O wait. I doubt disabling those will even shave a half second off of my boot times.

Just for kicks, I removed bootchart and tried out my old method three times: It takes 40 seconds to get to a desktop from the moment I push the power button. Not too shabby for older hardware.

Conclusion
All in all, it looks like the best speedups to get are from:
1. Reprofiling with readahead
2. Setting a static IP for your network (if you’re a desktop user like me)

Everything else was just a waste of time. At a later date I may reinstall, then simply try the reprofiling and disabling DHCP, and see how long that takes. If I had a dual-core CPU, I may have seen a benefit from concurrency. At this point it seems like the easiest way to speed up boot even more would be to use a faster/dual-core CPU or get faster disks. Maybe I’ll bring in my Seagate X15 from home and give that a shot.

The 10 most useful applications in Ubuntu

Wednesday, August 22nd, 2007

Many of these applications are the reason I switched to Ubuntu at home, and I have made them a staple of my technology lifestyle. If you’re someone who has just gotten started tinkering with Ubuntu (or GNU/Linux in general), you should give these a shot.

10. vim / gvim
Vim is the editor of choice for everything I do (well, except excessive copying and pasting from Firefox.) The capabilities of vim will far exceed anything I’ll ever do with it. Periodically, though, I have to do something ridiculous to a file, and vim saves the day. Want to run a macro that will trim the first three characters off of every line in a file, add a semicolon at the end of every line, and replace every instance of FOO with BAR? Vim can do it. To install, simply the following a command prompt:

sudo apt-get install vim

Now you can execute vi (or vim) from the command prompt and get to editing away. Here’s a cheatsheet for how to get around. There are hundreds of pages about the vim editor, search the net to find more!
Even if you run Windows, you can still enjoy some of the vim goodness. Just to go www.vim.org and grab the Win32 Installer. You won’t get the command-line vim, but you will get the always-handy gVim.

9. The GNU find command
The GNU find program is part of the Ubuntu default installation, so there is no need to install it.
A lot of people rely on the locate command to find files, and that does serve its purpose very well. Where the GNU find command is useful is finding files of a specific nature, or acting upon those files in particular. For instance, if you want to get the MD5 checksum of every file in a directory, just CD to that directory and execute the following at the command prompt:

find ./ -type f -exec md5sum {} \;

You can even use the GNU find command to delete files that haven’t been updated in a given timeframe (for instance, log files older than 90 days.) First, you should open a terminal and cd to the directory with the log files, usually /var/log. Then, running the following will print those files to the command line:

find ./ -type f -mtime +90

Adding -delete to the end of that line, and executing it again, will delete all files older than 90 days in that folder and every folder underneath it, as long as your user account has file permissions to do so!

8. Midnight Commander
If you remember Doubletree from the DOS days, then Midnight Commander will probably be your new best friend. If you haven’t enabled the additional apt-get repositories yet, please visit the Ubuntu Guide and complete that before taking the next step.
To install Midnight Commander, type the following at a terminal prompt:

sudo apt-get install mc

Midnight Commander is great for traversing the filesystem quickly, and even moreso when you’re doing the same remotely via SSH. You can edit files from within MC, and even browse a remote filesystem via an SSH connection with it (and without installing SSHFS.)
To run, simply open a terminal window and execute ‘mc

7. Mplayer
I know you can get mplayer for Windows, but it’s just not the same. Again, you’ll want to visit the Ubuntu Guide to enable the additional apt-get repositories if you haven’t already. To install mplayer, open a terminal window and execute the following:

sudo apt-get install mplayer

Mplayer has a special place in my heart as the media player that would play just about everything, even in the days when other players wouldn’t. Other media players have made some headway, but mplayer still has tricks up its sleeves. It will even play VCDs directly from a .bin file!

6. Rsync
Looking back, this was probably one of the main reasons I went to Ubuntu at home. There is just not a suitable Rsync application for Windows. Period. I have a directory that follows me around wherever I go, it resides in my home directory as ‘sync’. When I log in at work or on my laptop, it is copied down from my main desktop at home. When I log out, the directory is synchronized back with my main desktop at home. Here is a great article from Linux.com detailing how to use rsync in some practical ways. To install rsync, pull up that terminal prompt and type:

sudo apt-get install rsync

5. Alltray
Alltray allows you to take any window and minimize it to an icon. If you like the way that GAIM/Pidgin stashes away, and want other windows to do the same, try out Alltray!

sudo apt-get install alltray

After you’re done installing, go to Applications->Accessories->Alltray, then just click on the window you want to turn into an icon. To bring the window back, just click on the icon.

4. TightVNC Server
Oh, I know what you’re thinking: “TightVNC is available for Windows, LC! Why is this worthy of mention?!” The Windows TightVNC implementation allows you to remote in to your existing desktop. The Linux implementation, however, allows you to remote in to a discrete desktop environment. You can even run multiple discrete VNC servers on the same Ubuntu box. I use this to give an Xorg environment to items I want to leave running all the time. Azureus, among other applications, stays running in the VNC session and I can check up on my seeding efforts from afar. To install, simply open a terminal window and execute the following:

sudo apt-get install tightvncserver

To run a VNC server, simply execute ‘vncserver‘ from any terminal. You can set a password for the VNC server by executing ‘vncpasswdfrom a terminal. You can automate the startup of vncserver, but I usually just launch it when I need it and then tromp around from there.

3. Fuse SSHFS
Got SSH access to another computer, but want to view the files on that computer as if they were on your own filesystem? SSHFS has you covered. The Ubuntu Blog has a better HOWTO on this than I could ever write, so go pay them a visit. I find SSHFS very handy when I want to listen to my home music collection from another computer on another network, but don’t want to carry multiple copies of everything around with me. Editing PHP files on my remote webserver got a lot easier, too.

2. SABnzbd
If you download anything at all from Newsgroups, you’ll appreciate some of the things that SABnzbd offers. SABnzbd will download, PAR check, unRAR and clean up any NZB that you throw at it. It offers a web interface and will monitor a directory for automatic pickup. I installed SABnzbd manually, but you can always check out this thread on the Ubuntu Forums to pick up a script that will install everything for you. There are no packages in apt-get repositories to install SABnzbd, so everything must be done the less convenient way. The results are well worth the effort, though.

1. Yakuake
If you’ve ever played any of the Quake series games (or games derived from iD software game engines,) you probably remember hitting the tilde (~) key to bring down a console where you could mess with game settings. Yakuake stashes a terminal window in the same manner, tied to the F12 key. You can reassign the key to any keystroke or combination that you like. I have mine set to CTRL + * at work (since they’re right next to each other on a Northgate keyboard), and Windows Key + Open Dialog Menu Key on my personal machines.
To install, execute the following at a terminal prompt:

sudo apt-get install yakuake

To run, type ‘yakuake &‘ at a terminal, and you should see a message that Yakuake started! Now you have a stowable terminal at your fingertips. Just press F12 to make it drop down.