Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
number=$((RANDOM%30000+15000))
echo "New SSH port is "$number
if [[ -d "/etc/csf" ]];then
in_good="TCP_IN = \"20,21,"
good1=$in_good$number
eval "sed -i 's/TCP_IN = \"20,21,22,/$good1,/g' csf.conf"

Keybase proof

I hereby claim:

  • I am erronjason on github.
  • I am erronjason (https://keybase.io/erronjason) on keybase.
  • I have a public key whose fingerprint is 8D06 2876 3CF2 410F E5A3 06AE AE8C 32C8 EFB7 A631

To claim this, I am signing this object:

@erronjason
erronjason / gist:ae9c95eb2ea455513734
Last active August 29, 2015 14:07
Check site for SSLv3
# This is a bash one-liner, where example.com is the site to test against for the currently vulnerable SSLv3 (CVE-2014-3566)
# Requires nmap to be installed.
nmap --script ssl-enum-ciphers -p 443 example.com | grep -A 1 SSLv3: | if grep -q "No supported ciphers found"; then echo -e "\e[32mSecure\e[39m"; else echo -e "\e[31m\e[1mVulnerable\e[39m\e[0m"; fi
#Check for cPanel
if [[ -d "/scripts" ]];then
echo "cpanel detected"
echo "Update cPanel? [y|n]"
read CPAN
if [ `echo $CPAN | egrep '(y|yes)'` ]; then
/scripts/upcp --force
fi
else
echo "No cPanel detected!"
@erronjason
erronjason / README.md
Last active August 15, 2016 13:08
Re-attach to same tmux session for terminals

Gnome-terminal:

/bin/bash -c "TERM=screen-256color-bce tmux attach -t main || TERM=screen-256color-bce tmux new -s main;"

iTerm2:

/bin/bash -c "TERM=screen-256color-bce /usr/local/bin/tmux attach -t main || TERM=screen-256color-bce /usr/local/bin/tmux new -s main;"

As of 9/15/2016, my iterm uses bash -l tmux attach -t base || tmux new -s base.

@erronjason
erronjason / AutoResponder.js
Created December 15, 2015 18:40
Gmail auto-responder for use in https://script.google.com
function AutoResponder(e) {
// Our email account that will be recieving:
var email_account = "testemail@gmail.com";
// Search for subject:
var subject = "testsubject";
// Send our response email
var threads = GmailApp.search("subject:(" + subject + ") label:unread to:(" + email_account + ")");
for (var i = 0; i < threads.length; i++) {
"schedule":[
{
"date":"1450645200",
"message":"We'll stream this night!"
},
{
"firstName":"1450731600",
"lastName":"Perhaps we'll stream this night!"
},
{
@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
)
@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 / 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