Friday, July 27, 2007

SysAdminDay

Today as now it is the last Friday of July, is the System Administrator Appreciation Day.

Hmmm... still no gifts, no mails, no messages... only sysadmins know about this thing? Maybe I had to change motd...

rsync

rsync is in the top 10 of my most frequently used programs. Do you use it? If not, let me give a some hints about why and how you should use it.

rsync is an open source utility that provides fast incremental file transfer. So it is the best choise for making backups.

Ok what you need? Files to copy (ok let's say that you have files, and important let's say important files... by the way how old is your winchester, and your backups?), and let's say that you have a place to backup (I use my server, with RAID, for that reason, but another winchester can be used too.). If you use a server then rsync deamon should be started.

Let's copy! It's something like:

rsync -va --delete --inplace --progress \
myDir1 myDir2 myFile1 \
stone@myServer.org:myBackupDir/

Ok It may seem a bit difficult, but is isn't!:) You may notice that is is like cp some options (tons this time) and a source (3 for now) and a destination, in this case it contains a server and a user name (can missing if a local directory is the destination).

I use the following options: v - verbose (I like to see what's happening:)), a witch is stand for archive, and can composest the following options in one: r - recusrive, l - links to copy symlinks as symlinks, p - perms to preserve permissions, t - times to preserve times, g - group to preserver group,o - owner to preserver owner and D to save devices and special files as they exist. --delete says to delete files whom not exists on the sender, --progress means a nice progress indicator, and --inplace means to update destination files in-place.

Was it difficult? Then check the man page, and I promise that after a few try it will be crystal clear!

Oh you say you like GUIs? Ok then grab Grsync!



And now go and make some backups!:)

Friday, July 20, 2007

ZyXEL ZyAIR G-202 in Ubuntu Linux, a step-by-step tutorial

UPDATE: in Ubuntu 7.10 Gutsy Gibbon it is supported by default.

Ok here it is!:) So you wanna use your ZyXEL ZyAIR G-202 in linux? Let's do it!

Firts of all you need about 3-4G space, and a couple hours of CPU time.

We have to compile the new kernel since the current Ubuntu kernel doesn't includes the support for the stick I have (Vendor=0586 ProdID=3410, chip=AL2230_RF), your may be supported according the manufacturing date and the chip what is in it.

How to check it? Simply plug it in and if it works it works!:) If not read on!

Let's get the new kernel from http://kernel.org/ you need the one in the line The latest stable version of the Linux kernel is: and get the one with the F (full).

Let's go root!

sudo -i

Move the downloaded file to /usr/src and uncompress it. (From now I will suppose that the downloaded kernel version is 2.6.22.1, if your is different modify the following according that.)
mv linux-2.6.22.1.tar.bz2 /usr/src
cd /usr/src
tar xjf linux-2.6.22.1.tar.bz2
ln -s linux-2.6.22.1 linux
cd linux

Check your stick's Vendor and ProdID in the file /drivers/net/wireless/zd1211rw/zd_usb.c in my case
{ USB_DEVICE(0x0586, 0x3410), ...
shows that it is supported. If your not... good question... let's suppose that it is there.

Let's copy the current kernel configuration file to the current kernel:
cp /boot/config-`uname -r` ./.config

Configure it to support your ZyXEL ZyAIR G-202:
make menuconfig

You will find it at Device Drivers -> Network device support -> Wireless LAN -> ZyDAS ZD1211/ZD1211B USB-wireless support. Hit SPACE until M is displayed before it. So to compile it as a module.

Exit and save the config file with the default name .config and compile the kernel with the Ubuntu way:
make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-custom \
kernel_image kernel_headers

Ok this will take long... a couple of hours so watch a good film, I recommend The Sting.:)

Ok when it is ready let's install our new kernel!

cd /usr/src
dpkg -i linux-image-2.6.22.1-custom_2.6.22.1-custom-10.00.Custom_i386.deb
dpkg -i linux-headers-2.6.22.1-custom_2.6.22.1-custom-10.00.Custom_i386.deb

(If you can't find these files then something went wrong with the compile or the file name may differ, but you sure will find them in the /usr/src directory.)

Now it is installed, and you will find it in the boot menu, so chose it and plug your stick in and go wireless!:)

If something goes bad check the Linux Wireless page and the link in the middle of the post about the kernel compilation!

Convert midi to wav

I play the guitar, the only reasonable way to get backing track is to download midi files and delete guitar. I use TuxGuitar for this. But my Mp3/Ogg player can't play midi files (I haven't heard about one, that can.) so I have to convert it to wav and after to ogg.

To convert midi files to wav, you need timidity.

And you can convert it with:

timidity input.mid -Ow -o out.wav

For more options check the man page.

Thursday, July 19, 2007

< NO > OOXML

Please read and sign the petition.

Tuesday, July 17, 2007

Cedega CVS

Cedega (formerly known as WineX) is TransGaming Technologies' proprietary fork of Wine (from when the license of Wine wasn't the LGPL but the X11 license), which is designed specifically for running games written for Microsoft Windows under Linux. As such, its primary focus is implementing the DirectX API.

The community has managed to keep Wine in touch with developments in Cedega; some games and 3D applications perform almost as well as when natively running under Microsoft Windows.

Cedega is not free, it costs a few dolars per month or tenth of dollars for a year. But because of Cadega is a fork of wine it had to take the original GPL license, so you cen get the source for free from CVS.

You can grab a small script and a good howto from linuX-gamers.net
to make your life easier when installing it.

Thursday, July 12, 2007

Automatically Unlocking the Default Gnome-Keyring

I am lazy. MY Gnome-Keyring has the same password as my login password, and nowadays I use wireless, and it's WPA password is stored in the keyring. A few minutes ago a got a new RSS blog item about letting PAM handle the authentication of my keyring. This is the process:

First let's install libpam-keyring:

sudo aptitude install libpam-keyring

Then edit /etc/pam.d/gdm, and place the following line at the end of the file:
@include common-pamkeyring

That's all!:) By the way, if your login password and gnome-keyring password are different this will not work.

Thanks to Christer Edwards - Automatically Unlocking the Default Gnome-Keyring : PAM Keyring

Update: In Gutsy it is changed a bit. So you need libpam-gnome-keyring and nothing else. The /etc/pam.d/gdm file should be good without a touch.

Update: For a while it is working by default.

Tuesday, July 10, 2007

TimeVault - Going back in time in Ubuntu


TimeVault is an application that performs a function similar to Apple's TimeMachine(TM) for Ubuntu linux.

It is a simple front-end for making snapshots of a set of directories. Snapshots are a copy of a directory structure or file at a certain point in time. Restore functionality is integrated into Nautilus - previous versions of a file or directory that has a snapshot can be accessed by examining the properties and selecting the 'Previous Versions' tab.

Snapshots are protected from accidental deletion or modification since they are read-only by default. The super-user can delete intermediate snapshots to save space, but files and directories that existed before or after the deletion will still be accessible.

You can find more info about it in the Ubuntu Wiki and on the projects Launchpad page.

Friday, July 6, 2007

P2P programs I like

First of all I don't like centralized P2P networks, like: torrent, dc, ... I believe in the Gnutella network.

So the programs I use:

1. gtk-gnutella - The Graphical Unix Gnutella Client



gtk-gnutella is a server/client for Gnutella. It runs on every Unix-like system which supports GTK+ (1.2 or above) and libxml. The GNOME desktop environment is not required. It is currently developed and tested under Linux (Debian) as well as NetBSD. It is known to run at least on Linux, FreeBSD, NetBSD, OpenBSD, Darwin, Solaris, Tru64 UNIX (OSF/1), SGI IRIX, BeOS whereas CPU architectures include x86, AMD64, PowerPC, SPARC, MIPS.

It is released under the GNU General Public License (GPL).

gtk-gnutella is not finished yet, but it is fully functional: you may share, search, and download. And it is stable too, users usually just leave it run unattended for days.

2. rTorrent


It uses the libTorrent library what is a BitTorrent library written in C++ for *nix, with a focus on high performance and good code. The library differentiates itself from other implementations by transfering directly from file pages to the network stack. On high-bandwidth connections it is able to seed at 3 times the speed of the official client.
The client uses ncurses and is ideal for use with screen or dtach. It supports saving of sessions and allows the user to add and remove torrents.

I only use rTorrent for seeding Ubuntu torrents on my server.

Wednesday, July 4, 2007

Ubuntu T-shirt

I got my Ubuntu T-shirts today, from the local Ubuntu team!:) Here is a scratch about how it looks like.

I leadned the lesson about partitioning

I always thought that splitting the disk to many partitions for home, var, boot, etc... is useless and wasteful.

Yesterday I learned the lesson... I was busy with copying files to my $HOME, and during I created a new user. Everything seemed ok, except that once I fulled my partition and had to delete some stuff before I could continue.

The horror came when I rebooted. GDM didn't wanna to start because the gdm group wasn't existed! Opppss...

The cause discovered soon: my /etc/group was 0 bytes long... the horror part two came after that... I wasn't able to switch to root because my root group wasn't existed...

The solution was to boot from the Ubuntu CD and copy the edited group file in place. But doing this with my ancient CD-ROM drive... it was horror.

So the lesson: give a separate partition to your home, and never ever delete your group file!:)

Monday, July 2, 2007

Mythbuntu 7.10 Public Alpha 2


Mythbuntu team has released Mythbuntu 7.10 Public Alpha 2 today, the Ubuntu derivative focused upon setting up a standalone MythTV system similar to Knoppmyth or Mythdora.

Changes from Alpha 1:


This release can now be used for a full install of any of the following types:
- Master Backend / Frontend
- Master Backend
- Slave Backend / Frontend
- Slave Backend
- Frontend

Also, the install can be customized for the following items:


- All official plugins and their dependencies
- Proprietary ATI & Nvidia drivers
- TV Out for Svideo, Composite, & Component
- SSH Server
- Preconfigured NFS Server based upon plugins
- Preconfigured Samba Server based upon plugins
- VNC Server & Password
- MySQL root password
- Open up MySQL port automatically for remote Frontend and Backend accessibility
- Official Themes

Support has also been added for:


- Improved video performance within Live mode.
- Copying MySQL settings from live mode within the installer for Slave Backend & Frontend setups
- Connection testing for Slave Backend & Frontend setups

Known Issues:


- Mythweb doesn't yet include support for htaccess
- Tuner and firmware detection isn't activated yet
- Lirc configuration not included yet

Useful Firefox add-ons

I use the following Firefox add-ons, I hope you may find this or that useful.:)

1. DownThemAll!

The first and only download manager/accelerator built inside Firefox!

DownThemAll is all you can desire from a download manager: it features an advanced accelerator that increases speed up to 400% and it allows you to pause and resume downloads at any time!

DownThemAll is fast, reliable and easy-to-use! It lets you download all the links or images contained in a webpage and much more: you can refine your downloads by fully customizable criteria to get only what you really want!

2. Fasterfox

Performance and network tweaks for Firefox.

Fasterfox allows you to tweak many network and rendering settings such as simultaneous connections, pipelining, cache, DNS cache, and initial paint delay.

Dynamic speed increases can be obtained with the unique prefetching mechanism, which recycles idle bandwidth by silently loading and caching all of the links on the page you are browsing.

A popup blocker for popups initiated by Flash plug-ins is also included.

3. Flashblock

Never be annoyed by a Flash animation again! Blocks Flash so it won't get in your way, but if you want to see it, just click on...

Flashblock is an extension for the Mozilla, Firefox, and Netscape browsers that takes a pessimistic approach to dealing with Macromedia Flash content on a webpage and blocks ALL Flash content from loading. It then leaves placeholders on the webpage that allow you to click to download and then view the Flash content.

4. ReloadEvery

Reloads web pages every so many seconds or minutes. The function is accessible via the context menu (menu you get when you right click on a web page) or via a drop down menu on the reload button.

Useful when you play online games, where you must wait for your opponent, when waiting for something happen on a forum, of when wanna see your webstat nearly realtime.

5. Remove It Permanently

Permanently hide content from web pages using the Context Menu. Simply, click and "Remove it Permanently". Now includes previewing of items before removal, support for IFrame as well as lots of advanced features to make it easy for anyone to remove annoying content from web pages.

6. Unhide Passwords

If you aren't concerned about someone looking over your shoulder and stealing your passwords, why hassle with those obfuscated password fields, where you never know whether you typed your 30 character code correctly or not...

This extension shows the contents of password fields in cleartext (instead of the asterisks), to make that process a bit easier.

How to count files in a directory recursively

Get in that directory and execute the following command

find . -not -type d | wc -l

that's all!:)

find will list all files ("-not -type d" means, that you do not want list directories), and wc will count lines.