Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Keller nodesocket

View GitHub Profile
@nodesocket
nodesocket / mysql-create-user
Created Jun 19, 2019
MySQL create user and assign permissions to database
View mysql-create-user
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 Jun 20, 2018
Generate self-signed SSL for localhost
View gist:e01820d4402a800b6ead7f66c1a48635
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")
View gist:b5d459aedf31947a85ffa4e91093d236
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 Jul 18, 2017
Get e-mail provider for a domain
View example.sh
# 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 Jun 14, 2017 — forked from artburkart/main.tf
aws_security_group test thing
View main.tf
provider "aws" {
region = "us-east-1"
}
variable "cidr" {
# default = "0.0.0.0/0"
default = ""
}
resource "aws_security_group" "dummy" {
View vpnsetup.sh
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
View jquery-only-ajax.js
/*!
* 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 Feb 10, 2016
Install go on OSX
View go-install.md

What is my shell?

echo "$SHELL"
```

**If your shell is ZSH**

````shell
brew install go --cross-compile-common
View gist:a91942bcdd50a5eebde4
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
Globally install io.js on Raspberry Pi (Raspbian)
View gist:6ac8ea0c768638ab9f58
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