whatsdoom.com

Colored diff on the Command line

DateReadtime 1 minutes Tags

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

DateReadtime 3 minutes Tags

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

DateReadtime 1 minutes Tags

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

DateReadtime 1 minutes Tags

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

DateTags

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

DateReadtime 1 minutes Tags

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

DateReadtime 1 minutes Tags

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 ...

Setting feh as default image viewer

DateReadtime 1 minutes Tags

I found eog to be too slow at rendering pictures for my purpose. I wanted to make feh (a commandline based image viewer) my default.

  1. Try and figure out how to change default.

    • right click image
    • properties
    • open with

    but I couldn't find feh listed as an option

  2. Edit feh's …

more ...

LDAP for Django

DateReadtime 2 minutes Tags

Introduction

This document will include the author's entire notes on installing and configuring ldap for django.

Installation

  1. Create a directory in /opt:

    mkdir /opt/that
    
  2. Create a virtualenv in that directory:

    virtualenv example
    

Make sure that you also source the directory before running pip commands. i.e.:

source /opt/that …
more ...