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="$@"
### Keybase proof
I hereby claim:
* I am abalanuta on github.
* I am arturbalanuta (https://keybase.io/arturbalanuta) on keybase.
* I have a public key ASDEHu1OYsbFR5DV1_3sO7ultS7gNxY0akYnFziH9EoKSAo
To claim this, I am signing this object:
@ABalanuta
ABalanuta / TOR.md
Last active December 28, 2022 20:30
TOR_BootStrap_tor_over_ssh
#!/bin/bash
# From: https://gitlab.com/grownetics/devops/blob/master/tor_ssh.sh
# TOR Setup Script
# Author: Nick Busey
#
# This file is meant to get SSH access via Tor to a server in one command.
#
# Usage (as root): $ bash <(curl -s https://gitlab.com/grownetics/devops/raw/master/tor_ssh.sh)
@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
rock@localhost:~$ openssl speed aes-256-cbc
Doing aes-256 cbc for 3s on 16 size blocks: 10955656 aes-256 cbc's in 3.00s
Doing aes-256 cbc for 3s on 64 size blocks: 2971918 aes-256 cbc's in 3.00s
Doing aes-256 cbc for 3s on 256 size blocks: 752396 aes-256 cbc's in 3.00s
Doing aes-256 cbc for 3s on 1024 size blocks: 189230 aes-256 cbc's in 3.00s
Doing aes-256 cbc for 3s on 8192 size blocks: 23578 aes-256 cbc's in 3.00s
Doing aes-256 cbc for 3s on 16384 size blocks: 11824 aes-256 cbc's in 3.00s
OpenSSL 1.1.0g 2 Nov 2017
built on: reproducible build, date unspecified
options:bn(64,64) rc4(char) des(int) aes(partial) blowfish(ptr)
for i in `ssh -Q cipher`; do dd if=/dev/zero bs=1M count=300 2> /dev/null | ssh -c $i $USER@localhost "(time -p cat) > /dev/null" 2>&1 | grep real | awk '{print "'$i': "300 / $2" MB/s" }'; done
# /etc/ssh/ssh_config (or ~/.ssh/config) and sshd_config
Ciphers chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com
#https://turecki.net/content/getting-most-out-ssh-hardware-acceleration-tuning-aes-ni
@ABalanuta
ABalanuta / etc default lora-gateway-bridge
Last active November 6, 2017 20:03
lora-gateway-bridge configuration files for the MultiTech Conduit: https://github.com/OpenChirp/docs/wiki/Multitech-Conduit/
# ip:port to bind the UDP listener to (default: "0.0.0.0:1700")
UDP_BIND=127.0.0.1:1700
# mqtt server (e.g. scheme://host:port where scheme is tcp, ssl or ws) (default: "tcp://127.0.0.1:1883")
MQTT_SERVER=tls://openchirp.andrew.cmu.edu:1883
# mqtt prefix
MQTT_PREFIX="<your_openchirp_device_endpoint>"
# mqtt server username (optional)
@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