Archive for the ‘Linux’ Category

Feisty, Faster than Fedora. Fantastic!

Monday, April 23rd, 2007

OK, so recently I decided to drop Fedora on my work machine and just move over to Ubuntu. The day I posted about that, I began the install. That afternoon, I had a working system and was MORE than happy!

What a difference! Not only do I now have apt-<whatever> and all of Debian’s wonderful tools for package management, I have a faster, more fun to use computer! I had no idea that changing to Ubuntu would yield such an increase in performance, but everything is faster. Opening OpenOffice programs to Desktop Effects is just running extremely well!

I was initially disappointed that I would only be running Debian based distros. This side-effect has certainly changed my mind for now. I don’t even miss Fedora (no hate for it, but no love either).

I may not know what Ubuntu does differently, but I know I like it :D – So there you have it folks. My quick opinion on Ubuntu Vs. Fedora.

Feisty Beta Laptop Fun

Sunday, April 8th, 2007

I’ve just spent a few hours chilling out with Feisty on my notebook. I’m using a Dell Latitude D600 machine. So far I’m really digging some of the nicer touches in Gnome and I think I’m enjoying the NetworkManager integration (we’ll see, it’s been a problem for me before).

Firstly, as looks go, Feisty isn’t that different from Edgy. Similar bootsplash and Gnome theme. I’ve been a fan of the bootsplash since I first saw it on Edgy, the text is a little thicker now and has a more pronounced light outline. It looks a little softer too, I’m liking it. I have no real opinion on the Human theme, I never use it long enough to notice when it changes. It’s not that I don’t like it, I just like blues better,

I found that both the Universe and Multiverse repos are enabled by default. They should be, since (IMO) you need them to really get the full range of applications and use of your machine. Still, there are some things worth having that aren’t available in the standard repos and you need to go a little further. I found out about Medibuntu whilst doing a little research and added it. You can find out how on this page https://help.ubuntu.com/community/Medibuntu. This allowed me to install the w32codecs and a few other non-free/proprietary apps/whatevers.

I checked out the new Restricted Drivers Manager. It was exactly what I expected, useless for me! I don’t have any hardware in this machine that would require any restricted drivers. Hopefully I’ll finally get the Nvidia card I’ve been talking myself into and out of for months and I’ll be able to test the utility out on my desktop.

I was able to test the new Codec manager. This is a gem! It really simplifies getting mp3 and other proprietary codecs on your machine. All you have to do is try to play a file (mp3 for instance). It will just prompt you download/install the codec and you’ll be ready to roll. NICE.

One of the nicer, user friendly features is hidden, I don’t know what the logic behind this is, but I have to assume there is some. If you want to check out the gnome-control-center (without typing that whenever you want to use it), you’ll have to use the menu editor (System > Preferences > Main Menu) and enable it. You’ll find it under the Preferences heading, just check the box next to Control Center. The control center isn’t new, but it certainly looks a lot nicer than the version that shipped with Edgy. Just another enhancement. :)

If you’ve ever used session management in Gnome, check out the updated session manager. You should be pleased. Nuff said.

I can’t say much about the desktop effects on this machine, I’ve always had problems with Compiz and Beryl on it. It just has older hardware and compositing desktop window managers just don’t run well. I look forward to playing with it on my desktop machine later.

All in all, the beta release is working VERY well on my lappy. I’m monitoring a few things for problems and will address them in another post later on this week. I’ve posted “too soon” in the past and I want to be sure things are working properly for me before I say they are.

Evaluating Wikiware

Thursday, March 22nd, 2007

I need to document a lot of things both personally and at work. I’ve always just created static documents or web pages and just made them available to others. It works, it may not be elegant, but it works :)

I’ve just downloaded 2 VMware appliances, one includes Twiki, and the other MediaWiki (of wikipedia fame). I’m going to take some time to evaluate both (yeah I know I’m supposed to be reading about LVM, this is in addition to). I’m going to document what I learn about LVM in my Wikis and see which “feels right” to me.

I’ve already started using Twiki, I don’t find it difficult, the shorthand is easy enough to learn, but I have nothing to compare it to. Hence the download of MediaWiki. I can muck it up, see what I like, which package I prefer, and then see about installing my own wiki and migrating my work over. Should be a nice learning experience.

This is just another killer use for VMware appliances. Just start the VMs up, play and delete. No muss, no fuss. Love that!

You can download the Twiki appliance from http://twiki.org/cgi-bin/view/Codev.TWikiVMDebianStable

You can download the MediaWiki appliance from http://www.rpath.org/rbuilder/project/vehera-base/

SSH Tab Completion in Fedora Core 6

Monday, February 19th, 2007

I’ve found that the extended tab-complete functionality in Ubuntu is a major timesaver. I do a LOT of SSHing from machine to machine in my house as well as to machines out there on the Internet. I use my ~/.ssh/config file to set up easy-to-remember names for these machines and then use the command line to connect. For example, to connect to my Anapnea.net shell account, I have a block in my config file that looks like this:

host anapnea
hostname anapnea.net
user fakeusername
identityfile ~/.ssh/id

When I want to log in, I open my terminal program of choice and enter ssh ana<tab> and press enter. Pressing tab expands to anapnea and I make my connection saving 4 keystrokes.

Note: For those interested, SSH tab-complete will expand to the value of host or hostname. That’s handy if you can remember the actual hostname of the machine and you’ve forgotten what you entered as the value of host (yeah, I’ve done it). If that makes no sense to you, you can get more information on SSH config files with man 5 ssh_config.

Tab complete also works with lftp and some other programs when using Ubuntu. I’ve found the lack of it in Fedora a little frustrating (I keep pressing tab and get nothing). I did a little Googling to find out just what program sets up this functionality and checked the Fedora repos for it. Thankfully it can be found in all it’s glory and awaiting installation in Fedora extras.

su -c 'yum install bash-completion'

A few seconds later, you’re ready to bank your keystrokes and tab complete to your heart’s content.

Note: Any terminal sessions that were open when you installed the package won’t utilize it until you either restart the session or enter bash at the prompt. It seems that your shell needs to source the newly created /etc/profile.d/bash_completion.sh script. This is done when you invoke BASH by opening a terminal prompt or executing bash at the command line.

Playing with XFCE 4.4 on Fedora Core 6

Thursday, February 8th, 2007

I’ve been terribly busy over the last few days, I started playing with Mutt and XFCE 4.4 on Fedora. Who knew it (“it” being mutt) would take over my life?? Mutt is going to take some time to explain, and since I haven’t got it doing exactly what I want yet, I’ll hold off on talking about it. I can tell you this, I’ll be damned if I’ll let it beat me. I will own (or should I be cool and use “pwn”?) mutt, and once I do, I’ll try to tell you how I did it.

Since XFCE is easier to get into, I’ll explain that. My work machine is a bit of a dog. At least it’s feeling that way. To improve the feel of it, I decided to give a lighter weight desktop a shot and I installed the latest XFCE. To put it simply, wow! What a difference.

Now this isn’t my first experience with XFCE. Back when I had only been using Linux for a month or two, I installed it to take a peek. I was completely dependent on my desktop environment at that time. If it didn’t take care of mounting devices and network resources, I couldn’t use it. Back to Gnome or KDE I went.

I’m more comfortable with Linux now and can either mount devices on my own or edit /etc/fstab to make mounting automatic. That being the case, I can move on to some of the more “manual” desktops (yayy me!).

Installing XFCE was a breeze, su -c 'yum groupinstall XFCE' and a little coffee to pass the time was all it took. After that, log in and start customizing.

One of the first things I had to do after setting up my desktop was to find out how to lock the workstation. XFCE allows you to trigger a lock by hitting CTRL+ALT+DEL; that sequence executes /usr/bin/xflock4 which in turn, starts the screen saver (I found/figured this info under Keyboard Settings) .

Unfortunately, that wasn’t working for me. There was no error message or any indication that the key sequence was doing anything. I opened a terminal, found the script and checked it out. The script attempts to run xscreensaver-command -lock or xlock. I didn’t have any executables matching those filenames on my box, so off to google I went. The Gentoo wiki offered me this page. With that info, I created /usr/bin/xlock and added the lines below:

#!/bin/bash
/usr/bin/gnome-screensaver-command -l

All that was left to do was to set the proper mode on the file; chmod 755 /usr/bin/xlock (as root). With that done, the magic key sequence locked my box and allowed me to walk away.

***Edit*** I also had to add gnome-screensaver to autostarted applications

Notes:

  • I rely too much on Google. If I had taken a minute to think, I wouldn’t have needed the Gentoo wiki to tell me to create the xlock script. This annoys me about myself, I too often look for the easy answer.
  • I decided to use the Gnome screen saver because it was already installed and I knew it could do the job.
  • I could have just installed the xscreensaver package but that just would have added software I don’t need.

I’ll keep playing and tweaking, so far this is great. I can only complain about the screen lock issue and the fact that adding items to the panel is a little clunky. Other than that, I’m flying around my machine with breakneck speed and it ROCKS. Got some time on your hands? Install it, play with it, see if you like it. :)

Debian and Linux Vserver

Monday, February 5th, 2007

I’ve spent the last few days playing with Linux Vserver on Debian Etch . This is a killer virtualization project, you can find out about it over at http://linux-vserver.org. What prompted me to check it out was this tutorial.

After reading up on it, I found it impossible to stop thinking about. I had a few minutes that evening so I created a test VMware guest with a base install of Debian Etch and followed the tutorial above. I had a working vserver in what felt like no time at all.

Having a running vserver guest and doing something with it are (of course) two different things. If you’re going to play with vserver, do some reading. That’s the best advice I can give you. The vserver site has plenty of docs and an official IRC channel for user to user support. That said, IMO some of the site docs are lacking. I found myself getting a little miffed over a few things. However, after talking to some other users I was able to get where I needed to be. That would have to be my only complaint about the whole project, clearly detailed docs would be helpful for a newb.

If you’re interested in running an Internet server in a seriously locked down environment, I would certainly take some time to look into the Linux Vserver project. You won’t need the hardware resources that a VMware guest would require and you’ll have many of the same benefits. I’m in the process of testing an FTP guest right now. I think I have everything worked out and documented so that I can recreate it. I’m LOVING it.

Just another great option in the virtual machine arena, have fun! Below are some links for good reading.

PDF splitting with pdftk

Thursday, February 1st, 2007

Just a quickie, this morning I needed to post the monthly payroll calendars for 2007 to our website. These calendars are created using Word’s calendar template and are then sent to me for conversion to PDF and publishing. This year I was able to handle the task a little differently.

I opened the 12 page doc file in OpenOffice and exported it to PDF. There wasn’t a clear way to save each page as an individual file so my output was a single PDF. I needed a fast and easy way to split the pages up for publishing. I remembered some chatter on the GNHLUG list regarding pdftk so I installed it, took a brief look at the man page and did the following:

pdftk Calender2007.pdf burst output ~/tmp/%02d-2007.pdf

Poof! Calendar split out to 12 files named 01-2007.pdf, 02-2007.pdf and so on.

This saved time and eliminated the annoyance factor completely!  The tools available for Linux blow my mind, these are programs I never would have even heard of when I was strictly Windows.  Change is GOOD.

DD-WRT: Password Free Login to LAN Hosts from DD-WRT Shell

Monday, January 22nd, 2007

The Dropbear SSH client included on the DD-WRT firmware can make it trivial for you to access computers on your network without exposing them to the Internet. For example, let’s say I have remote SSH management enabled on my router, and I have a computer named ubuntu running an SSHd on my LAN. I want to log into ubuntu from anywhere but don’t want to forward ports from the WAN side of the router to that machine. All I need to do is SSH into my router, and from the DD-WRT shell prompt enter ssh [username]@ubuntu and provide my password. All very easy to do and keeps my machines away from the world on the ugly side of the router/firewall.

Now, ubuntu is only accessible from the LAN, so to make my life a little easier, I want to allow password-less logins, this is how it’s done.

This builds off of DD-WRT: SSH Remote Management with Public Key Authentication and DD-WRT: Samba Startup Script / Reconfigure Dropbear SSHd. Just to keep things fresh, the router only allows logins via public-key authentication, the machine ubuntu hosts the script that the router launches at startup on a Samba share (smb://ubuntu/ddwrt). The local path to that share on ubuntu is ~/ddwrt. The router will map that share to /tmp/smbshare during startup and will execute the dd-wrt-startup.sh script located there.

Configure public-key authenication on the Linux machine:

Since I used this machine to create a keypair earlier, I’m just going to recycle. Up until now, I’ve only configured this machine to make connections to other hosts using public-key authentication. Now I need to accept public-key auth connections from other hosts.

To do this, I need to create an authorized_keys file in ~/.ssh/. The command below will write my ~/.ssh/id_rsa.pub file to the bottom of a pre-existing authorized_keys file or create a new one if it doesn’t exist. This file allows me to authenticate with my private key on the computer ubuntu.

cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys

Copy private key to router and convert it:

Next, I need to get my private key someplace accessible to the router, I’m just copying it to the Samba share that auto-mounts when the router starts up.

cp -v ~/.ssh/id_rsa ~/ddwrt/

Now, I remove the password from the copy of the private key, this is mandatory. DD-WRT’s Dropbear client has its own format for private keys and cannot convert encrypted (password protected) OpenSSH keys. Not to mention that I actually WANT password-less logins :) . Just follow the prompts provided after executing the next command.

ssh-keygen -p -f ~/ddwrt/id_rsa

Note: This key will NEVER leave my personal network so I’m not worried about it getting into the hands of anyone I don’t trust.

Next I SSH into the router.

ssh root@192.168.1.1 -i ~/.ssh/id_rsa

Using dropbearkonvert I convert the OpenSSH key to a Dropbear key.

dropbearkonvert openssh dropbear /tmp/smbshare/id_rsa /tmp/smbshare/id_dropbear

Install private key to home dir at router startup:

The last step is to have the key installed to the /tmp/root/.ssh/ directory on the router whenever the router starts up. I could opt to leave the key on the Samba mount, but I decided to put it on the router because I actually have more than one machine I want to get to. If for some reason the machine running the Samba server is off-line, I wouldn’t have access to the private key.

To automagically install the key, I need to add the lines below to the router’s startup script, this can be done from the router, vi /tmp/smbshare/dd-wrt-startup.sh or from my desktop using my editor of choice nano ~/ddwrt/dd-wrt-startup.sh.

## install dropbear private key for passwordless login to other machines
cp /tmp/smbshare/id_dropbear /tmp/root/.ssh/
chmod 600 /tmp/root/.ssh/id_dropbear

You can reboot the router to test the script or you can manually enter cp /tmp/smbshare/id_dropbear /tmp/root/.ssh/ on the router and test it by entering ssh [username]@[hostname] -i ~/.ssh/id_dropbear. This should bring up a prompt similar to the one below:

Host ‘ubuntu’ is not in the trusted hosts file.
(fingerprint md5 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx)
Do you want to continue connecting? (y/n)

Answering “y” will add the host to ~/.ssh/known_hosts and I won’t be prompted about it again until I reboot the router. If I want to permanently add all of my machines to known_hosts, I can connect to each one of them and answer “y” at the Do you want to continue connecting? Prompt. After all of my hosts are known, I copy the file from the router to my Samba share (cp ~/.ssh/known_hosts /tmp/smbshare). Lastly, I go back to my startup script and add the line below.

cp /tmp/smbshare/known_hosts /tmp/root/.ssh/

that’s all folks, the router will install the files I need whenever it reboots and I have access to all of my machines through ONE tightly locked door.

Installing Flash Player 9 Final

Wednesday, January 17th, 2007

The first non-beta version of Flash 9 for Linux is out, you can download the installer from Adobe’s site. I downloaded the tar.gz installer and had no problem whatsoever installing it. The instructions are on the download page, and all you’ll need to know before hand is where your browsers are installed to. To find out, you can use the package management tools included in your distro.

Fedora:

rpm -ql firefox

This query will give you a lot of information (you might want to pipe it to less). What you want to zero in on is the directory that is referenced most, on my system it’s /usr/lib/firefox-1.5.0.9/. You’ll notice a lot of references to /usr/share/ and can pretty much ignore them. That directory holds icons, .desktop files and other shared objects.

I did the same for SeaMonkey (rpm -ql seamonkey), the install location for the current version of the monkey is /usr/lib/seamonkey-1.0.7/.

Ubuntu:

dpkg -L firefox

That’s another command that will hand you TONS of information. Again, I only care about the installation directory, I know from using Ubuntu that the standard application install location is /usr/lib/[installdir]. So to clean up the output, I used grep to filter out the data I don’t need (you could do the same on the Fedora example above).

dpkg -L firefox |grep /usr/lib

That gave me something that looked like:

/usr/lib
/usr/lib/firefox
/usr/lib/firefox/firefox
/usr/lib/firefox/libgfxpsshar.so
/usr/lib/firefox/libgkgfx.so
/usr/lib/firefox/libgtkembedmoz.so
/usr/lib/firefox/libgtkxtbin.so
/usr/lib/firefox/libjsj.so
[snip]

From that I can see that Ubuntu installs Firefox to /usr/lib/firefox.

I also use SeaMonkey on Ubuntu, but I had to manually install it. For that reason, dpkg has no clue as to where the software is. I chose to install it to /usr/local/seamonkey, which is the location that the SeaMonkey installer suggests. I just keep that in the back of my mind or I could enter a locate seamonkey. That will return a lot of hits as well and will look something like:

/usr/bin/seamonkey
/usr/local/seamonkey
/usr/local/seamonkey/install.log
/usr/local/seamonkey/registry
/usr/local/seamonkey/libplds4.so
/usr/local/seamonkey/libxpcom.so
/usr/local/seamonkey/libmozz.so
[snip]

Now that I know where my browsers are installed to, I can run the Flash installer and give it the correct path to each browser when asked.

DD-WRT: Samba Startup Script / Reconfigure Dropbear SSHd

Monday, January 15th, 2007

Yep, still working with DD-WRT :) .. I wanted to make some changes to the router config but these changes aren’t available in DD-WRT’s control panel. Since we’re working with Linux here, I figured there had to be SOME way to hack it up.. Well, I was correct! The firmware has some features that make it pretty simple to execute a script at startup. You have some options, one is to enable JFFS and physically store a script on the router. Another is to mount a Samba share on startup and keep your script there. I opted for the Samba share because it can store your script as well as allow you to upload files (via scp for instance) directly to a computer on your network through your SSHd.

The script I’m creating is only useful if you have your router configured for remote SSH management (see DD-WRT: SSH Remote Management with Public Key Authentication for my how-to). The configuration process applies to setting up any startup script on a Samba share.

The script I want to execute on startup is going to change the configuration of the Dropbear SSHd. By default, when you connect to the router via SSH, you’re presented with a pre-login prompt advertising the firmware’s version. I prefer not sharing that info with anyone (not in such a blatant fashion at any rate), so I need to kill off the dropbear process and restart it without the banner flag. You might be wondering why I don’t just edit dropbear’s config file on the router… The simple answer is that there isn’t one. :)

I’m going to be using a Samba share I’ve created just for DD-WRT on the machine named ubuntu (also my desktop). The local path is ~/ddwrt and the network path is smb://ubuntu/ddwrt

Create the script:

Create a script on your Samba share named dd-wrt-startup.sh. One way to create the file is to enter the commands below in a terminal.

cd ~/ddwrt
touch dd-wrt-startup.sh

Open ~/ddwrt/dd-wrt-startup.sh with your editor of choice and add the text below (each command should be on its own line):

#!/bin/sh
## kill/restart dropbear; remove pre-logon message
killall dropbear
dropbear -r /tmp/root/.ssh/ssh_host_rsa_key -d /tmp/root/.ssh/ssh_host_dss_key -p 22 -s

Be sure that when you specify the port (-p 22), you use the same port that you have configured in the DD-WRT control panel.

The difference between the command to launch dropbear that I wrote, and the command the router defaults to, is that I’ve removed the banner file flag (-b [path to loginprompt]). If you want to see what the exact command line is on your router before you make the change, SSH in and enter a ps, someplace in the process list you’ll see the dropbear command line.

Configure Samba FS Automount:

Before going on, be sure that the Samba server has a static IP or (better yet) a static DHCP address. If you don’t use static DHCP, you may want to use the machine’s IP address instead of its name when configuring the share below. Check out the DD-WRT DNSMasq wiki page for more info.

Log into the DD-WRT Control Panel, Click Administration then select the Management tab. Scroll down to the Samba FS Automount section and configure as follows:

  • SMB Filesystem: Enable
  • Share: //ubuntu/ddwrt
  • User Name: [valid smb user]
  • Password: [smb user's password]
  • Startscript: dd-wrt-startup.sh

Now all you need to do is click Save Settings and Reboot Router. The next time you SSH in, you’ll notice that no information about the router is given until you’ve provided your credentials and successfully authenticated. You will also notice that entering the mount command will show you that your Samba share is mounted to /tmp/smbshare.