This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph SimplestDiagrams { | |
Zoo1 | |
"Zoo1" -> "Cat" | |
"Zoo1" -> "Dog" | |
Zoo2 | |
"Zoo2" -> "Cat" | |
"Zoo2" -> "Crow" | |
Zoo3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'json' | |
require 'rexml/document' | |
include REXML | |
def fix_exshell_json(filename, url) | |
json_file = JSON.parse File.read(filename) | |
json_file['developmentUrl'] = url | |
File.open(filename, 'w') { |file| file.puts(json_file.to_json) } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk '{printf "%s\\n", $0}' file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install These Tools: | |
https://github.com/pyenv/pyenv | |
https://github.com/pyenv/pyenv-virtualenv | |
Then in .zshrc add: | |
eval "$(pyenv init -)" | |
eval "$(pyenv virtualenv-init -)" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# usage: getcert.sh remote.host.name [port] | |
# eg) getcert.sh api.mailgun.net | |
# | |
RHOST=$1 | |
RPORT=${2:-443} | |
# see cert | |
echo -n | openssl s_client -connect ${RHOST}:${RPORT} | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#ifconfig en0 | grep 'inet ' | awk '{print $2}' | |
ipconfig getifaddr en0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install postgres | |
sudo apt update | |
sudo apt install postgresql postgresql-contrib libpq-dev | |
# login as postgres user | |
sudo -i -u postgres | |
# log into psql shell | |
psql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get database info | |
heroku config:get DATABASE_URL -a app_name | |
# dump command | |
pg_dump --column-inserts --no-acl --no-owner -h host_name -U postgres_user -t table_name --data-only db_name > output_filename.dump |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
security find-identity -v -p codesigning |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# -A doesn't print out newlines and entire file will be on a single line. | |
openssl base64 -A -in ./input_file -out ./output_file |