Skip to content

Instantly share code, notes, and snippets.

View hilt86's full-sized avatar

Hilton hilt86

View GitHub Profile
@hilt86
hilt86 / example.py
Created August 26, 2020 10:43
Lopy4 code
from network import LoRa
import socket
import binascii
import struct
import time
import pycom
from machine import Pin
import machine
from machine import Timer
@hilt86
hilt86 / renewingLetsencryptRouteros.md
Created February 4, 2020 02:25
renewingLetsencryptRouteros
@hilt86
hilt86 / heroku-tips-tricks.md
Last active November 20, 2019 00:02
heroku-tips-tricks

Copy Heroku config vars from one app to another

export

heroku config -s -a existing-heroku-app > config.txt

import

cat config.txt | tr '\n' ' ' | xargs heroku config:set -a new-heroku-app

Stolen from Emir Karşıyakalı

@hilt86
hilt86 / routeros-tips-tricks.md
Created November 19, 2019 01:00
routeros-tips-tricks.md

Find which port a MAC address is on

First find out what the MAC address is (CRS109)

/ip dhcp-server lease print

Then match MAC to port (CRS-328)

/interface ethernet switch host print
@hilt86
hilt86 / openssl-tips-tricks.md
Last active November 1, 2019 10:45
openssl-tips-tricks

Useful security related commands

Prints the SHA fingerprint of a certificate

openssl x509 -noout -fingerprint -sha256 -inform pem -in cert.crt

@hilt86
hilt86 / ansible-tips-tricks.md
Created October 23, 2019 03:52
ansible-tips-tricks

Restart services using Ansible ad-hoc commands

ansible -m systemd -a "name=metricbeat state=stopped" webservers --become

@hilt86
hilt86 / ssh-tips-tricks.md
Created October 21, 2019 05:57
ssh-tips-tricks

SSH tips and tricks

port forward port 3389 on remote network to localhost:3389

ssh -L 3389:10.10.10.1:3389 sshServer

@hilt86
hilt86 / sstp-on-macos.md
Last active October 21, 2019 05:58
sstp-on-macos

"noauth" argument prevents the client expecting the server to provide a password to authenticate itself

/usr/local/sbin/sstpc --log-stderr --cert-warn --user username --password "badass" vpn.example.com:port usepeerdns require-mschap-v2 noauth noipdefault defaultroute refuse-eap noccp

kubectl -n kube-system create serviceaccount tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account=tiller
@hilt86
hilt86 / gist:71681e5f03eb93fc16b0119beee9dcd8
Created February 18, 2019 04:20
Command to run Hashicorp Vault
docker run -d --cap-add=IPC_LOCK -p 127.0.0.1:8200:8200 -v vault:/vault -e 'VAULT_LOCAL_CONFIG={"backend": {"file": {"path": "/vault/file"}}, "default_lease_ttl": "168h", "listener":{"tcp":{"address":"0.0.0.0:8200","tls_disable":1}}}", max_lease_ttl": "720h"}' -e 'VAULT_UI=TRUE' vault server