Skip to content

Instantly share code, notes, and snippets.

View vain's full-sized avatar

vain

View GitHub Profile
@vain
vain / .Xresources
Created April 9, 2012 08:22
XTerm colors
! Farben, based on Thayer:
! http://cinderwick.ca/files/configs/Xdefaults
XTerm*background: #0e0e0e
XTerm*foreground: #aaaaaa
XTerm*cursorColor: #ffffff
! Black
XTerm*color0: #000000
XTerm*color8: #555753
! Red
XTerm*color1: #ff6565
@vain
vain / gist:2342271
Created April 9, 2012 08:18
Ugly perl colored ls (no separators)
#!/usr/bin/perl -w
use strict;
my $cols = int(`tput cols`);
my $COL_BOLD = "\e[1m";
my $COL_RESET = "\e[0m";
my $COL_BLACK = "\e[30m";
my $COL_RED = "\e[31m";
my $COL_GREEN = "\e[32m";
@vain
vain / gist:2342267
Created April 9, 2012 08:16
inkpot2_orig_simplified
" Vim color file
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "inkpot2_orig_simplified"
@vain
vain / coloredls.pl
Created September 3, 2011 12:58
Colored ls with separators.
#!/usr/bin/perl -w
use strict;
# Dear world,
#
# this is what your code will look like when you're too tired to
# actually write code. So, remember, kids: Sleep early, sleep often. :-)
#
# Happy hacking.
@vain
vain / gist:1073680
Created July 9, 2011 15:45
Simple adblock for luakit
--------------------
-- Simple adblock --
--------------------
-- Basically a simplified version of:
-- https://github.com/quigybo/luakit/blob/d19c3014d0bc5603bf5f6eae5cf689a95d3eb97d/lib/adblock.lua
local table = table
local ipairs = ipairs
local string = string
@vain
vain / .vimrc
Created June 24, 2011 14:39
Momentane .vimrc
" -------------
" Jetzt nötig mit "richtigem" Vim-Package bei Arch (2009-09-14):
syntax enable
filetype plugin indent on
set hls
set incsearch
set showcmd
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
@vain
vain / gma3150-backlight.sh
Created April 28, 2011 19:37
Control the backlight of an Intel GMA 3150.
#!/bin/bash
current=$(sudo setpci -s 00:02.0 F4.B)
current=$((0x$current))
if [[ "$1" == "up" ]]
then
((current+=0x10))
else
((current-=0x10))
@vain
vain / bmenu.sh
Created February 12, 2011 20:30
Bash-Menü-Beispiel für Nobuddy
#!/bin/bash
# Mit den Cursor-Tasten bedienbares Menü.
# Hilfsfunktion: Ist ein Item im Array enthalten?
# Siehe auch:
# http://forum.ubuntuusers.de/topic/contains-mit-bash-implementieren/
contains()
{
Hey,
du kannst auch explizit das Terminal nochmal öffnen mit /dev/tty. Kann
zum Beispiel so aussehen:
(read -p 'Gib ein: ' -r line < /dev/tty; echo "$line") < ~/.bashrc
Stdin ist eigentlich umgeleitet aus der ~/.bashrc, aber trotzdem kommst
du zur Abfrage und kannst auch etwas eingeben. :)
#!/bin/bash
# Based on the "Shell image viewer" by Andreas Schönfelder:
# https://bbs.archlinux.org/viewtopic.php?id=106089
# Defaults.
doublexres="yes"
colors="$(tput colors)"
size="$(($(tput cols) - 2))x$(($(tput lines) - 2))"