Skip to content

Instantly share code, notes, and snippets.

View avnik's full-sized avatar
🏠
Working from home

Alexander V. Nikolaev avnik

🏠
Working from home
View GitHub Profile
case "$ZSH_VERSION" in
4.3.1*|4.3.[789]|4.[456789]*)
autoload -Uz vcs_info;;
*)
echo "Upgrade your zsh!";;
esac
case $TERM in
dumb)
export PROMPT="%#"
@avnik
avnik / gist:5393903
Last active December 16, 2015 06:49
class Node:
def __init__(self,val):
self.val = val
self.left = None
self.right = None
def __cmp__(self, other):
return cmp(self.val, other.val)
def valid(self, side):
# in /srv/salt/foo/data.sls
/srv/data:
file.recurse:
- source: salt://data/blobs
# in master config
file_roots:
base:
- /srv/salt
data:
# NOTE: overriding __call__ in BaseTask not work, so monkey path Task
def deduplicator(f):
@wraps(f)
def wrapper(self, *a, **kw):
if config.get('REDIS_DEDUPLICATION', None):
if redis_dedup(self.request.id, self.request.retries):
raise Ignore()
return f(self, *a, **kw)
return wrapper
# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=1
DEVPATH=hwmon0=devices/platform/it87.656
DEVNAME=hwmon0=it8721
FCTEMPS=hwmon0/device/pwm2=hwmon0/device/temp1_input hwmon0/device/pwm3=hwmon0/device/temp2_input
FCFANS=hwmon0/device/pwm2=hwmon0/device/fan1_input hwmon0/device/pwm3=hwmon0/device/fan2_input
MINTEMP=hwmon0/device/pwm2=40 hwmon0/device/pwm3=40
MAXTEMP=hwmon0/device/pwm2=100 hwmon0/device/pwm3=85
MINSTART=hwmon0/device/pwm2=81 hwmon0/device/pwm3=100
MINSTOP=hwmon0/device/pwm2=80 hwmon0/device/pwm3=90
package main
import "runtime"
import "runtime/debug"
type inner struct {
data int
}
type outer struct {
alias fuck='sudo $(fc -ln -1)'
# Set up aliases
alias ack='ack-grep'
alias mv='nocorrect mv' # no spelling correction on mv
alias cp='nocorrect cp' # no spelling correction on cp
alias mkdir='nocorrect mkdir' # no spelling correction on mkdir
alias j=jobs
alias pu=pushd
alias po=popd
alias d='dirs -v'
#!/usr/bin/pulseaudio -nF
#load-module module-alsa-sink device=hw:0 tsched=0 sink_name=main.out
#load-module module-alsa-source device=hw:0 tsched=0 source_name=main.in
load-module module-udev-detect
load-module module-null-sink
#load-module module-equalizer-sink
load-module module-dbus-protocol
load-module module-augment-properties
load-module module-esound-protocol-unix
I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
D: [pulseaudio] core-rtclock.c: Timer slack is set to 50 us.
D: [pulseaudio] core-util.c: RealtimeKit worked.
I: [pulseaudio] core-util.c: Successfully gained nice level -11.
I: [pulseaudio] main.c: This is PulseAudio 5.0
D: [pulseaudio] main.c: Compilation host: x86_64-pc-linux-gnu
D: [pulseaudio] main.c: Compilation CFLAGS: -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -W -Wextra -pipe -Wno-long-long -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-
#!/usr/bin/pulseaudio -nF
#load-module module-alsa-sink device=hw:0 tsched=0 sink_name=main.out
#load-module module-alsa-source device=hw:0 tsched=0 source_name=main.in
load-module module-alsa-card card_name=main tsched=0 device_id=0 sink_name=main.out source_name=main.in use_ucm=false profile=headphones profile_set=/etc/pulse/profile.conf paths_dir=/etc/pulse/paths
#load-module module-udev-detect tsched=1 use_ucm=true
load-module module-null-sink
#load-module module-equalizer-sink
load-module module-dbus-protocol
load-module module-augment-properties