Skip to content

Instantly share code, notes, and snippets.

Avatar

Alpha Johnny alphaJohnny

  • Canada Startup Company
  • Toronto, Canada
View GitHub Profile
@alphaJohnny
alphaJohnny / ka_fw.sh
Created Jun 15, 2019
Firewall rules to allow only KhanAcademy, FreeCodeCamp, Google services and login and Github
View ka_fw.sh
#!/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
View homebrew-install-gnu.sh
# 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
View Resume Phrase Matcher code
#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
View mysql-dump-from-rds-command-creator.bat
#!/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 Oct 12, 2017
MySQLDump AWS RDS to Local using compression
View MySQLDump AWS RDS to Local
#!/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 Jul 16, 2017 — forked from DmitryMiroshnichenko/installOpenVbx.sh
A simple install script to setup OpenVbx on a Debian with random passwords
View installOpenVbx.sh
#!/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 Jul 15, 2017 — forked from jamiecollinson/install.sh
Installing OpenVBX on Ubuntu 14.04 EC2 instance
View install.sh
# 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