Create a quick SMTP debug server
This creates a little server running on port 1025 to test if your apps are sending emails properly or not! python -m smtpd -n -c DebuggingServer localhost:1025
This creates a little server running on port 1025 to test if your apps are sending emails properly or not! python -m smtpd -n -c DebuggingServer localhost:1025
Although the brother website has instructions for debian/ubuntu 64bit they only actually work for ubuntu (actually they might not even work with the latest ubuntu) … on debian the instructions should be more like this: Enable multi-arch for 32bit sudo dpkg –add-architecture i386 Install cups 32bit libs sudo apt-get install libcups2:i386 Download the lpr and…
If you run ipython directly on the commandline without having it installed inside the virtualenv you are working on you may get some awkward behaviour since iPython will be running a mix of environments (system wide + virtualenv) … normally you would see an warning as follows WARNING: Attempting to work in a virtualenv. If…
In many cases it is essential (or at the least nicer) to preserve key order from a parsed JSON document, here is how to do it in python (using the std lib json module and OrderedDict available in python 2.7+) from collections import OrderedDict import json r = json.load(open(‘file.json’), object_pairs_hook=OrderedDict) print json.dumps(r, indent=2)
I have 2 little unique tricks that I use in make files and would like to share, here they are … Ask for “yes” before proceeding install: do-install production-deploy do-install: #… all deps gcc … production-deploy: production-ask rm -fr / %-ask: @python -c ‘raise SystemExit(not raw_input(“All Done! Are you sure you want to install to…
Whether you need to change a proxmox node’s ip or change the hostname, the steps are the same. In my particular case, I have two networks, a fast network and a faster network, so I wanted to switch all my proxmox hosts to use the ip address associated with the faster network interface … to…
Set the user agent for phantomjs driver from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities dcap = dict(DesiredCapabilities.PHANTOMJS) dcap[“phantomjs.page.settings.userAgent”] = ( “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/53 ” “(KHTML, like Gecko) Chrome/15.0.87” ) driver = webdriver.PhantomJS(desired_capabilities=dcap)
Have you ever had a csv (comma separated file) file that you wanted to see nicely and did not want to open up a spreadsheet editor just to be able to see it in a readable way. Well the following command works with most csv files and will do just that: column -s, -t
I just fell in love with the 256-jungle colorscheme, it is awesome on so many different levels. Best of all, in vimdiff its not blinding and is actually readable.
I was recently asked how swap works, and it turns out, I knew nothing about how it really worked … i.e. when, what and why does a linux kernel move memory into swap space. Its probably because I hate swap and I actually disable it on my desktop/…