Skip to content

Instantly share code, notes, and snippets.

View nodesocket's full-sized avatar

Justin Keller nodesocket

View GitHub Profile
@nodesocket
nodesocket / mysql-create-user
Created June 19, 2019 19:36
MySQL create user and assign permissions to database
export MYSQL_USER=""
export MYSQL_PASSWORD=""
export DATABASE=""
CREATE USER '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD';
GRANT ALL PRIVILEGES ON $DATABASE . * TO '$MYSQL_USER'@'%';
FLUSH PRIVILEGES;
@nodesocket
nodesocket / gist:e01820d4402a800b6ead7f66c1a48635
Created June 20, 2018 22:12
Generate self-signed SSL for localhost
openssl req -x509 -out localhost.crt -keyout localhost.key \
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
MacBook-Pro ➜ ~ ping -i .5 35.184.130.5
PING 35.184.130.5 (35.184.130.5): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
@nodesocket
nodesocket / example.sh
Created July 18, 2017 04:13
Get e-mail provider for a domain
# get mx records for a domain
iMac ➜ ~ host -t MX elasticbyte.net
elasticbyte.net mail is handled by 1 aspmx.l.google.com.
elasticbyte.net mail is handled by 10 aspmx2.googlemail.com.
elasticbyte.net mail is handled by 10 aspmx3.googlemail.com.
elasticbyte.net mail is handled by 5 alt1.aspmx.l.google.com.
elasticbyte.net mail is handled by 5 alt2.aspmx.l.google.com.
# lookup ip of the first mx record
iMac ➜ ~ dig +short aspmx.l.google.com
@nodesocket
nodesocket / main.tf
Created June 14, 2017 03:15 — forked from artburkart/main.tf
aws_security_group test thing
provider "aws" {
region = "us-east-1"
}
variable "cidr" {
# default = "0.0.0.0/0"
default = ""
}
resource "aws_security_group" "dummy" {
wget https://git.io/vpnsetup -O vpnsetup.sh && sudo \
VPN_IPSEC_PSK='your_ipsec_pre_shared_key' \
VPN_USER='your_vpn_username' \
VPN_PASSWORD='your_vpn_password' sh vpnsetup.sh
/*!
* jQuery JavaScript Library v1.12.3 -css,-css/addGetHookIf,-css/adjustCSS,-css/curCSS,-css/defaultDisplay,-css/hiddenVisibleSelectors,-css/showHide,-css/support,-css/var/cssExpand,-css/var/isHidden,-css/var/rmargin,-css/var/rnumnonpx,-css/var/swap,-effects,-effects/Tween,-effects/animatedSelector,-effects/support,-dimensions,-offset,-deprecated,-event,-event/ajax,-event/alias,-event/support,-event/focusin,-event/trigger,-wrap,-core/ready,-exports/amd
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
@nodesocket
nodesocket / go-install.md
Last active February 10, 2016 18:58
Install go on OSX

What is my shell?

echo "$SHELL"
```

**If your shell is ZSH**

````shell
brew install go --cross-compile-common
OPBEAT_APP_IDS=('e56ec269d6' '29bb1bb075' '5e6e36c7ef' '374e78ad7a')
for i in "${OPBEAT_APP_IDS[@]}"
do
curl https://opbeat.com/api/v1/organizations/OUR-ORG-ID-HERE/apps/"$i"/releases/ \
-H "Authorization: Bearer OUR-SECRET-TOKEN-HERE" \
-d rev=`git log -n 1 --pretty=format:%H` \
-d branch=`git rev-parse --abbrev-ref HEAD` \
-d machine=`hostname`
-d status=machine-completed
@nodesocket
nodesocket / gist:6ac8ea0c768638ab9f58
Created May 31, 2015 02:24
Globally install io.js on Raspberry Pi (Raspbian)
cd ~
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
nvm install iojs
nvm use iojs
n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local