Category Archives: System Administration

some fabric trap and tricks

Fabric is a Python (2.5-2.7) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks. Here’s some trap and tricks I met and got from my usual use. trap 1: operation error  cause … Continue reading

Posted in Programming, Python, System Administration | Tagged , | Leave a comment

Nginx userdir with php

implement userdir with php in nginx Continue reading

Posted in Web | Tagged , , | Leave a comment

nginx – try files on multiple named location or server

Let’s start from the simplest case: How to serve files locally first, and proxy the request to other backend/internal server if not found? listen 192.168.1.10:80; … location /static/ { try_files $uri @static_svr1; } location @static_svr1{ proxy_pass http://192.168.1.11$uri; } That’s simple! … Continue reading

Posted in System Administration, Web | Tagged , , , , | 2 Comments

who attach shared memory

Find out which processes attached to which shared memory segment Continue reading

Posted in Perl, System Administration | Tagged , , , | Leave a comment

Change shared memory ownership and permission

We know that we can use ipcs to view shared memory segment information,we can use ipcrm to delete a segment. But wait. Assume that you first run a program as root user,  which creates a shared memory segment of 40GB … Continue reading

Posted in Programming, System Administration | Tagged , | Leave a comment

Some notes on MySQL replication configuration

server version MySQL supports replication from one major version to the next higher major version, but not the reverse. That’s to say, version of slave should newer than or equal to that of master. Also, do not use 3 different … Continue reading

Posted in Database, System Administration | Leave a comment

Trace command call chain on Linux

A tool to trace command call history with chained output Continue reading

Posted in Perl, System Administration | Tagged , | Leave a comment

peek the source – Another troubleshooting method for open source software

Today I read a security article on the nginx fastcgi PATH_INFO (Chinese version on 80sec). I currently maintain several sites with nginx+php-fpm, so I decide to do some test and see if my configuration is in danger. However, when I … Continue reading

Posted in Security, Web | Tagged , , , , | Leave a comment

A journey to troubleshooting by sersync exclude bug

For the last half year, one of our file distributing syststem goes out of sync occasionally, which bothered me a lot. The simplified system workflow looks like this:

Posted in Programming, System Administration | Tagged , , , , | Leave a comment

extract databases or tables from mysqldump

I wrote a simple fast and flexible perl script called xmysqldump.pl to extract databases/tables from mysqldump sql file, you may download it from here. Usage: ./xmysqldump.pl -h|–help This page ./xmysqldump.pl -l|–list [file.sql …] List databases and tables ./xmysqldump.pl -a|–all-tables [file.sql … Continue reading

Posted in Perl, Programming, System Administration | Tagged , , , | 5 Comments