It is normal that svn db get crashed because of permission issue. The following steps help to fix it.
chown svnuser:svngroup /path/to/repos
find /path/to/repos -type d -print0 -exec chmod 2775 {} \;
find /path/to/repos -type f -print0 -exec chmod 0664 {} \;
svnadmin recover /path/to/repos
Wednesday, 30 December 2009
Tuesday, 29 December 2009
Vi Editor magics
Adding line number to a file with vi
open the file with vi editor
:%!nl
of-course there are other ways to do it with vi :)
Add empty line after every line with vi
:%s/\v(.*\n){1}/&\r
Remove white space at the beginning of a line with vi
:%le
Sorting lines with vi
open the file with vi editor
:%!nl
of-course there are other ways to do it with vi :)
Add empty line after every line with vi
:%s/\v(.*\n){1}/&\r
Remove white space at the beginning of a line with vi
:%le
Sorting lines with vi
:sort u
Wednesday, 9 December 2009
script to convert openssh keys to tectia and tectia to openssh
#!/bin/bash
# Arun N S
menu="
Make your choice:
1. Openssh key to Tectia format
2. Tectia key to Openssh format
3. Exit"
while :
do
printf "%s\n: " "$menu"
read choice
case $choice in
"1") echo "Converting Openssh key to Tectia format"
echo "Enter key Path(full path):"
while read INPUT
do
ssh-keygen -e -f ${INPUT} > ${INPUT}.tectia
echo "OpenSSH format key is saved as: ${INPUT}.tectia"
exit 0
done
break;;
"2") echo "Converting Tectia key to Openssh format";
echo "Enter File Path(full path):"
while read INPUT
do
ssh-keygen -i -f ${INPUT} > ${INPUT}.openssh
echo "OpenSSH format key is saved as: ${INPUT}.openssh"
exit 0
done
break;;
"3") echo "3. Exit"
echo " Good Bye"
break;;
*) echo "Wrong Choice"
;;
esac
done./arun
Monday, 7 December 2009
configure NSD as slave for BIND
To configure name server deamon as slave for bind:
# useradd -c "NSD" -d /home/nsd -s /sbin/nologin -u 1005 nsd
Download and install the latest version of nsd
# ./configure --prefix=/home/nsd --enable-dnssec --enable-tsig --with-user=nsd
# make
# make install
Edit config: /home/nsd/etc/nsd/nsd.conf
>>>
Add key and zone file details:
Start NSD with:
/home/nsd/sbin/nsdc start
to create zone files:
/home/nsd/sbin/nsdc patch
./arun
# useradd -c "NSD" -d /home/nsd -s /sbin/nologin -u 1005 nsd
Download and install the latest version of nsd
# ./configure --prefix=/home/nsd --enable-dnssec --enable-tsig --with-user=nsd
# make
# make install
Edit config: /home/nsd/etc/nsd/nsd.conf
>>>
server:
ip-address:
hide-version: yes
debug-mode: no
ip4-only: no
ip6-only: no
database: "/home/nsd/var/db/nsd/nsd.db"
identity: ""
logfile: "/var/log/nsd.log"
server-count: 1
tcp-count: 10
pidfile: "/home/nsd/var/db/nsd/nsd.pid"
port: 53
statistics: 3600
chroot: "/home/nsd/etc/nsd"
username: nsd
zonesdir: "/home/nsd/etc/nsd"
difffile: "/home/nsd/var/db/nsd/ixfr.db"
xfrdfile: "/home/nsd/var/db/nsd/xfrd.state"
xfrd-reload-timeout: 10Add key and zone file details:
Start NSD with:
/home/nsd/sbin/nsdc start
to create zone files:
/home/nsd/sbin/nsdc patch
./arun
Changing subversion (svn) url
To change the svn url to another one:
$ svn switch --relocate file:///tmp/repos file:///tmp/newlocation .
or if it is with ssh
$ svn switch --relocate svn+ssh://username@svnurl/path/to/svn/ svn+ssh://new_username@new_svnurl/path/to/svn/
$ svn switch --relocate file:///tmp/repos file:///tmp/newlocation .
or if it is with ssh
$ svn switch --relocate svn+ssh://username@svnurl/path/to/svn/ svn+ssh://new_username@new_svnurl/path/to/svn/
Wednesday, 2 December 2009
resetting mac os x password
To reset the password on MAC OS X,
- hold down apple+s key while booting the machine, this will take you to the single user mode
- Mount the file system using , # mount -uw /
- Enter the passwd command with username , #passwd
- reboot the machine
Anyway this will not reset the key chain password, to reset the key chain password:
1. Open Keychain Access, which is in the Utilities folder within the Applications folder.
2. From the Keychain Access menu, choose Preferences.
3. Click Reset My Keychain, which is under the General pane.
4. Authenticate with your account login password.
5. Quit Keychain Access.
6. Restart your computer.
ref : http://support.apple.com/kb/TS1544
./arun
- hold down apple+s key while booting the machine, this will take you to the single user mode
- Mount the file system using , # mount -uw /
- Enter the passwd command with username , #passwd
- reboot the machine
Anyway this will not reset the key chain password, to reset the key chain password:
1. Open Keychain Access, which is in the Utilities folder within the Applications folder.
2. From the Keychain Access menu, choose Preferences.
3. Click Reset My Keychain, which is under the General pane.
4. Authenticate with your account login password.
5. Quit Keychain Access.
6. Restart your computer.
ref : http://support.apple.com/kb/TS1544
./arun
Wednesday, 28 October 2009
auto responder with postfix/virtual
To configure autoreponder for some address with postfix.
Edit the postfix virtual configuration:
Add -
email_address recepient_lists, email_address@autoreply.nic.net.sa
eg: wordpress@example.com recepient1@example.com, wordpress@google.com@autoreply.example.com
Edit the transport configuration:
Add -
autoreply.domain.com autoreply:
eg: autoreply.example.com autoreply:
Create pipe for the transponder in master.cf
autoreply unix - n n - - pipe
flags= user=nobody argv=/usr/local/bin/autoreply $sender $recipient
Created autoreply script at /usr/local/bin/autoreply
eg:
There is other better way to do it with procmail and other tools, depends on your mail server setup
Edit the postfix virtual configuration:
Add -
email_address recepient_lists, email_address@autoreply.nic.net.sa
eg: wordpress@example.com recepient1@example.com, wordpress@google.com@autoreply.example.com
Edit the transport configuration:
Add -
autoreply.domain.com autoreply:
eg: autoreply.example.com autoreply:
Create pipe for the transponder in master.cf
autoreply unix - n n - - pipe
flags= user=nobody argv=/usr/local/bin/autoreply $sender $recipient
Created autoreply script at /usr/local/bin/autoreply
eg:
/usr/sbin/sendmail -oi -t << EOF
From: nobody@example.com
To: $1
Subject: Auto Response from example.com
Content-Type: text/plain; charset=utf-8
This is an autoreponder email.
EOF
There is other better way to do it with procmail and other tools, depends on your mail server setup
Add SPF for validation to mail server
It is good to have spf implemented to make the recepient mail servers trust your entity.
Use the spf wizard http://old.openspf.org/wizard.html to generate the record and add it in your dns zone file.
./arun
Use the spf wizard http://old.openspf.org/wizard.html to generate the record and add it in your dns zone file.
./arun
Tuesday, 27 October 2009
get rid of apache@localhost in received email headers
There is a good change that the foreign email servers will drop if the sender email headers are not properly formatted.
Anyway if you get apache@localhost in Received header (with postfix/apache/php), you can change the
like :
./arun
Anyway if you get apache@localhost in Received header (with postfix/apache/php), you can change the
php.ini, sendmail_path program to use sendmail.postfix instead of sendmail binary.like :
sendmail_path = /usr/sbin/sendmail.postfix -t -i -f ./arun
Sunday, 25 October 2009
Hylafax/FaxMail with unicode encoding
It is pretty hard to get unicode works with fax ..
here are some scripts that i used to get the unicode done for incoming html/text faxes.
HTML
vi /etc/hylafax/faxmail/text/html
plain text
vi /etc/hylafax/faxmail/text/plain
filter.pl
here are some scripts that i used to get the unicode done for incoming html/text faxes.
HTML
vi /etc/hylafax/faxmail/text/html
#!/bin/bash
cp -pf $1 /tmp/email.html
/usr/bin/lynx -dump -display_charset=utf-8 /tmp/email.html > /tmp/html_txt
/usr/bin/uniprint -font /etc/hylafax/faxmail/Cyberbit.ttf -in /tmp/html_txt -out /tmp/html_txt.uni
cat /tmp/html_txt.uni|/etc/hylafax/faxmail/filter.pl
rm /tmp/email.html
rm /tmp/html_txt
rm /tmp/html_txt.uni
plain text
vi /etc/hylafax/faxmail/text/plain
#!/bin/sh
/usr/bin/uniprint -font /etc/hylafax/faxmail/Cyberbit.ttf -in $1 -out /tmp/plain_txt
# echo " "
# echo "showpage"
cat /tmp/plain_txt | /etc/hylafax/faxmail/filter.pl
$rm /tmp/plain_txtfilter.pl
#!/usr/bin/perl
# Read from the standard input
@text=;
$size=@text;
# Count the number of "showpage"
$count=0;
for($i=0;$i<=$size;$i++){if($text[$i] =~ /showpage/){$count++;}}
# Discard the last line that contain "showpage"
$num=1;
for($i=0;$i<=$size;$i++){
if($text[$i] =~ /showpage/){
if($num!=$count){$num++;}
else{$text[$i]=~s/showpage//g;}
}
print $text[$i];
}
Wednesday, 21 October 2009
Cleanup mailman held messages
It will work usually with
If the list is too long
$ cd /usr/lib/mailman
$ bin/discard /var/lib/mailman/data/heldmsg--*If the list is too long
$ cd /var/lib/mailman
$ find data -name heldmsg--\* -print | xargs /usr/bin/discard
Sunday, 18 October 2009
Browse internet from Mac with android
At last i managed to get browsing working through 3G connection in android (donut 1.6).
Steps:
- Enable root in android
- install android-wifi-tether (http://code.google.com/p/android-wifi-tether/)
- configure it either with bluetooth or wireless
- connect your laptop with the android using wireless or bluetooth
- there we go now you should be able to browse internet, if you have netfilter module properly working in wireless tether
- since my kernel doesnt have netfilter module, the natting was not working - I was able to resolve domains from my laptop , but was not able to get the data
- Installed proxoid, and started
- Configured my webbrowser to use proxoid as proxy, it works ... charm!!!!
./arun
Steps:
- Enable root in android
- install android-wifi-tether (http://code.google.com/p/android-wifi-tether/)
- configure it either with bluetooth or wireless
- connect your laptop with the android using wireless or bluetooth
- there we go now you should be able to browse internet, if you have netfilter module properly working in wireless tether
- since my kernel doesnt have netfilter module, the natting was not working - I was able to resolve domains from my laptop , but was not able to get the data
- Installed proxoid, and started
- Configured my webbrowser to use proxoid as proxy, it works ... charm!!!!
./arun
get the root access back on android development phone ADP1
It seems that after upgrading ADP1 with 1.6 , the root access gone.
It can be recovered with adb tool:
Connect your mobile with the computer,
do adb to the phone
Worked Great!!!
Ref: http://phandroid.com/2009/04/29/adp-15-initial-thoughts/
It can be recovered with adb tool:
Connect your mobile with the computer,
do adb to the phone
$adb shell
$mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
$cd /system/bin
$cat sh > su
$chmod 4755 suWorked Great!!!
Ref: http://phandroid.com/2009/04/29/adp-15-initial-thoughts/
Wednesday, 7 October 2009
working with "screen"
Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells).
to activate screen enter
$ screen
open a new session Ctrl+a+c
Scroll between sessions Ctrl+a+a
retain the sessions
$screen -R
check $man screen for much beautiful options
to activate screen enter
$ screen
open a new session Ctrl+a+c
Scroll between sessions Ctrl+a+a
retain the sessions
$screen -R
check $man screen for much beautiful options
Saturday, 3 October 2009
upgrade android to 1.5 cupcake
It was quiet trivial to update the android operating system to 1.5 manually,
The instructions for HTC ADP can be found at : http://developer.htc.com/adp.html
./arun
The instructions for HTC ADP can be found at : http://developer.htc.com/adp.html
./arun
Tips to avoid spams from spamassassin
http://wiki.apache.org/spamassassin/AvoidingFpsForSenders
Fix for Postfix X-Authentication Warning
X-Authentication-Warning can appear on the mail header , when the user sending email is not trusted by the mail server. There is a chance that email are considered as spam because of this.
To fix it you can add the user to /etc/mail/trusted-users
If your system has forms that used to send email as apache user, you can add "apache" user to the trusted-users file.
To fix it you can add the user to /etc/mail/trusted-users
If your system has forms that used to send email as apache user, you can add "apache" user to the trusted-users file.
Friday, 13 March 2009
Work with Android SDK on MAC OS X
It is wonderful experiance to work with android sdk and it is straight forward to get it working.
- Install Eclipse : http://www.eclipse.org/downloads/ (A Java or RCP version of Eclipse is recommended.)
- Download android SDK to a particular location
- Create a .bash_profile under your home directory (if not existing) with :
- Start eclipse and go to Help > Software Updates > Add Site
Enter the url : https://dl-ssl.google.com/android/eclipse/
and click finish. now you will be able to see the Developer tool listed
- Select and install the Developer tools from the same window.
- Restart eclipse.
- Connect your phone and test running your application.
./arun
- Install Eclipse : http://www.eclipse.org/downloads/ (A Java or RCP version of Eclipse is recommended.)
- Download android SDK to a particular location
- Create a .bash_profile under your home directory (if not existing) with :
- Start eclipse and go to Help > Software Updates > Add Site
Enter the url : https://dl-ssl.google.com/android/eclipse/
and click finish. now you will be able to see the Developer tool listed
- Select and install the Developer tools from the same window.
- Restart eclipse.
- Connect your phone and test running your application.
./arun
Got HTC G1 Android working with Airtel Kerala
It was sad to just keep watching a phone without even switching it on, It took long for me to get HTC G1 development phone shopped to India, and once i got it after long waiting and excitement i was not able to get in to the home screen or basically cant do anyting with it. G1 needs to have a data connection with the provider to start using, basically we need to login or register new account with google to start working with the phone. I was keep on trying with a BSNL connection with GPRS enabled to get the Android based G1 working. Anyway Atlast i got it working with Airtel connection (Kerala, Kollam) . Here is the APN configuration Information i used. Change the MNC value according to the location you are in.
That is it, once you have the APN settings entered correctly you will see data connection symbol on the top status bar.
It was hassle for me to get it working. So hope this help someone !!!
./arun
Name : Airtel (it can be anything, just a name)
APN : airtelgprs.com
Proxy : 202.56.231.117
Port : 8080
Username : <Not Set>
Password : <Not Set>
Server : <Not Set>
MMSC : <Not Set>
MMS Proxy : <Not Set>
MMS Port : <Not Set>
MCC : 404
MNC : 95
APN Type: <Not Set>That is it, once you have the APN settings entered correctly you will see data connection symbol on the top status bar.
It was hassle for me to get it working. So hope this help someone !!!
./arun
Subscribe to:
Comments (Atom)