Skip to content

Instantly share code, notes, and snippets.

View b-ggs's full-sized avatar

boggs ⚓ b-ggs

View GitHub Profile

Rails 5.2 + Ubuntu Bionic + Passenger + Chruby + MySQL Production Deployment

Create and set up a new user

Create user deploy and add it to the sudoers

sudo adduser deploy
sudo adduser deploy sudo
@b-ggs
b-ggs / slack_history.py
Created May 11, 2018 02:12 — forked from Chandler/slack_history.py
Download Slack Channel/PrivateChannel/DirectMessage History
# MIT License
# Copyright (c) 2016 Chandler Abraham
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#!/usr/bin/env ruby
# gem install yt -v 0.28.0
# echo YOUTUBE_API_KEY > token.txt
require 'yt'
Yt.configure do |config|
config.api_key = File.read('token.txt').chomp
end
@b-ggs
b-ggs / stub.bash
Created February 20, 2018 07:09 — forked from jimeh/stub.bash
Shell script helpers to stub and restore bash shell functions/commands in tests.
# Stub commands printing it's name and arguments to STDOUT or STDERR.
stub() {
local cmd="$1"
if [ "$2" == "STDERR" ]; then local redirect=" 1>&2"; fi
if [[ "$(type "$cmd" | head -1)" == *"is a function" ]]; then
local source="$(type "$cmd" | tail -n +2)"
source="${source/$cmd/original_${cmd}}"
eval "$source"
fi
@b-ggs
b-ggs / killadobe.sh
Created February 13, 2018 04:58 — forked from CyberPunkCodes/killadobe.sh
Mac Bash script to kill Adobe Create Cloud and other processes that Adobe forces on us.
#!/bin/bash
echo "\n\n--- Killing Stupid Adobe Auto Load Crap ---\n\n"
launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
launchctl unload -w /Library/LaunchAgents/com.adobe.AAM.Updater-1.0.plist
echo "\n\n--- Done! ---\n\n"
names = [
"Pam Halpert-Beesly",
"Jim Halpert",
"Erin Hannon",
"Ryan Howard",
"Kelly Kapoor",
"Angela Martin",
"Oscar Martinez",
"Michael Scott",
"Dwight Schrute",
# APP-12809 - Data Science: Uncategorized Transactions Amount on P&L
# Description
# Pre-requisites:
#
# companies.status = active
# billing_infos.full_service = 1
# transactions.post_date = 1/1/17-12/31/17
# category = uncategorized
# company_infos.doing_test_mode = false
# Columns:
@b-ggs
b-ggs / gist:2061195738da4846558aafa5cf0207dd
Created January 7, 2018 17:08
restore mysql database from dump
https://stackoverflow.com/questions/105776/how-do-i-restore-a-dump-file-from-mysqldump
mysql -p -u [user] [database] < db_backup.dump
@b-ggs
b-ggs / gist:0094abec7dab4a5efaa122efc9749930
Created January 7, 2018 17:07
set mysql root password
use mysql;
update user set password=PASSWORD("password") where User='root';
flush privileges;
quit
token 5a1c5463268e0819d0f6f73b22fcd3f8de0c63b3