Pages

Your Ad Here

This Blog is not to read or go through

because, I have never been such a mess


Search the blog instead

Wednesday, June 23, 2010

Kannel restart script | Attempting to Kill a process in linux until it gets killed

Restarting kannel wasn't simpler, as the bearerbox was not exiting on single stop command for Kannel. So needed to do some tricks on killing the bearerbox first. See the code

#!/bin/bash
while [ true ]
do
 echo "quering bearerbox"
 sleep 1
 count=$(ps -C "bearerbox" | wc -l)
 echo $count
 if [ $count -eq 2 ]
 then
  echo "attempting to kill bearerbox"
  killall bearerbox
 else
  sleep 1
  echo "======= bearerbox killed ========"
  break
 fi
done
sleep 1
bearerbox /etc/kannel/kannel.conf
smsfox /etc/kannel/kannel.conf

Altering system default timezone in linux

Reference:
http://www.cyberciti.biz/faq/howto-linux-unix-change-setup-timezone-tz-variable/


Change Linux timezone

Select the method as per your Linux distribution:

If you are using Fedora / RHEL / Cent OS Linux

Type the redhat-config-date command at the command line to start the time and date properties tool.
# redhat-config-date
OR type setup and select time zone configuration (good for remote ssh text based Linux server sessiob)
# setup
Select timezone configuration
Fig.01: Redhat / CentOS Server Setting Up Timezone
Fig.01: Redhat / CentOS Server Setting Up Timezone
Now, just follow on screen instructions to change timezone.

Set timezone using /etc/localtime configuration file [any Linux distro]

Often /etc/localtime is a symlink to the file localtime or to the correct time zone file in the system time zone directory.

Generic procedure to change timezone

Change directory to /etc
# cd /etc
Create a symlink to file localtime:
# ln -sf /usr/share/zoneinfo/EST localtime
OR some distro use /usr/share/zoneinfo/dirname/zonefile format (Red hat and friends)
# ln -sf /usr/share/zoneinfo/EST localtime
OR if you want to set up it to IST (Asia/Calcutta):
# ln -sf /usr/share/zoneinfo/Asia/Calcutta localtime
Please mote that in above example you need to use directory structure i.e. if you want to set the timezone to Calcutta (India) which is located in the Asia directory you will then have to setup using as above.
Use date command to verify that your timezone is changed:
$ date
Output:
Tue Aug 27 14:46:08 EST 2006

Use of environment variable

You can use TZ environment variable to display date and time according to your timezone:
$ export TZ=America/Los_Angeles
$ date

Sample Output:
Thu Aug 27 11:10:08 PST 2006

Monday, June 21, 2010

Forgot your Google Apps Admin Password

If you forget Google apps admin password, sometimes it might be quite boring not to find the exact link to reset the password, since Google apps says contact administrator to support your login.

If you are yourself admin then ?


hmm, no need to think more.

Just Visit this link

Eg.
https://www.google.com/a/cpanel/appsdomain.com/ForgotAdminAccountInfo
Replace appsdomain.com with your own apps domain

Wednesday, June 9, 2010

download manger in linux - alternate to wget

its been a long time using wget and being fond of.

However, I was just willing to download a large file with multiple concurrent connections on a single path, as many download mangers with GUI provide so.

Not sure, whether wget provides this, but just found a good one.

aria2c

however, its name was so confusing and odd one, I just did a quick ln -s  and made it more familiar.

and here is what I did.

# aria2c -s 5 -c http://the-download-url
where -s 5 is for 5 concurrent connections
-c is for continuing what I downloaded using wget.

and for more easier name of the command.
# sudo ln -s /usr/bin/aria2c /usr/bin/download

so its now the following

# download -s 5 -c http://link-to-download-from-web

and this is the general output format for aria2c



WOW
Your Ad Here