Get it while its hot. Its so hot I can hardly load the page. This is what torrents were made for.
Archive for the 'Linux' Category
Listening to Sinhalen FOSS. Sounds good! This is probably the first Sinhala podcast!
Some people couldn't read the Sinhala text. Get the fonts at www.fonts.lk. Kottu will also start to look better.
I wanted to authorize my web host with my Cygwin shell to do some backups. I'm used to ssh-copy-id but Cygwin doesn't have it. I found this script that does the trick.
A better ssh-copy-id | smithii.com
I put this code in a ssh-copy-id.sh file.
#!/bin/sh
# $Id$
SSH="${HOME}/.ssh"
if [ ! -f "${SSH}/identity.pub" ]
then
PASSPHRASE=
read -p "Enter ssh passphrase for ${HOSTNAME}:" PASSPHRASE
ssh-keygen -t rsa1 -N "$PASSPHRASE" -f "${SSH}/identity"
ssh-keygen -t rsa -N "$PASSPHRASE" -f "${SSH}/id_rsa"
ssh-keygen -t dsa -N "$PASSPHRASE" -f "${SSH}/id_dsa"
chmod -f go-w "${SSH}" "${SSH}/authorized_keys*"
fi
cd "${SSH}" && \
tar -c id*.pub | \
ssh $* 'tar -x
SSH="${HOME}/.ssh"
if [ ! -f "${SSH}/identity.pub" ]
then
PASSPHRASE=
read -p "Enter ssh passphrase for ${HOSTNAME}:" PASSPHRASE
ssh-keygen -t rsa1 -N "$PASSPHRASE" -f "${SSH}/identity"
ssh-keygen -t rsa -N "$PASSPHRASE" -f "${SSH}/id_rsa"
ssh-keygen -t dsa -N "$PASSPHRASE" -f "${SSH}/id_dsa"
fi
cat identity.pub >>"${SSH}/authorized_keys"
cat id_dsa.pub id_rsa.pub >>"${SSH}/authorized_keys2"
chmod -f go-w "${SSH}" "${SSH}/authorized_keys*"
rm -f identity.pub id_dsa.pub id_rsa.pub
'
I heard on FLOSS Weekly 26: SQLite the other day about the vacuum command in SQLite and how it rebuilds the database and makes Apple Mail faster.
I started F-Spot to check some old photos and it was getting stuck. Hmm wait F-Spot uses a SQLite database too, so I tried something like this.
Went to the F-Spot directory.
cd /home/dilantha/.gnome2/f-spot
Backed up the current SQLite database.
cp photos.db photos.db.20080326
Opened the database
sqlite3 photos.db
Then in SQLite I got some help, listed tables and ran vacuum on photos and photo_tags.
.help
.tables
vacuum photos;
vacuum photo_tags;
.quit
Now F-Spot is running smooth as ever.
I wanted to backup from my work (Windows) box to my personal (Linux) box. I found these useful videos on setting up Samba file sharing. This first guy was right I didn't know about the extra configuration changes.
http://screencasts.ubuntu.com/SAMBA_Filesharing
Funny story. I did all this and didn't see the Linux box on the network. Hmm that's strange. I opened Firefox on Ubuntu to find no Internet either! With a quick glance at the back of the computer I saw the network cable was not plugged in.
I need to get another network cable for the mac. I keep switching between them.
Here is the Ubuntu Wiki page for Samba. Which has more details.
I've been moving some data using some CSV (Comma separated) files. There is no direct command in Windows to split or sort files. Unless you do it in Excel or Open Office. So I installed Cygwin. Here are a few examples in Cygwin or most Unix based shells how to split and sort files.
Example 1
There is a big file you want to split into smaller files.
split in.csv out.
split automatically splits 1000 lines each. If you want another number use -l 500 to get 500 lines.
split -l 500 in.csv out.
Example 2
You want to sort the second field in a CSV file in numeric order.
sort -n -k 2 in.csv > out.csv
For more details look up up the split and sort manuals.
man split
man sort
I'm trying out Git. Its a distributed version control system originally written by Linus Torvalds. I also looked at SVK and Mercurial but settled with Git since it's commands made more sense to me.
I was happy with Subversion since 2004. Working alone with my notebook and client servers it has been very useful. Now the problem is I have too many workstations, servers, repositories and checkouts lying around I have to check where my latest code is before I start on any project.
I tried moving them to 2 online servers and checking out from there. But its slow and when I loose power or without an Internet connection I'm stuck.
Git might help me. When I'm done working on a project I should be able to commit locally and also sync a remote repository when I'm online. That way when I'm on another pc I can pull from a remote repository and start working.
All this is speculation at this point I will report back if it works as planned. If not I'm sticking with Subversion.
Being on Ubuntu Gutsy Gibbon I tried a aptitude search to see if I can install it.
aptitude search git
I thought I found it and installed the git package. I was wrong. You have to install the git-core package to get git.
sudo aptitude install git-core
And if your like and have some Subversion repositories to import you need to also install git-svn.
sudo aptitude install git-svn
Now to import a Subversion repository create a new directory for your git workspace and run something like this.
git-svnimport -v http://path.to.your/repo/
Check out this tutorial introduction to git.
I just re-installed Ubuntu 7.10 on my home computer. Although this version was just released in October there are almost 180MB of updates needed as soon as you do a clean install now.
Running all those updates at once was going to be a pain. So I started removing some bigger packages and I realized there are about 130 of them!
Luckily you can right click in the package list area and select "Uncheck All" and only select the packages you want to install.
Update: I'm adding the update manager screen shot. You can can right click on any of the items to get the "Uncheck all", "Check all" menu.

Summery
In brief if you have new ssh client and server applications on 2 clean systems, you should be able to authenticate yourself using these 2 commands.
ssh-keygen
ssh-copy-id user@server
Once you are authenticated you can hop around computers more easily and run unattended tasks like backups without passing passwords around.
Background
We just got a few more servers at work bringing the total up to 8. About 6 have similar login accounts so life is a bit easier, then again for the number of times you have to login to 8 servers a day typing passwords can be a pain.
When passwords are too short they are not secure enough, too long and you can't remember them. So key exchange to the rescue. Basically you generate a pair of keys on your computer and add your public key to each of the servers you want to login without passwords.
I read a few guides about this and it worked for a while. Somewhere down the line the new servers refused to authenticate my keys. So I cleaned up and started from scratch.
Continue reading 'Easy Passwordless Shell Logins'
I upgraded to Ubuntu 7.10 Gutsy Gibbon over the weekend. Then I noticed Pidgin (formally Gaim) was not connecting properly. It was complaining about a SSL library.
I installed the nss library using this command.
sudo aptitude install libnss3-dev
It was mentioned in this thread and its working fine now.
Recent Comments