This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import subprocess | |
from time import sleep | |
from threading import Thread | |
import logging | |
from logging.handlers import RotatingFileHandler | |
from libqtile.config import Key, Screen, Group, Drag, Click, Match | |
from libqtile.command import lazy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo -ne "\033]0;${1}\007" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
# nagios configuration | |
define contact { | |
contact_name slack | |
alias Slack | |
service_notification_period 24x7 | |
host_notification_period 24x7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
$ ./export_confulence_space.py -l http://wiki.some.com -u username -p password -s SPACEKEY | |
$ ./export_confulence_space.py -l http://wiki.some.com -u username -p password -a # all spaces available for given user | |
""" | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" When started as "evim", evim.vim will already have done these settings. | |
if v:progname =~? "evim" | |
finish | |
endif | |
" Use Vim settings, rather then Vi settings (much better!). | |
" This must be first, because it changes other options as a side effect. | |
set nocompatible | |
" allow backspacing over everything in insert mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" where i'm | |
set number | |
set cursorline | |
set nocursorcolumn | |
" work with .vimrc | |
map ,v :sp ~/.vimrc<cr> " edit my .vimrc file in a split | |
map ,e :e ~/.vimrc<cr> " edit my .vimrc file | |
map ,u :source ~/.vimrc<cr> " update the system settings from my vimrc file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p mini; for img in `ls *.jpg`; do convert -fill white -geometry 100x200 -size 100x200 -scale 100x200 $img mini/$img; echo "<a style='display: block; width: 100px; height: 200px; float: left; margin: 10px; border: solid 1pX #ccc' href='$img' onclick='window.open(this.href); return false'><img src='mini/$img' /></a>"; done > gallery.html | |
google-chrome gallery.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
import urllib2 | |
import time | |
import sys | |
if len(sys.argv) < 2: | |
sys.stout.write( "Usage: %s http://page/ counter\n" % sys.argv[0]) | |
sys.exit(0) | |
site = sys.argv[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION object_notify() RETURNS trigger AS $$ | |
DECLARE | |
BEGIN | |
PERFORM pg_notify('object_updated',CAST(NEW.id AS text)); | |
RETURN NEW; | |
END; | |
$$ LANGUAGE plpgsql; | |
CREATE TRIGGER object_post_insert_notify AFTER UPDATE ON objects FOR EACH ROW EXECUTE PROCEDURE object_notify(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Find files recursively using given file extensions and run given command on random 'n' files: | |
* python randomrun.py -e mkv,avi,ogm -r vlc -c 4 /some/dir/ # run 4 random moves using vlc | |
* python randomrun.py -e txt,dat -r cat -c 3 -p /some/dir/ # run cat on 3 random files parallelly | |
""" | |
import argparse |