Skip to content

Instantly share code, notes, and snippets.

View emailrhoads's full-sized avatar

John Rhoads emailrhoads

View GitHub Profile
@emailrhoads
emailrhoads / remove_old_cluster_entirely.sh
Created April 29, 2020 21:19
[Fully remove old version] #postgres
sudo apt purge postgresql-12
@emailrhoads
emailrhoads / Investigate SSL issues.md
Last active June 1, 2020 19:11
[Fix SSL issues] #linux
  1. Confirm some SSL cert is busted
domain_name = "fmsso.fanniemae.com"
uri = URI::HTTPS.build(host: domain_name)
response = Net::HTTP.start(uri.host, uri.port, { 
  :use_ssl => true, 
  # :verify_mode => OpenSSL::SSL::VERIFY_NONE,
})
cert = response.peer_cert
@emailrhoads
emailrhoads / row_counts.sql
Created June 2, 2020 21:43
[Row count for all tables] #postgres
SELECT
nspname AS schemaname,relname,reltuples
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE
nspname NOT IN ('pg_catalog', 'information_schema') AND
relkind='r'
ORDER BY reltuples DESC;
@emailrhoads
emailrhoads / symlink_em_all.sh
Last active June 7, 2022 19:51
[symlink all dl scripts] #linux
@emailrhoads
emailrhoads / Pry but for python.md
Created June 29, 2020 17:51
Python's binding.pry #python

import code; code.interact(local=dict(globals(), **locals()))

@emailrhoads
emailrhoads / create_release_tag.sh
Last active December 15, 2021 11:28
[New Release Tag] #git
#!/bin/bash
# IN CMIT/CRAPE
TAG_LABEL=`date "+%Y%m%d.%H%M"`
git checkout master
git pull
git tag -a $TAG_LABEL -m "latest"
git push origin $TAG_LABEL
git checkout master
@emailrhoads
emailrhoads / set_timezone psql
Last active July 2, 2020 15:50
[SET Timezone] #postgres
ALTER DATABASE pegasus_development SET TIMEZONE='America/Los_Angeles';
@emailrhoads
emailrhoads / set_java_version.sh
Created July 10, 2020 19:30
[Set java version] #linux
sudo update-alternatives --config java
@emailrhoads
emailrhoads / array_of_hashes_to_csv.rb
Last active June 6, 2022 18:40
[Ruby array of hash to csv] #ruby
CSV.open("data.csv", "w", headers: array_of_hashes.first.keys) do |csv|
array_of_hashes.each do |h|
csv << h.values
end
end
@emailrhoads
emailrhoads / fix_it.txt
Created August 19, 2020 17:27
[VirtualBox internet issues] #virtualbox
was having the same problem on Ubuntu 12.10 64bit using Virtualbox 4.2.22. Here are the steps I took to solve my problem:
Open Virtualbox Manager
Select the machine you cannot get internet on in the left pane
Click the Settings button in the top menu
Click Network in the left pane in the settings window
Switched to Bridged Adapter in the Attached to drop-down menu
Select the name of the network adapter you are currently using on your host machine. I am using wireless so I chose eth0 which is my wireless network adapter. You can check which adapter you are currently using by opening the terminal (CTRL+ALT+T by default) and running ifconfig. It will probably be the eth adapter that shows an inet addr and shows data transfer next to RX bytes.
Under Advanced, make sure the machine is using the Desktop Adapter Type
Under Advanced, make sure Promiscuous Mode is set to Allow VMs