To chroot ftp user outside of plesk, add the user belonging to psacln group.
usemod -g psacln <username>
Blogschroot ftp user outside pleskSubmitted by sandip on Fri, 06/03/2011 - 15:49To chroot ftp user outside of plesk, add the user belonging to psacln group. usemod -g psacln <username> »
DirectAdmin user and passwordSubmitted by sandip on Wed, 06/01/2011 - 16:40I've had to test some connectivity issues with pop and imap clients without having access to their account info. "/etc/virtual/{domain.tld}/passwd" file holds their user and md5 password hash. Make sure to backup this file first. Generate a new md5-based password hash: openssl passwd -1 Edit "/etc/virtual/{domain.tld}/passwd" file replacing the password hash with the above. Test login to mail. Once debugging is finished, restore the file back. »
Check bots success POSTs in apache access logSubmitted by sandip on Thu, 05/19/2011 - 16:20Here is a one liner to check for IPs of bots that are misusing your site. $ awk '$6 ~ /POST/ && $9 ~ /200/ {print $1 " " $7}' /var/log/httpd/access_log | sort | uniq -c | sort -n | tail This will give you the top 10 IPs and URIs with a hit count. Consider blocking those rogue IPs with a high hit count via iptables. »
Unicode keyword translationSubmitted by sandip on Mon, 05/09/2011 - 11:41Do you see garbled text, unicode keywords in your referral web stats reports like below? เรียน ที่ไหน Use the below url for the conversion: Here is the simple php source code that uses google translate for translation to English: <?php header("Content-Type: text/html; charset=iso-8859-1"); ?> »
Check and tune network speedSubmitted by sandip on Fri, 05/06/2011 - 16:56I've had to do this on a couple of servers to check on the network speeds and sysctl tuning. On the receiving end (192.168.10.1) bring up netcat listening to a port: while true; do nc -l 8001 >/dev/null ; done Use the below one liner to send over some data via netcat from 192.168.10.2 which prints out the transfer speed. ( dd if=/dev/zero bs=64K count=1000 | nc 192.168.10.2 8001 ) 2>&1 | awk '/MB/{print $8*8 " " tolower($9)}' Increase the default maximum TCP buffer size and rerun the above test for proper tuning. Make sure to restart netstat listening socket upon sysctl changes. The following are recommended: ## ssh keygen RSA versus DSASubmitted by sandip on Fri, 05/06/2011 - 10:55While generating ssh keys, I usually use RSA type since it can be used to generate 2048 bits key, while DSA is restricted to exactly 1024 bits. ssh-keygen -t rsa -b 2048 »
smartctl with 3ware RAID controllerSubmitted by sandip on Fri, 05/06/2011 - 10:44The below information is extracted from the smartctl man page. To look at ATA disks behind 3ware SCSI RAID controllers: smartctl -a -d 3ware,N /dev/sda Where N is the disk number. Devices /dev/sda and /dev/twe0 is used with 3ware series 6000, 7000, and 8000 controllers that use the 3x-xxxx driver. /dev/sda form is deprecated starting with the Linux 2.6 kernel. /dev/twa0 is used with 3ware 9000 series controllers, which use the 3w-9xxx driver. You can also check on the series with the below command: lspci |grep 3ware »
Find files used for htauthSubmitted by sandip on Wed, 04/06/2011 - 15:39Below will list all of the files that are used for apache authentication in /var/www/html file path: find /var/www/html -name .htaccess | xargs awk '{sub(/^[ \t]+/,"")};/File/{print $2}' | sort | uniq Here is the breakdown: find /var/www/html -name .htaccess Find all files named ".htaccess" at path "/var/www/html" xargs awk '{sub(/^[ \t]+/,"")};/File/{print $2}' The search output gets piped via xargs to awk, deleting leading whitespace (spaces and tabs) from front of each line and output is of only the second field of lines containing the text "File". sort | uniq Awk output is further piped through sort and uniq which results in the files being used for apache authentication. »
Converting Shared to Exclusive IP for Plesk DomainSubmitted by sandip on Wed, 04/06/2011 - 08:35First go into "Clients", select the corresponding client IP Addresses and assign the additional IP address. Then go into "Domains", select the domain that should be converted to exclusive IP and modify the "Web Host Settings" and assign it the new IP. »
VIM with Ruby support on CentOS-5.5Submitted by sandip on Mon, 03/28/2011 - 15:33While trying to get command-t VIM plugin installed I noticed that the default vim-7.0.x installed from CentOS Base repository does not come compiled with ruby support and needed to be upgraded to version 7.2.x: $ vim --version|grep ruby Notice "-ruby" which states that it is without ruby support. Once the rpmbuild environment is setup, install the source rpm: # su - rpmbuild Edit the vim.spec file, line 496 and remove perl-devel from the requirement list. BuildRequires: python-devel ncurses-devel gettext perl-devel Then build rpm binary: $ rpmbuild -bb ~/rpm/SPEC/vim.spec Install the rpms via: # rpm -Uvh ~/rpm/RPMS/x86_64/vim-{m,c,e}* |
User loginRecent blog posts
Who's onlineThere are currently 0 users and 5 guests online.
|