Skip to content

Instantly share code, notes, and snippets.

View ABalanuta's full-sized avatar
🎯
Focusing

Artur Balanuta ABalanuta

🎯
Focusing
View GitHub Profile
@ABalanuta
ABalanuta / ssh-cipher-benchmark.sh
Created April 18, 2019 21:43 — forked from dlenski/ssh-cipher-benchmark.sh
Check speed of ssh cipher(s) on your system
#!/bin/bash
# Based on: http://www.systutorials.com/5450/improving-sshscp-performance-by-choosing-ciphers/#comment-28725
#
# You should set up PublicKey authentication so that you don't have to type your
# password for every cipher tested.
set -o pipefail
ciphers="$@"
@ABalanuta
ABalanuta / Removing commits on github
Last active December 11, 2018 19:39 — forked from dsci/gist:1347672
Delete commits from repository.
# First, check out the commit you wish to go back to (get sha-1 from git log)
git reset --hard 9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a
# Then do a forced update.
git push origin +9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a^:master
# Push specific commit
git push origin 9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a:master -f
@ABalanuta
ABalanuta / gist:181e00d305a03a05e9c377395d745e85
Created December 1, 2018 23:30 — forked from palexander/gist:2975305
Compiling and running mosh on Dreamhost
# Thanks to @samsonjs for the cleaned up version:
# https://gist.github.com/samsonjs/4076746
PREFIX=$HOME
VERSION=1.2.3
# Install Protocol Buffers
wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
tar -xf protobuf-2.4.1.tar.bz2
cd protobuf-2.4.1
@ABalanuta
ABalanuta / twisted-webserver-ssl-authentication.py
Last active August 29, 2017 02:45
Twisted SSL webserver with basic authentication using plain in-memory passwords. The first argument is the path of the folder to serve; if not provided then the current folder is used (".").
#!/usr/bin/env python3
"""
Twisted SSL webserver with basic authentication using plain in-memory passwords.
The first argument is the path of the directory to serve; if not provided then the current folder is used (".").
INSTALL DEPENDENCIES:
pip install twisted
pip install pyOpenSSL
pip install service_identity
#!/bin/bash
openssl req -new -x509 -keyout yourpemfile.pem -out yourpemfile.pem -days 3650 -nodes
@ABalanuta
ABalanuta / ovpn.py
Created February 22, 2016 17:28
Super simple .ovpn file generator for OpenVPN servers without openvpn-as installed to generate it.
import sys, getopt
help = "ovpn.py --host <host> --ca <capath> --crt <certpath> --key <keypath> [--port <port>, --proto <proto>, --options <optionspath>]"
template = """
dev tun
port {{PORT}}
proto {{PROTO}}
remote {{HOST}}