Skip to content

Instantly share code, notes, and snippets.

View squatto's full-sized avatar
🤓
Geeking out

Scott Carpenter squatto

🤓
Geeking out
View GitHub Profile
@squatto
squatto / certificate_renewal.py
Last active August 15, 2018 13:53
Webfaction letsencrypt automatic certificate renewal and installation
#!/usr/local/bin/python
from os import chdir, environ, getcwd, listdir, stat
from sys import exit, argv
from subprocess import Popen, PIPE
from xmlrpclib import ServerProxy, Fault
@squatto
squatto / AboutPageTypeSeeder.php
Created February 21, 2018 18:37
PageTypeSeeder and an implementation
<?php namespace Freemotion\FreemotionTheme\Database\Seeder;
class AboutPageTypeSeeder extends PageTypeSeeder
{
protected $slug = 'about';
protected $name = 'About Freemotion Page';
protected $description = 'About Freemotion page type';
@squatto
squatto / AboutPageSeeder.php
Created February 21, 2018 18:39
PageSeeder and an implementation
<?php namespace Freemotion\FreemotionTheme\Database\Seeder;
class AboutPageSeeder extends PageSeeder
{
protected $type = 'about';
protected $title = 'About Freemotion Fitness';
protected $slug = 'about';
protected $enabled = true;
protected $content = '';
@squatto
squatto / gist:de61da7f446faf74d1b38c51fd0a389e
Created May 28, 2018 19:13 — forked from sybarite/gist:2994745
Sendmail setup with mailtrap.io

Steps to setup mailtrap.io with your sendmail in ubuntu

Install sendmail and mailutils in ubuntu 'apt-get install sendmail mailutils'

In the terminal go into root prompt with sudo -s

Go to the /etc/mail folder

@squatto
squatto / download_all_branches.sh
Created June 10, 2018 16:31 — forked from doulmi/download_all_branches.sh
Download All branches
#!/bin/bash
set -x #echo on
remote_url=$(git config --get remote.origin.url)
for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match '(:?HEAD|master)$'); do
branch_name=$(echo $branch| cut -d'/' -f 3)
git clone -b $branch_name $remote_url $branch_name
done
@squatto
squatto / Purge Old Reminders.scpt
Created August 20, 2018 03:19 — forked from drdrang/Purge Old Reminders.scpt
AppleScript to delete all reminders more than 30 days old.
set remindersOpen to application "Reminders" is running
set monthAgo to (current date) - (30 * days)
tell application "Reminders"
set myLists to name of every list
repeat with thisList in myLists
tell list thisList
delete (every reminder whose completion date is less than monthAgo)
end tell
end repeat
@squatto
squatto / dark-slack
Last active September 25, 2018 20:06
Add code to Slack to make it use a dark theme, then kill and re-open Slack. Only adds the code if it isn't there already.
#!/bin/bash
# make Slack use a dark theme css next time it loads
SCRIPT="
//DARKSLACK
document.addEventListener('DOMContentLoaded', function() {
\$.ajax({
url: 'https://cdn.rawgit.com/laCour/slack-night-mode/master/css/raw/black.css',
success: function(css) {
@squatto
squatto / Homestead.yaml
Created October 24, 2018 21:07
Airtime local Homestead.yaml
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
@squatto
squatto / readme.md
Created February 12, 2019 21:57 — forked from nickcernis/readme.md
Exclude node_modules from Backblaze backups on Mac

Exclude node_modules from Backblaze backups on Mac

  1. Edit the file at /Library/Backblaze.bzpkg/bzdata/bzexcluderules_editable.xml.
  2. Add this rule inside the bzexclusions tag:
<!-- Exclude node_modules. -->
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />

Notes

@squatto
squatto / readme.md
Created February 13, 2019 00:14 — forked from jb510/readme.md
Exclude vcs (git, svn, hg) and node_modules from Backblaze backups on Mac

Backblaze's bztransmit process loads a file called bzfileids.dat into RAM. This file is a list of all files Backblaze has previously uploaded, including a unique identifier for each file. On most systems, this files is under 100MB in size (paraphrased from Backblaze support rep Zack).

Mine had grown to 6GB. This means that anytime bztransmit runs, it will load this 6GB file into RAM while it is backing up. In doing so it was purging massive ammounts of memory causing behavior like Chrome (usign 10GB of memory on it's own) to hang/beachball for 30 seconds and then refresh all it's windows.

There is no way to alter this behavior once it's begun, aside from starting over with some files excluded. The index needs to be rebuilt from scratch without the excessibe file count, that also means you can't restart and "inherit" a previous backup.

In my case the biggest culprits were .git and node_modules, so I excluded those, started a new backup (transfered licnese) and spent a week hunting for fast internet I could