Skip to content

Instantly share code, notes, and snippets.

@respi-chan
respi-chan / procnetdev.py
Created November 2, 2017 17:43 — forked from cnelson/procnetdev.py
Parses /proc/net/dev into a usable python datastructure
from datetime import datetime
class ProcNetDev(object):
"""Parses /proc/net/dev into a usable python datastructure.
By default each time you access the structure, /proc/net/dev is re-read
and parsed so data is always current.
If you want to disable this feature, pass auto_update=False to the constructor.
@respi-chan
respi-chan / .htaccess
Created January 27, 2016 18:54 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

#!/bin/bash
#
# template script for generating CentOS container for LXC
#
#
# lxc: linux Container library
# Authors: