Archive for the 'Blog' Category

Using ssh-agent in an elegant way

Logging into many a remote hosts and, or servers from my desktop and, or notebook is a routine job for me, hence I extensively use ssh and ssh-agent every day. I wanted to use the same ssh-agent instance from each and every terminal whether I’m on a virtual console or in front of x-window desktop running a terminal emulator. I created a tiny bash script say ssh-agent.sh in the /etc/profile.d as follows:

SSH_ENV="$HOME/.ssh/ssh-agent.env"

function start_agent {
    /usr/bin/ssh-agent |sed 's/^echo/#echo/' >"$SSH_ENV"
    chmod 600 "$SSH_ENV"
    . "$SSH_ENV" >/dev/null
}

# Source SSH settings, if applicable
if [ -f "$SSH_ENV" ]; then
    . "$SSH_ENV" >/dev/null
    ps -e |grep ^$SSH_AGENT_PID |grep -q ssh-agent$ || start_agent
else
    start_agent
fi

And the life now seems quite easier since then :)

The Beauty of Gazillian Linux Distributions

The beauty of a hundreds of thousands of GNU/Linux Distributions is that they provide endless options to end-users as well as developers and, or packagers. All you need to have is an appetite to learn, a patience to try, a curiosity to explore and a creativity to deploy un-imaginable possibilities.

You might be wandering what triggered me to write all this, when hundreds of other people are bashing the creepers, creators and, or all those inharmonious beaters of drums?

Well, I wanted to give the KDE 4.1 desktop a try without rebooting off of a LiveCD, installing a complete distro and, or compiling the sources locally on my live Debian rig. By searching a bit, I found that the ArchLinux is always ahead in making available latest stable builds and, or binaries for most of the popular software; so I downloaded the archlinux-2008.06-core-i686.iso and booted off of the image itself with QEMU, addtionally giving it a free partition say /dev/sda5 as a drive and installed the core and KDE 4.1 desktop including all dependencies in single shot. I did all this in kind of a virtual environment, but we know almost all the virtual environments and, or machines have some overheads which make the system somewhat slow.

To overcame and, or avoid all that overhead, I exited the QEMU and mounted the partition where I recently installed ArchLinux and KDE 4.1, mounted few parts from my existing /dev and chrooted in to that new partition from console:

mount -t ext3 /dev/sda5 /mnt/sda5
mount --bind /dev /mnt/sda5/dev
mount --bind /dev/pts /mnt/sda5/dev/pts
mount --bind /dev/shm /mnt/sda5/dev/shm
mount --bind /home /mnt/sda5/home
mount --bind /proc /mnt/sda5/proc
mount --bind /sys /mnt/sda5/sys
invoke-rc.d kdm stop
chroot /mnt/sda5 /etc/rc.d/esd start
chroot /mnt/sda5 /etc/rc.d/kdm start

Viola! Me, as expected was greeted and, or welcomed to login in to that KDE 4.1 desktop.

Although I needed to tweak around a few user and, or group id’s in the /etc/passwd and /etc/group and relevant shadow files in this ArchLinux partition, might be tedious job for newbies, but the things are working smoothly ever since with a zero or no downtime.

The experts might have guessed that we need to reverse execute all the above steps to come out from this chrooted environment or we may automate all these steps with the help of an init script.

Available distributions

I have a small collection of various CD’s and, or DVD’s for distributions of Linux and, or Unix which I would love to share with you. Please bring some extra blanks and get the media burned for your favorite distro only at the cost of a smile :)

I shall arrange to download other such images also, provided these are freely and legally available somewhere via Internet.

The FreeBSD ports I maintain or test

I proudly, have been maintaining and, or submitting a few ports for FreeBSD project since December 2006. The authorized volunteers however, take time to approve and, or commit new and, or updated ports; may be due to the workload they handle.

Hence, I have created a public repository for sharing these with all those of you, who either are interested to use or help me in testing these ports, even before these are committed to the real ports tree. Please feel free to download, test and, or report any bugs; a feedback of yours though not mandatory, shall highly be appreciated.

After downloading the requisite and, or suggested <whatever>.shar.gz file(s) for a port, to extract and, or install, all you need to do is, as root repeat the following for the *.shar.gz files:

# zcat <whatever>.shar.gz |sh

or for the <whatever>.patch.gz file(s):

# zcat <whatever>.patch.gz |patch -d/ -p1

Now, visit the main ports’ directory and perform:

# cd /usr/ports/<category>/<port>
# make install clean

That’s all, and you have done it!

Givin’ WordPress theme a new look!

I as usual remain quite busy, even if I don’t have any job and, or project at hand; I get lost either in to pending experiments, research or readings. I admit I’m though somewhat, but a computer addict. You know, we can/might still manage to find and, or devote some time for the family :)

Here is a new theme or perhaps sleek skin Cerato dedicated to my daughter, I managed to develop based on famous WordPress theme Kubrick by Michael Heilemann. Click here to download Cerato; hope it is as useful for you too as it is for my daughter.

[ALERT] Google AdSense is a fraud

In its current incarnation the Google AdSense is definitely a fraud. IMHO, thousands if not millions of AdSense publishers have already been robbed by invalid click Google excuses till date. As and when an AdSense publisher site and, or blog starts earning a good amount or starts attracting visitors, the Google AdSense people usually come up with this standard excuse:

It has come to our attention that invalid clicks and/or impressions have been generated on the Google ads on your site(s). We have herefore disabled your Google AdSense account. Please understand that this was a necessary step to protect the interest of the AdWords advertisers.

And publishers disabled for invalid click activity are not allowed further participation in AdSense and do not receive any further payments. The earnings on your account will be properly returned to the affected advertisers, who knows?

On searching even at Google itself, you too may find:

Google AdSense—a scam?
How to Bring Google AdSense Down
Nonsense with Google’s AdSense?
Google, p2pnet: AdSense saga
Google’s adsense a Fraud
Google Adsense is a fraud
Wikipedia: AdSense#criticism

Google gets gruff over click fraud
Google Sued for AdSense Fraud
Obviously google adsense is a fraud
Don’t Get Caught With Google Adsense Click Fraud
Google Files Click-Fraud Suit
AdSense Has A Scam Side

Neither the publishers have enough of the skills and, or expertise to verify who has created the said invalid clicks nor the Google is fair enough to show you the records. Moreover, it is not that easy a job to prove that the records have not been doctored. I’m not lawyer, but I feel that the Google Adsense business in it present form is not transparent and they people are cheating their AdSense publishers in violation of common law.

I therefore, request all AdSense publishers to stop displaying Google advertisements with immediate effect and ask these Google people for some transparent method such as pay per thousand impressions excluding all page views from local network and, or the server itself.

Yet another Wordpress hack to host virtual users

Hey! After searching and, or reading many solutions on hosting virtual user blogs on single, shared Wordpress installation, I have figured out quite a simple and smart hack.

A few of the things, I have been considering are as follows:

  1. Either use a single database with unique $table_prefix or use unique databases for each user.
  2. Users may use unique blognames and, or descriptions, but I prefer same and, or similar blognames and, or descriptions for consistent look and feel.
  3. Users are not allowed to add and, or remove plugins, themes and, or scripts; but they may use and, or activate any of the available ones.
  4. In case a user direly needs something, one may request and, or convince the sysadmin to do so.

I just needed to change the default wp-config.php file, after installing and, or extracting all the Wordpress 2.1.1 (was working fine with version 2.1 also) files in to /usr/share/wordpress directory.

Here follows a modified and default /usr/share/wordpress/wp-config.php file:

<?php
// Get virtual user's personalized wp-config.php, i.e.
// the $HOME/.wordpress/wp-config.php
$parts = explode('/',$_SERVER['SCRIPT_FILENAME']);
require '/'. $parts[1] .'/'. $parts[2]. '/.wordpress/wp-config.php';

// These lines have been taken from wp-config-sample.php
define('ABSPATH', dirname(__FILE__).'/');
require_once(ABSPATH.'wp-settings.php');
?>

In step 2, I created a few apache userdir symlinks as root for all those users whom I wanted to blog:

# ln -s /usr/share/wordpress /home/user/public_html

In step 3, I needed to create a sub-directory and user specific wp-config.php file from a slightly modified wp-config-sample.php file:

<?php
// ** MySQL settings ** //
define('DB_NAME', 'wordpress');    // The name of the database
define('DB_USER', 'username');     // Your MySQL username
define('DB_PASSWORD', 'password'); // ...and password
define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value

// You can have multiple installations in one database if you give each a unique prefix
$table_prefix  = 'wp_';   // Only numbers, letters, and underscores please!

// Change this to localize WordPress.  A corresponding MO file for the
// chosen language must be installed to wp-includes/languages.
// For example, install de.mo to wp-includes/languages and set WPLANG to 'de'
// to enable German language support.
define ('WPLANG', '');

/* That's all, stop editing! Happy blogging. */
?>

Now create a user specific sub-directory and configuration file:

# mkdir /home/user/.wordpress
# cp /usr/share/wordpress/wp-config-sample.php /home/user/.wordpress/wp-config.php

We may edit these user specific configuration files as per requirements.

In the finishing step, I needed to create user specific empty databases, which you may omitt if you want to use single database for your users.

Finally, you yourself may login as admin for your new users and edit and, or tweak a bit Wordpress options for them, except for changing their default admin password, which shall be or has been mailed to them by wordpress; this and all the above steps can auto-magically be performed with a shell script, if you want to do it for hundreds of thousand users.

Furthermore, you may tweak around a bit the /usr/share/wordpress/wp-admin/upgrade-schema.php file too, but you should know what you are doing ;)

No doubt, the Wordpress rocks!

Thank you

After using and patching Hobix for a few years, I was pondering over to various possibilities and, or alternatives of implementing weblog framework including writing one from scratch based on Django or Ruby on Rails, I finally, looking at the ease of use, versatility, maturity, features, themes, plugins and, or standards, decided to use WordPress with a theme K2 for my needs; and hence would like to extend a big thanks to the WordPress development team and the developers of a splendid theme K2.

I, being a systems admin and programmer can easily understand that these things take a lot of time to learn, research, implement and, or maintain. Although achieving a goal for a dedicated and expert team like as WordPress is and, or was not difficult, but I can feel and appraise their sedulousness — how much more difficult it is and, or can be for them to maintain that level.

I wish WordPress and the WordPress Team a great success :)

Thank you, for making such a nice weblog system available to the public in general and specially making it available for free.

Regards,

PS: Have I mentioned K2 theme for WordPress; too deserves a big thanks!

Acknowledgement Department

Here is one of the nicest mails, I ever have received:

I dreamt that I went to Heaven and an angel was showing me around. We walked side-by-side in to a large workroom filled with many angels.

My angel guide stopped in front of the first section and said, “This is the Receiving Section. Here, all petitions to God said in prayers are received.” I looked around in this area, it was terribly busy with so many angels sorting out petitions written on voluminous paper sheets and scraps from people all over the world.

Then we moved down via a long corridor until we reached the second section. The angel then said to me, “This is the Packaging and Delivery Section. Here, the graces and blessings, the people asked for, are processed and delivered to the living persons who asked for them.”

I noticed again how busy it was there also. There were many angels working hard at that station, since so many blessings had been requested and were being packaged for delivery to Earth.

Finally at the farthest end of the long corridor we stopped at the door of a very small apartment. To my great surprise, only one angel was seated there, idly doing nothing. “This is the Acknowledgment Section”, my angel friend quietly admitted to me. He seemed embarrassed. “How is it that? There’s no work going on here?”, I asked.

“So sad …”, the angel sighed, “After people receive the blessings that they asked for, very few send back acknowledgments.” “How does one acknowledge God’s blessings?”, I asked. “Simple,”, the angel answered.
Just say, “Thank you, God.”

“What blessings should they acknowledge?”, I asked.

“If you have food in the refrigerator, clothes on your back, shoes in your feet, a roof over the head and a place to sleep, you are richer than 75% of this world. If you have money in the bank, in your wallet, and spare change in a dish, you are among the top 8% of the world’s wealthy people. And if you are reading this on your own computer, you are part of the top 1% in the world who has that opportunity.”, seemed he has lot more to tell.

Also …, “If you woke up this morning with more health than illness … you are more blessed than the many who will not even survive this day.” and, “If you have never experienced the fear in battle, the loneliness of imprisonment, the agony of torture, or the pangs of starvation … you are ahead of 700 million people in the world.”

He continued, “If you can attend a prayer meeting without the fear of harassment, arrest, torture or death you are envied by, and more blessed than, three billion people in the world.”

… “If you can hold your head up and smile, you are not the norm, you’re unique to all those in doubt and despair.”

Ok, what now? How can I start?

If you can read this message, you just received a double blessing in that someone was thinking of you as very special and you are more blessed than over two billion people in the world who cannot read at all.

Have a good day, count your blessings, and if you want, pass this along to remind everyone else how blessed we all are :)

Attn: Acknowledgement Dept:
Thank You God! Thank you, for giving me the ability to share this message and for giving me so many wonderful people to share it with.




Close
E-mail It