Notes and anecdotes

Techstuff rambling

Build screen bootup

I have a “stupid computer” whos job is only to show a build screen. Its a debian, and I’d like for it to automatically reload the build page every 5 minutes, as well as enter the build screen in case of a reboot. Here’s one way to do it.

git cheatsheet

git is genious. Hands down brilliant. Every 6 months or so, I come across another command I didn’t know I needed before I needed it. And those regular ones I type all the time. So here’s a small collection of handy git aliases that saves some typing and/or remembering.

grep middle of file (unix)

How to grep tails and head

Django autocomplete in (virtualenv) shell

Create a file .pythonrc in ~/.pythonrc # enable syntax completion try: import readline except ImportError: print(“Module readline not available.”) else: import rlcompleter readline.parse_and_bind(“tab: complete”) Export it by adding this export to your profile file (if you use zsh, append to ~/.zprofile instead) echo “export PYTHONSTARTUP=~/.pythonrc” >> ~/.bash_profile Virtualenv Want it in virutalenv? Append it to your activate…

Continue Reading

Get python, pip, virtualenv without sudo

Case: You don’t have sudo and life is awful on a cheap VPS or similar. Step 1: Get your desired python version Python 2.7 cd mkdir python cd python mkdir src cd src wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz tar xvfz Python-2.7.3.tgz cd Python-2.7.3 mkdir ~/python/python27 ./configure -prefix=/home/username/python/python27 make make install cd echo “export PATH=$HOME/python/python27/bin” >> .bashrc source .bashrc…

Continue Reading

bash backup of webserver (FTP and SQL)

Quick and dirty backup from remote SQL and FTP server Introduction The following is a quick and dirty, simple implementation of a backup from mysql-db and ftp-available file area that . It uses git (though this is not really how git ought to be used), and transfers files securely, but not the database-dump. In other…

Continue Reading

Cron tabs: create and delete

Cron jobs run as root can be created with sudo crontab -e Cron jobs run as logged in user can be created with crontab -e Existing cron jobs can be viewed by writing sudo crontab -u username -l Deleting all cron jobs on a user can be done by typing sudo crontab -u username -r…

Continue Reading