Skip to content

Instantly share code, notes, and snippets.


Stephen Solka trashhalo

View GitHub Profile
nrocco /
Last active Jul 12, 2021
Alpine Playground with libvirt

First download alpine-make-vm-image from

wget \
    && echo '5fb3270e0d665e51b908e1755b40e9c9156917c0  alpine-make-vm-image' | sha1sum -c \
    || exit 1
mv alpine-make-vm-image /usr/local/bin/
chmod +x /usr/local/bin/alpine-make-vm-image

Create a new alpine qcow2 image

rufo / .vimrc
Created Jun 2, 2017
Change vim settings settings based on power status
View .vimrc
" requires vim 8 for timer support
function! UpdatePowerSaving(timerId)
if executable('pmset')
call system("pmset -g batt | head -1 | grep 'Battery'")
if !v:shell_error
" on battery
let g:ale_lint_delay=10000
" power adapter
ipbastola /
Last active Sep 22, 2021
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64


Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
askn / query_planner.markdown
Created May 4, 2016 — forked from hgmnz/query_planner.markdown
PostgreSQL query plan and SQL performance notes
View query_planner.markdown

Types of index scans


Sequential Scan:

  • Read every row in the table
  • No reading of index. Reading from indexes is also expensive.
bcardiff /
Created Feb 18, 2016
mtry macro for crystal
# sample of a macro that flood the method calls with `#try`
# as a POC it does not support methods with arguments
macro mtry(expr)
{% if expr.is_a?(Call) %}
{% else %}
{% end %}
irvingpop / sane_defaults.rb
Created Oct 31, 2015
Vagrant: Irving's sane defaults for Virtualbox with better performance
View sane_defaults.rb
# replaces this file /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/virtualbox/action/sane_defaults.rb
# NOTE: if using a different Vagrant version, adjust the version field accordingly
# NOTE2: only the sections with the IRVING comment have been changed from the default
require "log4r"
module VagrantPlugins
module ProviderVirtualBox
module Action
class SaneDefaults
scottjacobsen / git+clone+ssh+agent+forward+sudo
Created Dec 14, 2012
Git clone using ssh agent forwarding and sudo
View git+clone+ssh+agent+forward+sudo
SSH agent forwarding is great. It allows you to ssh from one server to
another all the while using the ssh-agent running on your local
workstation. The benefit is you don't need to generate ssh key pairs
on the servers you are connecting to in order to hop around.
When you ssh to a remote machine the remote machine talks to your
local ssh-agent through the socket referenced by the SSH_AUTH_SOCK
environment variable.
So you the remote server you can do something like:
Mithrandir0x / gist:3639232
Created Sep 5, 2012
Difference between Service, Factory and Provider in AngularJS
View gist:3639232
// Source:!topic/angular/hVrkvaHGOfc
// jsFiddle:
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
schacon / gist:942899
Created Apr 26, 2011
delete all remote branches that have already been merged into master
View gist:942899
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete