Skip to content

Instantly share code, notes, and snippets.

View alphaJohnny's full-sized avatar

Alpha Johnny alphaJohnny

  • Startups
  • Toronto, Canada
View GitHub Profile
@alphaJohnny
alphaJohnny / ka_fw.sh
Created June 15, 2019 12:18
Firewall rules to allow only KhanAcademy, FreeCodeCamp, Google services and login and Github
#!/bin/bash
# Khanacademy
iptables -A OUTPUT -p tcp -d khanacademy.org -j ACCEPT
iptables -A OUTPUT -p tcp -d qualaroo.com -j ACCEPT
iptables -A OUTPUT -p tcp -d kastatic.org -j ACCEPT
iptables -A OUTPUT -p tcp -d kasandbox.org -j ACCEPT
iptables -A OUTPUT -p tcp -d s3.amazonaws.com -j ACCEPT
iptables -A OUTPUT -p tcp -d youtube-nocookie.com -j ACCEPT
# Freecodecamp
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed
brew install findutils
#Resume Phrase Matcher code
#importing all required libraries
import PyPDF2
import os
from os import listdir
from os.path import isfile, join
from io import StringIO
#!/bin/bash
#Usage: ./mysql-dump-from-rds-command-creator.bat > dump_commands.bat
#Usage2: ./dump_commands.bat
#Expects databases.txt newline delimited list of all databases
#Goal: Export MySQL data from AWS using SSH
#Step1: Create a databases.txt file with one line per database. Can be done by piping out "show databases" command
SSHUSER=ubuntu
SSHSERVER=server.com
@alphaJohnny
alphaJohnny / MySQLDump AWS RDS to Local
Last active October 12, 2017 22:06
MySQLDump AWS RDS to Local using compression
#!/bin/bash
#Export MySQL data from AWS using SSH
#Create a databases.txt file with one line per database. Can be done by piping out "show databases" command
#TODO fix the gzip error; till then use mysql-dump-from-rds-command-creator
SSH-USER=ubuntu
SSH-SERVER=123.123.123.123
SSH-KEYFILE=server.pem
DB-SERVER=mysql.czpoly.1.east.amazonaws.com
DB-USER=admin
DB-PASS=admin
@alphaJohnny
alphaJohnny / installOpenVbx.sh
Last active July 16, 2017 03:59 — forked from DmitryMiroshnichenko/installOpenVbx.sh
A simple install script to setup OpenVbx on a Debian with random passwords
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
apt-get -y update
apt-get -y upgrade
apt-get -y install apache2 php5 libapache2-mod-php5 php5-mysql php5-curl git mysql-server git pwgen libapache2-mod-auth-mysql
@alphaJohnny
alphaJohnny / install.sh
Created July 15, 2017 19:05 — forked from jamiecollinson/install.sh
Installing OpenVBX on Ubuntu 14.04 EC2 instance
# check for updates
sudo apt-get update
sudo apt-get upgrade
# install necessary software
sudo apt-get install mysql-server apache2 php5 libapache2-mod-php5 php5-mysql libapache2-mod-auth-mysql php5-curl git sendmail
# create DB
echo "CREATE DATABASE OpenVBX; GRANT ALL PRIVILEGES ON OpenVBX.* TO ubuntu@localhost IDENTIFIED BY {PASSWORD_HERE}; FLUSH PRIVILEGES" | sudo mysql -p