Skip to content

Instantly share code, notes, and snippets.

@stelonix
stelonix / ipython_log
Created November 19, 2012 00:16
Simple pygame tests
#!/usr/bin/env python
# log-default-2012-11-17.py
# IPython automatic logging file
# 17:33:23
# =================================
# =================================
# 17:35:06
# =================================
# =================================
# 17:36:39
@stelonix
stelonix / dmenu_recent
Last active December 21, 2015 14:48
sh script to make dmenu keep a list of recent entries. Originally posted by mnzaki on Arch Linux Forums (https://bbs.archlinux.org/viewtopic.php?pid=1112966#p1112966)
#!/bin/bash
# Originally based on code by Dieter Plaetinck.
# Pretty much re-written by Mina Nagy (mnzaki)
dmenu_cmd="dmenu $DMENU_OPTIONS"
terminal="urxvtc -e"
max_recent=199 # Number of recent commands to track
cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/dmenu-recent"
@stelonix
stelonix / opacity_zenity.py
Last active December 23, 2015 03:29
Simple Zenity slider to change current window transparency. Needs a better way to find the Window who called the script. Made for pekwm. Requires: transset-df, zenity and xprop. Rev 3: Now honors Zenity's return value
#!/usr/bin/python2
import sys, subprocess, os
from subprocess import PIPE, Popen
from threading import Thread
from Queue import Queue, Empty
def enqueue_output(out, queue):
for line in iter(out.readline, b''):
queue.put(line)
@stelonix
stelonix / dubstep.net_rip.py
Created October 11, 2013 18:28
Dubstep.net site ripper. Works by scrapping, which might be illegal to use in some countries.
# All the configuration is done on the file
# It attempts to download tracks based on id, which I assume it's automatically incremented
# Very naive but it works
# Some of the code is based on code found in stackoverflow.com, all make it obvious in another revision
# TODO: Make the progress display better
import urllib2, lxml.html, traceback
from lxml.cssselect import CSSSelector
from sys import stdout
# Tint2 config file
# Generated by tintwizard (http://code.google.com/p/tintwizard/)
# For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure
# Background definitions
# ID 1
rounded = 0
border_width = 2
background_color = #000000 22
border_color = #FFFFFF 6
@stelonix
stelonix / clipboard
Created May 8, 2014 21:02
urxvt clipboard access
#! perl
# source: https://bbs.archlinux.org/viewtopic.php?pid=619931#p619931
sub on_sel_grab {
my $query = quotemeta $_[0]->selection;
$query =~ s/\n/\\n/g;
$query =~ s/\r/\\r/g;
system( "echo -en " . $query . " | xsel -ibp" );
}
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
export PS1='\[\033[01;32m\]\u@\h \[\033[00;31m\]\W \$ \[\033[00m\]'
! transparency - true or false (default)
URxvt*transparent: false
URxvt.depth: 24
URxvt.background: [75]#000000
URxvt.cursorBlink: 1
URxvt*saveLines: 12000
URxvt*foreground: White
@stelonix
stelonix / pscan
Last active August 29, 2015 14:10
#!/usr/bin/bash
fping -a -g 192.168.1.0/24 2> /dev/null