SSL and subversion client
Mon, 02/07/2011 - 12:03 — sandipUnlike web browsers, the CA root cert is not installed by default for svn clients. You would need to tell the client where to find it in order to trust the ssl cert.
Reference: svnbook
For GoDaddy signed certs, download their root certs available at:
http://certificates.godaddy.co
You would need both the pem encoded gd-class2-root.crt and gd_intermediate.crt .
Then in subversion client global settings, tell it the path to the certs:
ssl-authority-files = /path/to/gd-class2-root.crt;/p ath/to/gd_intermediate.crt
This should then trust the ssl cert.
- sandip's blog
- Login or register to post comments
- Read more
Setup sudo access to mysql user
Sun, 01/30/2011 - 02:13 — sandipHere is how to give dba user sudo access as mysql user.
visudo and add:
dbauser ALL=(mysql) ALL
Basically, it defines that user "dbauser" can run all commands as "mysql" user.
For the dbauser to get mysql shell, run:
$ sudo -u mysql -i
- sandip's blog
- Login or register to post comments
File encryption with GnuPG
Thu, 01/20/2011 - 12:59 — sandipEncrypt file:
gpg -c private.txt
You will be prompted to enter a passphrase twice. The output is a file of the same name with ".gpg" as the extension.
Decrypt via:
gpg private.txt.gpg
By default the encrypted file is binary format with smaller file size. If you need ascii, then use the "-a" option which then outputs as "private.txt.asc".
- sandip's blog
- Login or register to post comments
Plesk imap connections limit
Wed, 01/19/2011 - 16:49 — sandipBy default Plesk IMAP maximum connections per IP is set to 4. If you are using an email client that checks multiple mailboxes, this limit is easily reached.
To increase the limit, edit "/etc/courier-imap/imapd":
MAXDAEMONS=80
MAXPERIP=40
Domain searching with bash
Thu, 01/13/2011 - 17:21 — sandipBelow is a simple bash script that uses the dictionary to go through 3 letter words and does a whois check to see if the domain is available. You probably won't find any of those as all would have been taken. May want to try with 5 or 6 letters instead, in which case change the value of "$count".
#!/bin/bash
# domain_search.sh
# Get a list of 3 letter domains.
for x in `cat /usr/share/dict/words`; do count=`echo $x| wc -m`; [ $count = 4 ] && echo $x; done > domains_list.txt
# Get whois record.
for x in `cat ./domains_list.txt` ; do (whois $x.com | grep -q '^No match for domain') && echo $x; sleep 60; done > domains_available.txt
# Change to lowercase and sort print.
cat domains_available.txt | tr [:upper:] [:lower:]|sort| uniq
- sandip's blog
- Login or register to post comments
gnome logout command
Thu, 01/06/2011 - 14:48 — sandipLogout using gnome command saving current session:
gnome-session-save --logout
- sandip's blog
- Login or register to post comments
- Read more
Serving ftp with vsftpd
Thu, 12/23/2010 - 16:32 — sandipvsftpd can be installed directly via yum and is a straight forward setup:
yum install vsftpd
chkconfig vsftpd on
service vsftpd start
The default vsftpd.conf should be fine to run with. However, it is best practice to disable anonymous access if not being used:
# cat /etc/vsftpd/vsftpd.conf | grep -v "#\|^$"
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=NO
nopriv_user=nobody
ftpd_banner=OK
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
log_ftp_protocol=YES
chroot_local_user=YES
For an incoming dropbox only option, use:
download_enable=NO
dirlist_enable=NO
disable logging of images in access log
Wed, 12/15/2010 - 17:15 — sandipApache:
SetEnvIfNoCase Request_URI "\.(gif|jpe?g|png|htc|css |js|ico)$" skiplog
CustomLog "/var/log/httpd/access.lo g" combined env=!skiplog
Lighttpd:
$HTTP["url"] =~ "\.(gif|jpe?g|png|htc|css |js|ico)$" {
accesslog.filename = "/dev/null"
}
listing of directories in tree format
Fri, 12/03/2010 - 11:58 — sandipBelow example shows listing of files and directories in tree format including hidden files and directory display depth of 3:
tree -a -L 3
-a : include hidden files
-L : depth of directory tree to display
man tree for more info...
- sandip's blog
- Login or register to post comments
resolve mysql replication error
Fri, 12/03/2010 - 10:39 — sandipMySQL replication stops whenever there is an error running a query on the slave. This happens so the problem query can be identified and resolved.
Such errors can be skipped as long as you know why the query failed.
For example, when you run a query in the slave accidentally instead of running it on the master. You can skip just that one query that is hanging the slave using:
mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
mysql> START SLAVE;
- sandip's blog
- Login or register to post comments
- Read more