LDAP for Django

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

Digital Ocean API Wrapper

I found myself wanting to take snapshots of my digital ocean droplets. I wrote a quick python script that wraps the api and allows me to snapshot my droplet on a regular basis.

#! /usr/bin/env python

import requests
import time

API_KEY=''
CLI_ID=''

def fetch(path, opts={}):
    opts['api_key'] = API_KEY …
more ...

Getting a random file from a directory

I had a massive directory of files that I wanted to pick a few random files to test before I imported the whole set. For this post lets say I want 100 random files from some_dir and moving them to this_dir.

First you could use:

$ LIST=$(ls -1 ./some_dir | sort …
more ...

LVM resize

My root partition recently ran out of space and I needed to resize it.

So I booted into a live usb and then, after activating my volume groups:

$ sudo vgchange -a y

I looked up lvm resize online and came up with the command:

$ sudo lvextend -L+10G /dev/mapper …
more ...

Extension ram files

I was helping my girlfriend watch some videos that she needed for a class that she was having trouble playing on her mac. Once I saw that ubuntu wasn't able to play them out of the box I looked at the extension and found a solution on ubuntu forums.

The …

more ...

Broadcom Wireless Internet Setup

So I have had this issue where my wireless card would one day suddenly disappear. I had a wireless usb so I used that for a month or so and finally I decided that I would just reinstall and see if that fixed it. It did like magic but then …

more ...

Forward and Back Buttons

For what ever reason perhaps just nostalgia possibly because I happen to use them more than expected, I have forward and back links on my website. The buttons are JavaScript powered and I have had "noscript" tags warning users of their lack of functionality since I added the links years …

more ...

Watermarking with Image Magick

I decided to try and start signing my pictures.

composite -watermark 15% -gravity southeast sign-1.png $i $i;

It needs more tweaking but that will do for now.

To convert all files in a directory:

for i in *.JPG; do
        echo -e "$i... \c";
        composite -watermark 15% -gravity southeast sign-1 …
more ...