Skip to content

Instantly share code, notes, and snippets.

View emailrhoads's full-sized avatar

John Rhoads emailrhoads

View GitHub Profile
@emailrhoads
emailrhoads / which_ubuntu.sh
Last active March 12, 2020 15:49
[Check ubuntu release] #linux
lsb_release -a
@emailrhoads
emailrhoads / find_postgres_configs.md
Last active June 4, 2020 19:37
[Finding Running Postgres Versions] #postgres

List clusters

pg_lsclusters

Start Clusters

sudo pg_ctlcluster 9.6 main start
@emailrhoads
emailrhoads / connect_vscode_to_virtualbox
Last active March 12, 2020 15:48
[Connect VS Code to VirtualBox] #vscode
https://stackoverflow.com/questions/58880989/connecting-visual-studio-code-vscode-to-virtualbox-vm
shut off VM
Add new network adapter
add as host only
ifconfig
ssh john@ip
@emailrhoads
emailrhoads / git_filter_branch_for_file.sh
Last active March 12, 2020 15:48
Remove BAF from current branch #git
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch gisdata/tiger.dump" \
--prune-empty --tag-name-filter cat --
git push
@emailrhoads
emailrhoads / setup_git_hooks.md
Last active March 27, 2020 22:07
[Set git hooks ] for when you dont have CI/CD for some reason #git

cd to your directory (optional)

cd .git/hooks

create your pre-push hook

touch pre-push

open in an editor

code pre-push

example code

@emailrhoads
emailrhoads / squash_feature.sh
Created March 12, 2020 15:47
[Squash all commits on current feature branch] #git
git checkout feature_branch
git reset --soft master
git add -A && git commit -m "commit message goes here"
@emailrhoads
emailrhoads / fix_vscode_flock.md
Created March 13, 2020 13:51
[Fix repeated password prompts on vscode] #vscode #linux

from microsoft/vscode-remote-release#2518

look for line similar to

 \ln /home/#####/.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/vscode-remote-lock.#####.78a4c91400152c0f27ba4d363eb56d2835f9903a.target /home/#####/.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/vscode-remote-lock.#####.78a4c91400152c0f27ba4d363eb56d2835f9903a
[13:55:17.276] stderr> ln: failed to create hard link ‘/home/#####/.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/vscode-remote-lock.#####.78a4c91400152c0f27ba4d363eb56d2835f9903a’: File exists
[13:55:17.276] > Installation already in progress...

Then go delete the .target file

@emailrhoads
emailrhoads / scp_from_ec2_to_local.sh
Last active June 14, 2022 16:36
[Copy file from EC2 to local] #aws
# scp <user>@<ec2-ip>:<path/to/file/to/download.txt> <filepath/on/local.txt>
scp [email protected]:~/new_results.txt new_results.txt
scp [email protected]:/var/luna/user_data.tsv user_data.tsv
# to send to the EC2
scp new_results.txt [email protected]:~/new_results.txt
scp [email protected]:/var/crape/BulkLoans.20211001_20220124_results.tsv BulkLoans.20211001_20220124_results.tsv
@emailrhoads
emailrhoads / resotre_deleted_file.md
Last active March 25, 2020 14:59
[Restore deleted file] #git

get all the commits which have deleted files and the files deleted; git log --diff-filter=D --summary

to restore the deleted file. git checkout $commit~1 path/to/file.ext

where $commit is the value of the commit you've found at step 1, e.g. e4cf499627

@emailrhoads
emailrhoads / find_code_deploy_logs.md
Last active March 27, 2020 21:48
[Find code deploy logs] #aws

Navigate into CodeDeploy in AWS Console

in codedeploy you can see failed deployments and if you click that it shows the instance that fialed

Cd into the log dir on the instance

/opt/codedeploy-agent/deployment-root/07d22c05-8cb4-496c-bc7f-7a5b79efb167