Archive for June, 2009

svn triks

June 29, 2009

SVN commands

Create Repo

svnadmin create <repo name>


svn checkout or
svn co<port>/svn/ltm-cg
svn co file:///svn/ltm-cg

Updating revision

svn update

Status check

svn status

Adding to new version

svn add <name> or svn add *

Deleting an item from revision

svn del <what u want to del>

Committing new revision

svn commit -m “any comment”

Ignoring unrevisioned  item during svn status check

First go to the svn directory where you want to ignore.

svn propset svn:ignore <give a suitable name> .

and you will find a message like ” property ‘svn:ignore’ set on ‘.’ ”

Now to edit this property file first export EDITOR=vi and the run

svn propedit svn:ignore <you just give name with propset>

To delete a ignore property – svn propdel svn:ignore <prop file name>

To view the property list – svn propget svn:ignore <prop file name>


build issue for pidgin on debian

June 29, 2009

Here is, what I needed to install additionally:

XSceenSaver development headers: libxss-dev
Startup notification development headers: libstartup-notification0-dev
GtkSpell development headers: libaspell-dev libgtkspell-dev
libxml2 >= 2.6.0 development headers: libxml2-dev
GStreamer development headers: libgstreamer0.10-dev
Meanwhile development headers: libmeanwhile-dev
avahi development headers: –disable-avahi
D-Bus development headers : libdbus-1-dev libdbus-glib-1-dev
NetworkManager development headers: network-manager-dev
Perl development headers: libperl-dev
GnuTLS or NSS SSL development headers: libnss3-dev
Tcl development headers: tcl8.4-dev
Tk development headers:

after installing these packages run the config scripts as follow –

./configure –prefix=/usr/local/pidgin –enable-nss –disable-avahi –disable-tk

Don’t forget to export this path on your PATH variable!!

Perhaps this saves some googleing.

If you still fails to run pidgin ..

just remove the .purple dir from your home and run ldconfig and then run pidgin again. 🙂

Another easy way I recently found –

you need to add this line:

deb lenny-backports main

and then:

apt-get update
apt-get install debian-backports-keyring
apt-get update

to let the system know about the new source, to install the keyring and to let the system know about the installed keyring.

to install from backports you need to run:

apt-get install -t lenny-backports

I hope this will help you

samba on solaris

June 15, 2009

1.Make sure that /usr/sfw/bin and /usr/sfw/sbin are on the root user’s path.
2. Check your version of SAMBA installed:
/usr/sfw/sbin/smbd -V
Version 3.0.21b
3. By default, all files create by the windows server in the Solaris directories shared by SAMBA will be owned by user nobody. If you want to change this then you can force the ownership to another user. I created a user evault in group other for this purpose. Make sure that the user you choose has permission to write to the directories in the file systems that you are sharing with SAMBA. You can use the user root if you wish.
Create an entry in the SAMBA user database for the user with the below command:
smbpasswd -a username

4.Create the file /etc/sfw/smb.conf. Below is the /etc/sfw/smb.conf that I used. The SAM-FS file system was mounted as  and /share/Myshare and Myshare is the subdirectory I wanted to share.

    workgroup = MY
    server string = Samba Server
    log file = /var/samba/log/samba_log.%m
    security = SHARE/USER

hosts deny = ALL
hosts allow = 127.
; interfaces = eth1 lo

    comment = vaultstores
    path = /share/myshare
    force user = user
    public = yes
    browseable = yes
    writeable =yes
    valid users = users
    force group = other
    read only = No
    guest ok = Yes

Note that once the file /etc/sfw/smb.conf exists SAMBA will start automatically when the system boots.
5. You should check the syntax of /etc/sfw/smb.conf using the command testparm. Assuming that all is well you can start SAMBA.
/etc/init.d/samba start

Rotating log using logadm

June 11, 2009

logadm is a general log rotation tool that is suitable for running from cron.

Without arguments, logadm reads the /etc/logadm.conf file, and for every entry found in that file checks the corresponding log file to see if it should be rotated. Typically this check is done each morning by an entry in the root’s crontab.


1 Rotating a File and Keeping Previous Versios -The following example rotates the /var/adm/exacct/proc file, keeping ten previous versions in /var/adm/exacct/proc.0 through /var/adm/exacct/proc.9.

% logadm -c /var/adm/exacct/proc

2 Rotating syslog – The following example rotates syslog and keeps eight log files. Old log files are put in the directory /var/oldlogs instead of /var/log:

% logadm -C8 -t’/var/oldlogs/syslog.$n’ /var/log/syslo

3 Rotating /var/adm/sulog and Expiring Based on Age – The following entry in the /etc/logadm.conf file rotates the /var/adm/sulog file and expires any copies older than 30 days.

/var/adm/sulog -A 30d

4 Rotating Files and Expiring Based on Disk Usage -The following entry in the /etc/logadm.conf file rotates the /var/adm/sulog file and expires old log files when more than 100 megabytes are used by the sum of all the rotated log files.

/var/adm/sulog -S 100m

5 Creating an Entry that Stores the Logfile Name – This example creates an entry storing the log file name and the fact that we want to keep 20 copies in /etc/logadm.conf, but the -p never means the entry is ignored by the normal logadm run from root’s crontab every morning.

% logadm -w locallog /usr/local/logfile -C20 -p never

Use the following entry on the command line to override the -p never option:

% logadm -p now locallog

6 Rotating the apache Error and Access Logs – The following example rotates the apache error and access logs monthly to filenames based on current year and month. It keeps the 24 most recent copies and tells apache to restart after renaming the logs.

This command is run once, and since the -w option is specified, an entry is made in /etc/logadm.conf so the apache logs are rotated from now on.

% logadm -w apache -p 1m -C 24\
-t ‘/var/apache/old-logs/$basename.%Y-%m’\
-a ‘/usr/apache/bin/apachectl graceful’\

This example also illustrates that the entry name supplied with the -w option doesn’t have to match the log file name. In this example, the entry name is apache and once the line has been run, the entry in /etc/logadm.conf can be forced to run by executing the following command:

% logadm -p now apache

Because the expression matching the apache log file names was enclosed in quotes, the expression is stored in /etc/logadm.conf, rather than the list of files that it expands to. This means that each time logadm runs from cron it expands that expression and checks all the log files in the resulting list to see if they need rotating.

The following command is an example without the quotes around the log name expression. The shell expands the last argument into a list of log files that exist at the time the command is entered, and writes an entry to /etc/logadm.conf that rotates the files.

logadm -w apache /var/apache/logs/*_log

The following example shows how to add an entry to rotate and compress the IP filter logfiles once per week:

$ logadm -w /var/log/ipflog -C 8 -P ‘Fri Jul 14 23:05:38 2006’ \
-a ‘/usr/sbin/svcadm refresh system-log’ -g root -m 644 \
-o root -p 7d -z 0

This example has several interesting options. The first parameter contains the logfile to rotate, the “-C” option indicates how many copies to keep, the “-a” option lists a command to run after the file is rotated, the “-g,” “-o” and “-m” options indicate the user, group and permissions to apply to the logfiles, the “-p” option indicates how often to rotate the file, and the “-z” option can be used to compress logfiles after they are rotated.

more on `sed`

June 7, 2009

1. Deleting 2-5 line from a file

sed ‘2,5d’ file.txt

2. Deleting from line 25 to end of a file

sed ‘2, \$d’ file.txt

3. Printing 5-8 line of a file

sed -ne 5,8p file.txt

4. Printing 6 to end

sed -ne “6, \$p” file.txt

5. Printing line 4, 7, 22

sed -ne 4p -e 7p -e 22p file.txt

6. Delete lines from a file matching a pattern –

sed -e ‘/pattern/d’ oldfile \> newfile