Skip to content

Instantly share code, notes, and snippets.

@jacobrose
jacobrose / vaibhav-verma.chef-deploy-crib-sheet.2016-06-09
Created March 4, 2025 17:53
A crib-sheet of the chef deploy commands written up by Vaibhav Verma in Confluence
# If knife-spork and knife-flip aren't installed, you can run
/opt/chef/embedded/bin/gem install knife-spork knife-flip
#make our changes locally to the cookbook
knife spork check apache
# this will ask you if you want to bump the version of apache, and you say yes
knife spork upload apache
# this will put the new version of apache on the chef server, but nothing will get deployed yet.
knife node flip $(hostname) testing
@jacobrose
jacobrose / FINPAY-775.deduplicate_finpay_data.sql
Last active February 4, 2025 17:37
Inserting duplicate rows into a backup table in preparation for deletion
CREATE TABLE `etsy-data-warehouse-dev.finpay.adyen_settlement_detail_backup_2025_02_04`
CLONE `etsy-data-warehouse-dev.finpay.adyen_settlement_detail`;
ALTER TABLE `etsy-data-warehouse-dev.finpay.adyen_settlement_detail_backup_2025_02_04`
SET OPTIONS (
expiration_timestamp = TIMESTAMP '2025-03-05 18:00:00'
);
CREATE TABLE `etsy-data-warehouse-dev.finpay.adyen_settlement_detail_deduplication_2025_02_04`
LIKE `etsy-data-warehouse-dev.finpay.adyen_settlement_detail`;
INSERT INTO `etsy-data-warehouse-dev.finpay.adyen_settlement_detail_deduplication_2025_02_04` (
10014, 91008, 90210, 92067, 93108, 94024, 10065, 07926, 92661, 21056, 81654, 11976, 11932, 10075, 91302, 10013, 89125, 81611, 10577, 92657, 94528, 10012, 94010, 94920, 11765, 10007, 10021, 10003, 95030, 94957, 33109, 10010, 94062, 94028, 90265, 90077, 10024, 92091, 93953, 90402, 94022, 11930, 02807, 11975, 94610, 94022, 11568, 10023, 92662, 94920, 98039, 90272, 92651, 07976, 90049, 11545, 85253, 10011, 60043, 94970, 92625, 10022, 29941, 94024, 11965, 10580, 10282, 94301, 10001, 93066, 11024, 94904, 08738, 11968, 06830, 91108, 90266, 94611, 81615, 92118, 07931, 07458, 10528, 81657, 92014, 94507, 96821, 29482, 06820, 95070, 93460, 11978, 92663, 06878, 95030, 92037, 06840, 11560, 90274, 81632, 06853, 10533, 11963, 93921, 02481, 07078, 92603, 11960, 08750, 11724, 07632, 91302, 11030, 10009, 22066, 02493, 93923, 90401, 33921, 94123, 10597, 06870, 92660, 90067, 06831, 10069, 06880, 19085, 93067, 91011, 94574, 10506, 90069, 94946, 90212, 90027, 11569, 94010, 19035, 07417, 94939, 11964, 94506, 94515, 10504, 60093, 10
@jacobrose
jacobrose / .bash_profile
Created November 1, 2017 15:02
Help Docker for Mac play nice on your computer, with 'renice'
# docker -- set hyperkit priority to 10 so it doesn't eat the CPU
alias dockerpri='echo -n "docker priority currently: "; ps alx | grep .app/Contents/MacOS/com.docker.hyperkit | grep -v grep | sed "s: *[0-9]* *[0-9]* *[0-9]* *[0-9]* *[0-9]* *\([0-9]*\) .*:\1:"'
alias dockernice='sudo renice 10 $(ps ax | grep .app/Contents/MacOS/com.docker.hyperkit | grep -v grep | sed "s: *\([0-9]*\) .*:\1:"); echo -n "dockerpri: "; dockerpri'
@jacobrose
jacobrose / gist:44da297adecef0bb3a75
Last active March 10, 2016 15:36
Boosted geonames/distance query centered at Rhinelander, Wis.
{
"fields": [
"location"
],
"query": {
"function_score": {
"functions": [
{
"exp": {
"location": {