Skip to content

Instantly share code, notes, and snippets.

View fd0's full-sized avatar

Alexander Neumann fd0

View GitHub Profile
# ~/.asoundrc or /etc/asound.conf
# ALSA configuration file
##### USAGE #####
# Save this file as "~/.asoundrc" (for user-specific sound configuration) or
# "/etc/asound.conf" (for system-wide sound configuration) and specify ALSA
# device names ad described in the next section.
##### DEVICE NAMES #####
#!/bin/bash
max=$(cat /sys/class/backlight/intel_backlight/max_brightness)
cur=$(cat /sys/class/backlight/intel_backlight/actual_brightness)
step=$(($max/20))
case "$1" in
video/brightnessup)
new=$(($cur+$step))
#!/bin/bash
shopt -s dotglob
# use bash strict mode
set -euo pipefail
IFS=$'\n\t'
DPI="${DPI:-120}"
#!/bin/bash
shopt -s dotglob
# use bash strict mode
set -euo pipefail
IFS=$'\n\t'
if [[ "$#" != "2" ]]; then
echo "usage: $0 input.pdf output.pdf"
diff --git Makefile Makefile
index 23f4c17..8686fe4 100644
--- Makefile
+++ Makefile
@@ -1,7 +1,7 @@
tttool: src/*.hs
# cabal update
- cabal install --only-dependencies
- cabal install --bindir=.
+ cabal install --jobs --only-dependencies
@fd0
fd0 / gist:6951577
Created October 12, 2013 15:54
i3 multi monitor config snippet
# assign workspaces to screens
workspace 1 output DVI-I-1
workspace 2 output DVI-I-1
workspace 3 output DVI-I-1
workspace 4 output DVI-I-1
workspace 5 output DVI-I-1
workspace 6 output HDMI-0
workspace 7 output HDMI-0
workspace 8 output HDMI-0
workspace 9 output HDMI-0
@fd0
fd0 / go.mod
Last active February 6, 2021 10:47
termstatus size test
module github.com/fd0/termsizewidthtest
go 1.15
require golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a
for i in {0..40}; do
timestamp=$(date +"%Y-%m-%d 12:00:00" -d "+ ${i} days")
echo "=========================================================="
echo "run backup on ${timestamp}"
./restic backup --quiet --time "${timestamp}" main.go
./restic forget --keep-weekly 3
done
package main
import (
"fmt"
"os"
"time"
"golang.org/x/sys/unix"
)
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "TearFree" "true"
Option "DRI" "3"
Option "AccelMethod" "uxa"
#Option "AccelMethod" "sna"
EndSection