Skip to content

Instantly share code, notes, and snippets.

View jflaflamme's full-sized avatar

Jeff Laflamme jflaflamme

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jflaflamme on github.
  • I am theflame (https://keybase.io/theflame) on keybase.
  • I have a public key whose fingerprint is ACA7 5F3B 6C78 24E0 9665 9F8C 8706 E570 1BB2 A7D4

To claim this, I am signing this object:

@jflaflamme
jflaflamme / postgresql_import.sh
Created June 15, 2017 09:23
Import a dump into a docker postgresql instance (interactive -i)
docker exec -i postgres9 psql -U postgres < backup.sql
@jflaflamme
jflaflamme / postgresql_export.sh
Created June 15, 2017 09:24
dump a postgresql backup from a running docker container
docker exec -it postgres9 pg_dump -Upostgres > backup.sql
@jflaflamme
jflaflamme / gist:2a1ffc372cab37bb7fc38f4b7a573581
Created June 15, 2017 09:33
create postgresql database in running docker container
docker exec postgres9 psql -U postgres -c 'create database <database name>;'
@jflaflamme
jflaflamme / getEC2_iprange.sh
Last active September 5, 2017 04:01
Get AWS IP ranges (like EC2) (requires jq utility)
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json| \
jq '.prefixes[] | select(.region == "ap-southeast-1")| select(.service == "EC2").ip_prefix'
@jflaflamme
jflaflamme / functions.php
Created November 28, 2017 09:29
wordpress use get_canonical_url to help a domain transition when both domains are active (SEO)
/* Use get_canonical_url to help a domain transition when both domains are active (SEO) and avoiding penality
* apply this on old domain and specify new domain
* Jeff Laflamme <jeff@geekho.asia>
*/
add_filter( 'get_canonical_url', 'geekho_get_canonical_url' );
function geekho_get_canonical_url( $canonical_url ) {
return preg_replace('/oldsite\.com/','newsite.com', $canonical_url);
}
@jflaflamme
jflaflamme / whoisfix.sh
Created November 8, 2018 02:17
Because when we CTRL+L & CTRL+C in Chrome to get an URL/domain to use Whois, we need to strip the http or https:// at the beginning.Override normal whois to accept http and https, strip that and pass it to normal whois function.
whois(){ /usr/bin/whois `echo $1|awk -F[/:] '{print $4}'` }
@jflaflamme
jflaflamme / whoisfix.sh
Created November 8, 2018 02:17
Because when we CTRL+L & CTRL+C in Chrome to get an URL/domain to use Whois, we need to strip the http or https:// at the beginning.Override normal whois to accept http and https, strip that and pass it to normal whois function.
whois(){ /usr/bin/whois `echo $1|awk -F[/:] '{print $4}'` }
@jflaflamme
jflaflamme / whoisfix.sh
Created November 8, 2018 02:17
Because when we CTRL+L & CTRL+C in Chrome to get an URL/domain to use Whois, we need to strip the http or https:// at the beginning.Override normal whois to accept http and https, strip that and pass it to normal whois function.
whois(){ /usr/bin/whois `echo $1|awk -F[/:] '{print $4}'` }
@jflaflamme
jflaflamme / whoisfix.sh
Created November 8, 2018 02:17
Because when we CTRL+L & CTRL+C in Chrome to get an URL/domain to use Whois, we need to strip the http or https:// at the beginning.Override normal whois to accept http and https, strip that and pass it to normal whois function.
whois(){ /usr/bin/whois `echo $1|awk -F[/:] '{print $4}'` }