Archive for the 'bash' Category
sync svnserv passwd and trac htaccess file.
0 Comments Published October 19th, 2011 in bash, linux, Open Source.I have problem configuring trac to read svnserv password. So, I wrote a script which will convert the plaintext password of svnserv to htaccess password for trac to read. svnserv password format is as below [users] repoman = repomanpass This is the script to convert the file format into a htaccess file. #!/bin/bash path=/path/to/trac new_passwd_file=htpasswdnew [...]
Saher-team provided a good tips on how to alert you by email, on any occurrence of ssh login for certain user. It is simple, by utilizing .bashrc file which is there by default in bash environment. Edit the .bashrc file in the intended user’s home directory to be monitored. vim /root/.bashrc. And add the following [...]
I met a new friend today, ELS (Easy Linux Security), which will help you in securing your linux host installation in certain aspect. These are the list of features of ELS, how it can help you. (Retrieved from their original page, http://servermonkeys.com/els.php) Install RKHunter Install RKHunter Cronjob which emails a user-set email address nightly Install/update [...]
Found a webshell in your server account? It might not be the only one
0 Comments Published March 4th, 2011 in bash, monitoring, Open Source, PHP, plugins, Security.Have you ever encounter your site have been compromised, and you found some weird file being uploaded into your hosting account? Thats what the first thing the attacker would want to do on a web attack, to upload a webshell. Webshell is some kind of web-based backdoor, usually protected by a password, and allow the [...]
Mysql backup script – backup all database
0 Comments Published November 11th, 2010 in bash, linux, Open Source.I did use this script to backup all mysql database in a server. It will search for all databases, and perform mysqldump on each database, and compress them into one big file. #!/bin/sh # System + MySQL backup script # Copyright (c) 2008 Marchost # This script is licensed under GNU GPL version 2.0 or [...]
Sed remove lines with matching expression
0 Comments Published November 10th, 2010 in bash, linux, performance.I’ve tried ab, Apache benchmark to test my web servers performance, and I can see, there’s alot of line in access log, the entry by ‘ab’, with the pattern line below xxxx.xxx.xxx.xxx – - [10/Nov/2010:21:13:22 +0800] “GET / HTTP/1.0″ 200 6639 “-” “ApacheBench/2.0.40-dev” I dont like to mess my apache log with these entries, that [...]
Volume IP-to-Country lookup using bash and php
0 Comments Published October 8th, 2009 in bash, monitoring, Open Source.Today I have encountered a problem, where I need to do some statistics on certain activity in my apache log. Depends on your purpose, you have to define it. Firstly I grep all the IP that I need to do the lookup using bash. cat domain.log | cut -d’ ‘ -f1 | sort -u > [...]
mysql down? need restart? but when?
0 Comments Published September 29th, 2009 in bash, linux, Open Source, PHP.Last few weeks I have these problem, where my server could not handle so much connection made to the server. The server have been upgraded, and the loads have been reduced. But there is some connection that stuck, that makes my apache died. Last 2 days it happen once, when I got a LAST_ACK DDOS [...]



