Skip to content

Instantly share code, notes, and snippets.

@erronjason
erronjason / rssh.service
Created April 17, 2017 20:10
Reverse SSH systemd service
# /etc/systemd/system/rssh.service
[Unit]
Description=Reverse SSH Service
ConditionPathExists=|/usr/bin
After=network.target
[Service]
User=<USERNAME HERE>
ExecStart=/usr/bin/ssh -NTC -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=no -i /home/<USERNAME>/.ssh/h -R <PORT YOU WANT OPEN ON REMOTE MACHINE>:localhost:<LOCAL SSH PORT> -l <REMOTE USERNAME> -N <REMOTE HOST> -p <REMOTE LISTENING PORT>
@erronjason
erronjason / wifi-qr.sh
Last active March 30, 2017 14:56
Generate a QR for your network automatically
#!/usr/bin/env bash
SSID="sample\ network" # Spaces should be escaped with the backslash character "\".
PASSWORD="password would go here"
SECURITY_TYPE="WPA2" # Allowed types are "WPA", "WPA2", and "WEP"; though there may be more.
COLOR="9f8f68" # This is the hex value of the color you wish to generate
PLAINTEXT="Network Name: $SSID\nPassword: $PASSWORD\nSecurity type: $SECURITY_TYPE\n"
command_exists () {
type "$1" &> /dev/null;
@erronjason
erronjason / allow-utc.bat
Created March 5, 2017 05:49
Makes Windows to use UTC instead of treating it like some animal. Requires restart to take effect.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation] “RealTimeIsUniversal”=dword:00000001
@erronjason
erronjason / alt-resize.sh
Created February 22, 2017 16:45
Ubuntu Alt+Right Click to resize
#!/usr/bin/env bash
gsettings set org.gnome.desktop.wm.preferences resize-with-right-button true
@erronjason
erronjason / set_port.bat
Created October 15, 2016 00:45
Sets your RDP port to 55555
REGEDIT4
@ This sets your RDP port to "55555".
@ The value is just hex dword
; @ECHO OFF
; CLS
; REGEDIT.EXE /S "%~f0"
; EXIT
@erronjason
erronjason / s3-sync
Created October 10, 2016 16:00
Scripts aws-cli to get and push images
#!/bin/bash
# Syncs s3 images back and forth for the uploads dir
#
# Manual commands:
# aws s3 sync s3://bucket-name/uploads/ . #Remote bucket to local
# aws s3 sync . s3://bucket-name/uploads/ #Local to remote bucket
usage="
Usage:
$0 (get|put)"
@erronjason
erronjason / remove_proxmox_nag.sh
Last active March 27, 2017 19:53
Disable Proxmox "license" nag via cron - we don't need no stinkin' support
#!/usr/bin/env bash
# This inserts a cronjob at the top of the hour to remove the
# license nag from proxmox. The command alone is:
# sed -i "s/data.status !== 'Active'/false/g" /usr/share/pve-manager/js/pvemanagerlib.js
crontab -l > tmpcron
echo "0 * * * * sed -i "s/data.status !== 'Active'/false/g" /usr/share/pve-manager/js/pvemanagerlib.js" >> tmpcron
crontab tmpcron
rm tmpcron
@erronjason
erronjason / keri_serial_pinout.md
Last active September 21, 2016 16:42
Keri serial pinout

A { Serial (RS-232):

The photo shows the pin numbers in the plastic

5 4 3 2 1
@erronjason
erronjason / metacheck.sh
Created June 14, 2016 20:45
Used to check meta description and title of pages
#!/bin/bash
# Usage: metacheck.sh google.com google.com/mail or will loop
# over internally defined curenturls when run with no arguments
CURRENTURLS=(
dev.bravepeople.co/
dev.bravepeople.co/work/
dev.bravepeople.co/process/
dev.bravepeople.co/culture/
dev.bravepeople.co/hire-us/
@erronjason
erronjason / convert-pdfs-to-jpgs.bat
Created March 5, 2016 03:38
Converts pdfs to jpgs - You're gonna need convert (imagemagick) and ghostscript for windows
:: You're gonna need convert (imagemagick) and ghostscript for windows
:: Assumes pdfs are in a folder below this script called pdfs\ and will throw jpgs into jpgs\
for %%f in (pdfs\*.pdf) do (
convert %%f jpgs\%%~nf.jpg
)