Latest 100 public snipts »
muanis's
snipts » bash
showing 1-6 of 6 snipts for bash
-
∞ Highlight 404 on django runserver patch
Index: django/core/servers/basehttp.py =================================================================== --- django/core/servers/basehttp.py (revision 11655) +++ django/core/servers/basehttp.py (working copy) @@ -608,7 +608,10 @@ # Don't bother logging requests for admin images or the favicon. if self.path.startswith(self.admin_media_prefix) or self.path == '/favicon.ico': return - sys.stderr.write("[%s] %s\n" % (self.log_date_time_string(), format % args)) + if args[1] == '404': + sys.stderr.write("\033[31m[%s] %s\033[0m\n" % (self.log_date_time_string(), format % args)) + else: + sys.stderr.write("[%s] %s\n" % (self.log_date_time_string(), format % args)) class AdminMediaHandler(object): """
-
∞ Join pdf files in one file
# glue a bunch of pdf files in one file # tip from fmeyer texexec --pdfarrange --result all.pdf `ls *.pdf`
-
∞ Find files with one name or another
find /usr/src -not \( -name "*,v" -o -name ".*,v" \) '{}' \; -print
-
∞ mirror website with wget
mkdir -p /var/www/mirror cd /var/www/mirror wget --mirror –w 2 –p --html-extension –-convert-links –P /var/www/mirror/site http://www.yourdomain.com -
∞ Extract Source from RPM
mkdir test cd test wget http://mysite.com/files/packages/appp-1.0.x86_64.rpm rpm2cpio appp-1.0.x86_64.rpm | cpio -idmv
-
∞ Finding the working dir of the process running on a specific port
# first grep netstat for the desired port netstat -anp | grep 8161 # after get the port number wich will be in the following format # tcp .... LISTEN 14826/java pwdx 14826 # there you will go, the output shows something like # 14826: /usr/local/httpd


