Skip to content

Instantly share code, notes, and snippets.

"schedule":[
{
"date":"1450645200",
"message":"We'll stream this night!"
},
{
"firstName":"1450731600",
"lastName":"Perhaps we'll stream this night!"
},
{
@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++) {
@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.

#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 / 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

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:

#!/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"