Archive for the 'Open Source' Category
Purging in varnish.
0 Comments Published October 20th, 2011 in linux, monitoring, Open Source, performance, PHP.You might already know varnish. Its a so called website accelerator. It will sit in front of your web server as a reverse proxy, listening on port 80, handling static contents based on the configuration files, and pass all dynamic requests to the main web server behind it. varnish will help alot to reduce request [...]
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 [...]
cPanel log-viewer plugin
0 Comments Published May 12th, 2011 in linux, monitoring, Open Source, Security.I found this cool plugin for cPanel, which will provide additional feature for cPanel, for you to monitor certain log files located in /var/log/. However, this is just a very simple tool to view latest enrty in the log file, and to rotate those files individually. Please refer to their official page at http://www.logview.org/. They [...]
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 [...]
Unable to locate wp-content folder
1 Comment Published November 26th, 2010 in Open Source, PHP, plugins, themes, Wordpress.I had a few encounters with this problem. I’m thinking of placing it here. I always forget where I got the solutions. This happens when you want to install plugin or themes, or upgrading them. Given that you have the FTP credentials correct, there some glitch where you might encounter this problem. One way, it [...]
Log rotate – make sure it doesn’t grow out of control
0 Comments Published November 12th, 2010 in linux, Open Source, Security.Server logs are very useful, only when you need it. And you never know when you might need them. You don’t want your application to white log file, and you’ll forgot about it until you run out of disk space. I’ve once encounter a log file thats 2GB in size. What you want to do [...]
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 [...]
I bump into a problem when I need to filter my application to be accessed from certain IP only. So, some googling around, i found s simple code to do this. $targetAddr = “192.168.1..*”; if (ereg($targetAddr, $_SERVER['REMOTE_ADDR'])) { echo “”; } else { die(“Sorry. Not allowed from your IP.”); } This simple script will allow [...]
iptables to solve DOS and brute force attack
0 Comments Published July 28th, 2010 in linux, Open Source, Security.I’ve googled around, and found a few articles that might help solving a few problem that you most probably encounter if you’re hosting your own server on the internet, that are DOS and brute force attack. In this particular example, we will use iptables, to block Denial-of-Service and brute force attack. IPtables have a special [...]
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 > [...]



