Skip to content

Instantly share code, notes, and snippets.

@pludi
pludi / ksp_strip.sh
Last active April 28, 2016 16:03
Quick'n'dirty KSP strip
#!/bin/sh
gpg --list-secret-keys --fingerprint $0
printf '[ ] Identity check 1\t[ ] Identity check 2\t[ ] Fingerprint check'
Verifying that +pludikovsky is my blockchain ID. https://onename.com/pludikovsky
@pludi
pludi / urlencode.sh
Created May 9, 2016 11:23 — forked from cdown/gist:1163649
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:i:1}"
case $c in
[a-zA-Z0-9.~_-]) printf "$c" ;;
@pludi
pludi / Makefile.tempo
Last active July 1, 2016 07:57
Increase tempo of multiple files easily
INPUT := $(wildcard serial-s01-e??.mp3)
OUT75 := $(patsubst %.mp3,%_1.75.mp3,$(INPUT))
OUT50 := $(patsubst %.mp3,%_1.50.mp3,$(INPUT))
all: 50 75
clean:
rm -rf serial-s01-e??_*.mp3
50: $(OUT50)

Keybase proof

I hereby claim:

  • I am pludi on github.
  • I am pludikovsky (https://keybase.io/pludikovsky) on keybase.
  • I have a public key ASDzqY3o3WJ9yZ-QV7lWHobYRTr5oloqS0lwy5aS3qCmlAo

To claim this, I am signing this object:

@pludi
pludi / ep.awk
Last active December 14, 2016 13:18
Enhances ping w colours
#!/usr/bin/awk -f
# Usage: ping … | ep.awk
# Red: Sequence difference >1
# Time increase >10%
function abs(v) {return v < 0 ? -v : v}
BEGIN {
pseq=0;
pttl=0;
ptime=0;
@pludi
pludi / procinswp.sh
Created May 10, 2017 07:10
Snippets
#!/bin/bash
printf '%-10s\t%-5s\t%-13s\t%-24s\t%s\n' 'Swap (KiB)' 'PID' 'User' 'Start time' 'Exe'
for i in /proc/[0-9]*/status
do
pid=$( basename $( dirname $i ) )
read user starttime < <( ps -o euser=,lstart= $pid )
printf "%10d\t%5d\t%-13s\t%-24s\t%s\n" "$( awk '/^VmSwap/{print $2}' $i )" "$pid" "$user" "$starttime" "$( readlink /proc/$pid/exe )"
done | \
sort -nr | \