Skip to content

Instantly share code, notes, and snippets.

@Gordin
Gordin / scrolls-pol-script.sh
Last active August 29, 2015 13:57
Scripts to install and run Scrolls on linux with PlayOnLinux
#!/bin/bash
# Date : 2013-06-02 17:37
# Last revision : 2013-08-06 19:54
# Wine version used : 1.5.29, 1.5.31, 1.6
# Distribution used to test : Ubuntu 13.04 x64 (Unity)
# Author : Vimes
# Depend: unzip
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

Keybase proof

I hereby claim:

  • I am gordin on github.
  • I am gordin (https://keybase.io/gordin) on keybase.
  • I have a public key whose fingerprint is 82F2 7A3D E6A7 B0E0 679F E8E2 2AFD E976 F48A 7A0C

To claim this, I am signing this object:

@Gordin
Gordin / volume
Last active August 29, 2015 14:00
This sets the volume of the default pulseaudio sink and all currently running applications to the a certain value (0-100). If you call this without a value, all applications will be reset to the volume of the default sink.
#!/bin/bash
reset_volumes() {
volume=$(pacmd dump-volumes | head -1 | sed 's/.\+: \([0-9]\+\).*real.*/\1/')
apps=($(pacmd list-sink-inputs | grep index | cut -d " " -f 6))
for app in $apps; do
pacmd set-sink-input-volume ${app} ${volume}
done
}
@Gordin
Gordin / ROLE-Prosody-compat.md
Last active September 3, 2015 11:38
Making Prosody compatible to ROLE SDK
@Gordin
Gordin / checkcerts.py
Created March 17, 2015 19:50
Script to check when your SSL certificates expire
#!/usr/bin/env python3
import OpenSSL
from datetime import datetime, timedelta
from glob import glob
now = datetime.now()
month = timedelta(30)
soon = now + month
files = []
@Gordin
Gordin / selecta.zsh
Last active August 29, 2015 14:25
Selecta history widget for zsh
if [[ -n $(which selecta) ]]; then
# CTRL-R - Paste the selected command from history into the command line
selecta-history-widget() {
local selected restore_no_bang_hist
if [[ -z "$LBUFFER" ]]; then
selected=( $(fc -l 1 | selecta) )
else
selected=( $(fc -l 1 | selecta -s "$LBUFFER") )
fi
if $selected; then
@Gordin
Gordin / vscode.json
Created October 11, 2017 11:19
Visual Studio Code conf
{
"vim.disableAnnoyingNeovimMessage": true,
"window.zoomLevel": 0,
"python.pythonPath": "python2",
"editor.wordWrapColumn": 100,
"editor.renderWhitespace": "boundary",
"workbench.colorTheme": "Monokai",
"editor.fontSize": 15,
"search.exclude": {
"**/node_modules": true,
@Gordin
Gordin / docker_exec.sh
Created March 29, 2018 13:17
Docker exec with correct Terminal size
dexec(){
CONTAINER=$1
shift
docker exec -it $CONTAINER bash -c "stty cols $COLUMNS rows $LINES && $*";
}
_dexec(){
COMPREPLY=( $(docker ps --format "{{.Names}}" -f name=$2) );
}
complete -F _dexec dexec;
export dexec;
@Gordin
Gordin / dvorak_umlauts.sh
Created April 3, 2018 14:49
Adds Uppercase Umlauts to dvorak(-intl) layout
#!/bin/sh
xmodmap -e "keycode 25 = comma less comma less adiaeresis Adiaeresis adiaeresis"
xmodmap -e "keycode 28 = y Y y Y udiaeresis Udiaeresis udiaeresis"
xmodmap -e "keycode 53 = q Q q Q odiaeresis Odiaeresis odiaeresis"
; PageUp does a slide attack. Can be held down if your weapon is really fast
; Change `; to your duck key and l to your melee attack key
#IfWinActive ahk_exe Warframe.x64.exe
slideAttackActive := false
PgUp::
if (not slideAttackActive) {
slideAttackActive := true
send {`; down}
send, {l}
Sleep, 200