Skip to content

Instantly share code, notes, and snippets.

View cearls's full-sized avatar

Chris Earls cearls

View GitHub Profile
@cearls
cearls / ayu-mirage.sublime-theme
Last active October 14, 2022 09:52
Nord Sublime theme based on tweaked Ayu Mirage theme
[
{
"class": "title_bar",
"bg": "#2e3440",
"fg": "#cbccc6"
},
{
"class": "title_bar",
"settings": [
"ui_native_titlebar"
@cearls
cearls / replace-ssh-key.md
Created November 28, 2016 16:29 — forked from huyby/replace-ssh-key.md
Replace or delete ssh key in authorized_key files

Test for replacement

sed -n 's#ssh-rsa.*OLD_KEY_ID#NEW_KEY# p' .ssh/authorized_keys

Test for deleting

sed -n '#ssh-rsa.*KEY_ID# p' .ssh/authorized_keys

Do replacement in multiple authorized_key files (change maxdepth to your needs)

@cearls
cearls / fuelphp_capistrano.rb
Created July 6, 2012 22:13
FuelPHP Capistrano Example
load 'deploy'
set :application, "ashcraft"
set :domain, "XXX.XX.XX.XXX"
set :deploy_to, "/home/admin/public_html/ashcraft/www"
set :scm, :git
set :repository, "git@github.com:flex360/ashcraft.git"
set :branch, "master"
@cearls
cearls / webfaction_memory_usage
Created June 20, 2012 05:21
WebFaction: Get memory usage total
ps -u $USER -o rss,command | grep -v peruser | awk '{sum+=$1} END {print sum/1024}'
@cearls
cearls / cap_multio.rb
Created June 19, 2012 20:56
Capistrano recipe: WebFaction, Padrino, Bundler, DataMapper
set :application, "multio"
set :scm, :git
set :repository, "git@bitbucket.org:cearls/multio.git"
set :domain, "web310.webfaction.com"
set :user, "cearls"
set :scm_username, "cearls"
set :use_sudo, false
default_run_options[:pty] = true
set :ssh_options, {:forward_agent => true}
@cearls
cearls / rvm2rbenv.txt
Created June 9, 2012 17:00 — forked from brentertz/rvm2rbenv.txt
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@cearls
cearls / gist:1245316
Created September 27, 2011 15:10
Rackspace Cloud Site backup script
#!/bin/bash
export ACCOUNT_ROOT="account root"
export WEB_ROOT="${ACCOUNT_ROOT}/web/content"
export DB_HOST="db host"
export DB_USER="db user"
export DB_PASSWORD="db password"
export DB_NAME="db name"
echo "Rotating backups..."