Pushing to pypi

Instructions

  1. Make setup.py in your project

    from setuptools import setup
    
    setup(name='project',
          version='1.0',
          description='thing do-er',
          author='Your Name',
          url='http://path.to.website',
          py_modules=[''],
          classifiers=['Environment :: Console',
                       'Intended Audience :: Developers',
                       'License :: OSI Approved :: MIT License',
                       'Programming Language :: Python :: 3.4',
                       'Operating System :: POSIX :: Linux',
                       'Topic …
more ...

Screenshot with mplayer

To take screenshots with mplayer, you need to first run mplayer with a special flag.

mplayer -vf screenshot movie001.mp4

Then once the movie is playing you can screen shot any frame by hitting the 's' key. mplayer will name the files starting with shot0001.png.

When I first tried …

more ...

Colored diff on the Command line

If you wanted your diff output to be colored you have three options

  1. Use a verison control program that outputs colored diff output

    git diff --color=always old-file new-file | less -R
    
    note:Mercurial does not allow you to run its hg diff outside of a repository
  2. Use a text editor …

more ...

Manually Connecting Ethernet

I broke my computers internet installing wicd.

Getting internet back

  1. Check the interfaces

    $ ifconfig
    
  2. Check eth0 explicitly

    For whatever reason, my eth0 wasn't showing up until I explicitly specified it.

    $ ifconfig eth0
    
  3. Get an ip address

    $ sudo ifconfig eth0 192.168.1.100
    
  4. Connect to the outside internet

    sudo route …
more ...

Shrinking ova file

The Problem

I wanted to export a virtual machine and send it to a customer. However when I exported the OVA file, it was a massive 12GB. I have exported this virtual machine before and normally the ova is 2GB.

First, I check to see if some log file has …

more ...

Setting up kippo on Raspberry Pi

Downloading Kippo

  1. Download tarball from Google code.
wget https://code.google.com/p/kippo/downloads/detail?name=kippo-0.8.tar.gz
note:the project has since moved to github

2. In my case most of the traffic was attempting a sftp connection. The version of kippo that I acquired from …

more ...

Allow ping with iptables

Allow incoming:

iptables -A INPUT  -p icmp --icmp-type 8 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type 0 -m state --state ESTABLISHED,RELATED -j ACCEPT

Allow outgoing:

iptables -A OUTPUT -p icmp --icmp-type 8 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A …
more ...

Making time lapses

Instructions

  1. Make a new directory and copy only the images that are used for the timelapse.
mkdir /tmp/tl
cp timelapse*.jpg /tmp/tl/
  1. Resize the images to a certain size. (Optional):

    for i in *.JPG; do echo -e "$i...\c"; convert "$i" -resize 1920x1080 "$i"; echo done; done
    
  2. Create …

more ...

Nginx Redirect

Problem

Recently I purchased a domain to replace my no longer free subdomain provided by dyndns. I wanted to redirect all of my content from the subdomain to my new domain. Easy. However, I also wanted the root landing page to display information about the move rather than simply throwing …

more ...