Skip to content

Instantly share code, notes, and snippets.

View mkorthof's full-sized avatar
⌨️
cli connoisseur

Marius mkorthof

⌨️
cli connoisseur
View GitHub Profile
@mkorthof
mkorthof / .screenrc
Created October 25, 2017 12:05
alternative for screen + SSH_AUTH_SOCK
# this needs an alias:
# alias screen='echo "setenv SSH_AUTH_SOCK $SSH_AUTH_SOCK" > $HOME/.ssh/screen; screen -X source $HOME/.ssh/screen; screen'
bind H eval "source $HOME/.ssh/screen" "readbuf $SSH_AUTH_SOCK" 'stuff "export SSH_AUTH_SOCK=$SSH_AUTH_SOCK\n"' "echo 'SSH_AUTH_SOCK set!'"
@mkorthof
mkorthof / csr.sh
Created December 29, 2017 16:17
Generate certificate request with SAN (needs file.key)
#!/bin/bash
# ./csr.sh [domain] [filename] - generate certificate request (needs file.key)
# set domain and key/csr filename permanently:
DOMAIN="example.com"; FN="example"
# set certificate attributes:
C="AU"; ST="Some-State"; L="City"; O="Internet Widgits Pty Ltd"; OU="Section"
@mkorthof
mkorthof / pop3.exp
Created January 13, 2018 14:16
pop3.exp - connects to pop3 server using telnet
#!/usr/bin/expect
proc help {} {
global argv0
puts ""
puts "pop3.exp - connects to pop3 server using telnet"
puts ""
puts "usage: $argv0 <host> <user>"
puts " it will prompt for password"
puts ""
@mkorthof
mkorthof / httpd.md
Last active November 16, 2019 13:56
Python SimpleHTTPServer - Moved to: https://github.com/mkorthof/httpyd
@mkorthof
mkorthof / clamwrap.sh
Created July 20, 2018 11:10
adjust clamscan oom score
#!/bin/sh
# http://www.oracle.com/technetwork/articles/servers-storage-dev/oom-killer-1911807.html
# https://backdrift.org/oom-killer-how-to-create-oom-exclusions-in-linux
echo 10 > /proc/self/oom_score_adj && /usr/bin/clamscan "$@"
@mkorthof
mkorthof / json2xml.py
Last active December 20, 2023 19:49
conv json to xml
#!/usr/bin/python3
# Source: https://github.com/quandyfactory/dicttoxml/blob/master/README.markdown
# page = urllib.urlopen('http://quandyfactory.com/api/example')
import json
import urllib
import dicttoxml
import sys