Skip to content

Instantly share code, notes, and snippets.

View T4cC0re's full-sized avatar

Hendrik Meyer T4cC0re

View GitHub Profile
@T4cC0re
T4cC0re / keybase.md
Last active July 28, 2019 10:55
keybase.md

Keybase proof

I hereby claim:

  • I am t4cc0re on github.
  • I am t4cc0re (https://keybase.io/t4cc0re) on keybase.
  • I have a public key ASAQ5kbktVTaXWbwRLdDxG9YbCbtQpNpNqbRW0vmp2V81Qo

To claim this, I am signing this object:

@T4cC0re
T4cC0re / makeItWindows.js
Created March 12, 2015 17:16
Remove unix annoyances (\n & colors)
var makeItWindows = function (text) {
return text.replace(/\x1b\[[0-9;]*m/g,"").replace(/\r?\n/g,"\r\n");
};
@T4cC0re
T4cC0re / gist:5c1c4684c685ed4fa35f
Created May 15, 2015 13:10
Hubic+Duplicity GnuPG
#!/bin/bash
# Sign key has to have no password or enter it into SIGN_PASSPHRASE
export SIGN_PASSPHRASE=""
# Leave this blank. This will enforce GnuPG engryption
export PASSPHRASE=""
# Change the KeyIDs in the next lines to match yours.
# The encrypt key needs to be trusted and the signkey needs the private key in the GnuPG Keychain
export SIGNKEY=""
export ENCRYPTKEY=""
@T4cC0re
T4cC0re / convert
Last active December 6, 2015 21:54
X-Mas PiTree scripts
#!/bin/bash
# Get middle of video and crop it to 9/16
ffmpeg -i "$1" -threads 0 -c:v libx264 -c:a copy -c:s copy -s:t copy -map 0 -vf "scale=iw*sar:ih, crop=min(iw\,ih*(9/16)):ow/(9/16)" -aspect 9:16 -map_metadata 0 -preset ultrafast -crf 19 "tmp.mp4"
# rotate by 90 degrees counter colckwhise
ffmpeg -i "tmp.mp4" -vf "transpose=2" "tmp2.mp4"
# scale to 1080
ffmpeg -i "tmp2.mp4" -vcodec libx264 -profile:v high -preset fast -crf 18 -b-pyramid none -acodec ac3 -ab 1536k -scodec copy -vf "scale=1920:1080" "$1_final_1080.mp4"
# rm tempfiles
rm tmp.mp4 tmp2.mp4
@T4cC0re
T4cC0re / spideroak.conf
Last active January 4, 2016 14:09
SpiderOakONE Headless via supervisord - Configure it via ssh -X and a gui configuration
[program:SpiderOakONE]
command = /usr/bin/SpiderOakONE --verbose --headless
stdout_logfile = /var/log/supervisor/%(program_name)s.log
stderr_logfile = /var/log/supervisor/%(program_name)s.log
pidfile = /var/run/spideroakone.pid
autorestart = true
numprocs = 1
process_name = SpiderOakONE
numprocs_start = 1
autostart = true
@T4cC0re
T4cC0re / gist:14f34dee4b6f4b6b4211
Created January 24, 2016 07:49
add user to sudoers w/o passwd
echo "`whoami` ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/`whoami`
@T4cC0re
T4cC0re / secureit.sh
Last active January 27, 2018 20:09
Secure SSH access (as root)
#/usr/bin/env bash
# this assumes you have installed your public key and have means to access to the server.
rm -rf /etc/ssh/ssh_host_*
ssh-keygen -A
passwd -d root
sed -i 's/^[# ]*PermitRootLogin [^\r\n\]\+$/PermitRootLogin without-password/gmi' /etc/ssh/sshd_config
sed -i 's/^[# ]*ServerKeyBits [^\r\n]\+$/ServerKeyBits 2048/gmi' /etc/ssh/sshd_config
sed -i 's/^[# ]*PermitEmptyPasswords [^\r\n]\+$/PermitEmptyPasswords no/gmi' /etc/ssh/sshd_config
sed -i 's/^[# ]*PubkeyAuthentication [^\r\n]\+$/PubkeyAuthentication yes/gmi' /etc/ssh/sshd_config
sed -i 's/^[# ]*PasswordAuthentication [^\r\n]\+$/PasswordAuthentication no/gmi' /etc/ssh/sshd_config
@T4cC0re
T4cC0re / checkup.sh
Created February 15, 2016 13:21
Waits for port availability on the given host. Usage: checkup.sh <hostname/ip> <port>
#!/usr/bin/env bash
until nc -vzw 2 $1 $2 &> /dev/null; do echo Host $1 is NOT reachable on port $2; sleep 5; done && echo Host $1 IS reachable on port $2; exit 0;
@T4cC0re
T4cC0re / gulpfile.js
Created March 9, 2016 16:24
gulp wait for end of stream
//...
gulp.task('stuff', function (cb) {
gulp.src([...])
.pipe(...)
.pipe(...)
.pipe(...)
.pipe(...)
.on('end', cb);
});
//...
@T4cC0re
T4cC0re / .gitconfig
Last active August 30, 2016 11:31
Configs
[user]
email = mail
name = user
signingkey = 8-digit-gpg-key
[gpg]
program = gpg2
[commit]
gpgsign = true
[push]
default = matching