Skip to content

Instantly share code, notes, and snippets.

@Gordin
Gordin / putio_pcloud_sync.py
Last active January 29, 2019 20:57
Script to Sync files from put.io to pcloud
# Get Put.io Key with the AuthHelper and fill in PCLOUD/PUTIO variables
# putio_pcloud_sync.py list
# putio_pcloud_sync.py filter 'START OF ONE OF THE list OUTPUTS'
# putio_pcloud_sync.py sync 'START OF ONE OF THE list OUTPUTS' 'PATH IN PCLOUD'
import sys
import asyncio
import putiopy
from pcloud import PyCloud
from sh import mv, rm, aria2c
#!/bin/sh
wait_for_hosts () {
for host in $@; do
while ! timeout 5 bash -c "echo > /dev/tcp/${host//:/\/}"; do
echo "$host is not available. Retrying..."
sleep 2
done
echo $host is available!
done
; 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
@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"
@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 / 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 / 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 / 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 / ROLE-Prosody-compat.md
Last active September 3, 2015 11:38
Making Prosody compatible to ROLE SDK
@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
}