Python

httpd, nginx, Python, Tips & Guides, Web Server

Python code: List most popular URL from Apache/NGINX ‘access.log’ file

Found a great Python code snippet for listing the most popular URL from Apache / NGINX ‘access.log’ file. Very practical! import collections logfile = open(“access.log”, “r”) clean_log=[] for line in logfile: try: # copy the URLS to an empty list. # We get the part between GET and HTTP clean_log.append(line[line.index(“GET”)+4:line.index(“HTTP”)]) except: pass counter = collections.Counter(clean_log) […]

Computers, Desktop, GNU/Linux, Internet Stuff, Server, Tips & Guides, Ubuntu/Debian

Backup your Gmail account in Ubuntu Linux with gmvault

This is a follow-up of my previous post “What to do when your Google disabled your Gmail account?“. Here’s how to download all emails from your GMail account with Gmvault: Download and setting up gmvault 1. First you need to install python-pip [bash] sudo apt-get install python-pip [/bash] 2. Then using ‘pip’, install gmvault [bash] […]

hardware, Open Source, Server, Tips & Guides

How to mine Bitcoin in Ubuntu using OpenCL and Bitcoinminer.py

Bitcoin is a form of decentralize digital currency, so unlike other digital currency services (like e-gold), bitcoin is not susceptible to be frozen, seized or invalidated. Bitcoin can be transfered transfered directly from person to person directly without intermediaries. Bitcoin are generated over the internet by application called bitcoin miners using a set of algorithm […]

Computers, GNU/Linux, Python, Ubuntu/Debian

Working hard publishing papers and learning PyGTK

For the last few weeks I’ve been working hard to finish up my research project, most of it concerning about on mobile phone application usability and context-aware applications. This leaves me with less  time to devote for this blog and I started to realise that I might have a ‘burn-out’ issue at the same time. […]

Computers, Internet Stuff, Open Source, Python, Server, Tips & Guides

Quick and Dirty Network File sharing with Python

Ever find yourself in need to share file over the network quickly, but find yourself lacking time to setup a proper NFS or samba share? Here’s a way to do this with the good old Python CLI. First, go to the directory that you want to share, for example ~/Desktop Then run this command “python […]

Python, Ubuntu/Debian

Ubuntu Hardy Python XML error bugfix – xml.dom.ext

This was brought to my attention when I’m working on a python code to parse xml documents. I found out that in Ubuntu Hardy, the python-xml package has moved xml.dom.ext.* package to /usr/lib/python2.5/site-packages/oldxml thus breaking python code which depended on python-xml. One way to work around this bug is to append : sys.path.append(‘/usr/lib/python%s/site-packages/oldxml’ % sys.version[:3]) […]

Scroll to Top