Moonlight: Microsoft Silverlight in Linux

moonlight

Need to view Microsoft Silverlight enabled sites, but you’re on Linux, and running Firefox as the web browser? Have no fear, Moonlight is here.

Moonlight is an open source implementation of Microsoft Silverlight for Unix or Linux platform.

The current release version is 1.0. All you have to do is, just go to their site, and install the plugin/add-on from your Firefox.

Enjoy!

Automated scp on Linux

Scenario

You would like to automate the export of SQL dump files from one Linux server to another using scp. These dump files are to be generated and exported once every two weeks. You also wish to archive these dump files on the source server.

So let’s say the servers and directories are as follows:

Source

Hostname: perak
Username: nazham
Dump file directory: /home/nazham/data_export/current
Archive directory: /home/nazham/data_export/archive/yyyymmdd

Target

Hostname: selangor
Username: romantika
Target directory: /home/romantika/data_import

Passwordless scp

First you need to set it up so that you don’t need to enter a password for scp. The overall picture is as follows:

  1. At the source server, generate a pair of public and private keys [1] using RSA.
  2. Store the private key in a specific place in the source server.
  3. Store the public key in a specific place in the destination server.
  4. And that’s it! Now you’ll no longer be prompted for a password when using scp.

One-off steps

# login to perak with username nazham
ssh-keygen -t rsa
# choose default location, no passphrase - just press enter at all prompts
scp ~/.ssh/id_rsa.pub romantika@selangor:/home/romantika/.ssh/authorized_keys
# I'm assuming the file authorized_keys does not exist!
# otherwise, you need to append the contents of id_rsa.pub to it.
crontab -e
# add the following:
# 1 0 1,15 * * nazham /home/nazham/run_data_export >> /dev/null 2>&1
# which means, run at 12:01 am every 1st and 15th of the month
mkdir ~/data_export
mkdir ~/data_export/current
mkdir ~/data_export/archive

The run_data_export script

todaysDate=`date +%Y%m%d`
oldDate=`date -d '1 year ago' +%Y%m%d`
exportDir=data_export
mysqldump -u username -ppassword -r ~/$exportDir/current/filename dbname tablenames
echo $todaysDate > ~/$exportDir/current/importdate.txt
scp ~/$exportDir/current/* romantika@selangor:/home/romantika/data_import
mkdir ~/$exportDir/archive/$todaysDate
rm ~/$exportDir/current/importdate.txt
mv ~/$exportDir/current/* ~/$exportDir/archive/$todaysDate
if [ -d ~/$exportDir/archive/$oldDate ]; then rm -r ~/$exportDir/archive/$oldDate; fi

The Linux date command

I’m very impressed by the Linux date command. This might be old news to some, but the fact that I’m able to say date -d '1 year ago' or date -d '30 days ago' completely blows the mind.

Notes

[1] From Pass on Passwords with scp: “If you’re not familiar with public key cryptography, here’s the 15-second explanation. In public key cryptography, you generate a pair of mathematically related keys, one public and one private. You then give your public key to anyone and everyone in the world, but you never ever give out your private key. The magic is in the mathematical makeup of the keys; anyone with your public key can use it to encrypt a message, but only you can decrypt it with your private key.”

Red Hat Linux Training and Certification

rh1Red Hat Training provides classroom-based courses at convenient worldwide locations and in a variety of topics. I’ve just finished my training for RH033 Red Hat Linux Essentials, last week. Among Linux Red Hat training you can get here in Malaysia are:

RH033 Red Hat Linux Essentials
RH131 Red Hat Linux System Administration
RH253 Red Hat linux Networking and Security Administration
RH142 Linux Troubleshooting Techniques & Tools
RH184 Red hat Enterprise Linux Virtualization

… and many more. Just contact your nearest training center.

rh3

For Kuala Lumpur, training center below offers Red Hat Courses. The center classroom and facilities are good, and the trainers are well experienced and knowledgable :

Iverson Associates Sdn. Bhd.
Suite T113 – 114, 3rd Floor,
Centrepoint, Lebuh Bandar Utama,
47800 Bandar Utama, Selangor Darul Ehsan.
Tel: 03-77262678
http://www.iverson.com.my

rh2

For more info, feel free to check Linux Red Hat courses and certification listings:

Red Hat Training and Certification

Red Hat Courses

Twitux and gTwitter: Twitter Clients for Ubuntu Linux

Following my previous post nazham.com on Twitter, I’ve just beginning to get involved with Twitter.
Below are a couple of Twitter clients that I’ve used in Ubuntu:

Twitux
A Twitter client for GNOME.
Twitux is a lightweight client for the twitter messaging service, featuring time-line auto updating, a tray area icon and notification of new messages.

twitux

gTwitter
Client for tracking and posting to twitter.
gTwitter is a client for posting and fetching updates to the twitter service.

gtwitter

Installation is available through Synaptic Package Manager. Just do a search for the application name, twitux or gtwitter.

Installing Google Gadgets on Ubuntu 8.10

Google Desktop gadgets are interactive mini-applications that can be placed anywhere on the user’s desktop to show new email, weather, photos, personalized news or other desired information. Google offers a gallery of pre-built gadgets for download on the official website.

To install Google Gadgets on Ubuntu 8.10:

1. Download the .deb package.
2. Install the package using the following command:
sudo dpkg -i google-gadgets_0.10.4-0~getdeb1_i386.deb

3. Run the apps using the command ggl-gtk or from the Applications menu.

Autostart:

1. Add a new entry at System -> Preference -> Sessions.
2. The command entry would be ggl-gtk

Enjoy.

Resource: Howto install Google Gadgets in ubuntu 8.10 (Intrepid Ibex)