Skip to content

Instantly share code, notes, and snippets.

@jacoelho
jacoelho / .md
Last active April 30, 2021 20:51
spf13-vim + vim-go
  1. Install spf13-vim
sh <(curl https://j.mp/spf13-vim3 -L)
  1. Install Go bundle
echo "export PATH=\$PATH:\$(go env GOPATH)/bin" >> ~/.bashrc
@jacoelho
jacoelho / vim.sh
Last active March 5, 2017 15:26 — forked from akolosov/gist:cedaac86b333a4ced95f
vim8 with lua+GUI on Ubuntu 14.04
#!/bin/sh
sudo apt-get remove -y --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get install -y --no-install-recommends \
liblua5.1-dev \
luajit \
libluajit-5.1 \
python-dev \
ruby-dev \
libperl-dev \
@jacoelho
jacoelho / photography.py
Created January 12, 2017 13:32
photography challenge 2017
from isoweek import Week
from ics import Calendar, Event
c = Calendar()
weeks = [ Week(2017,w) for w in range(1,53)]
objectives = [
"The rule of thirds is the first compositional rule most photographers learn; but most don't know why they learn it. The rule of thirds is amazing for telling a story. Tell a story using rule of thirds.",
"Straight out of the Camera. No Photoshop. Shoot a compelling image and post it without edits. No cheating! (Be sure and save the image file for the end of the challenge!)",
"Your inspiration this week is land. This could be a landscape, or an image inspired by the land in some way.",
@jacoelho
jacoelho / cmd.sh
Created December 28, 2016 07:50
create windows bootable usb in mac
diskutil list
diskutil partitionDisk /dev/diskN MBR FAT32 DISKNAME 100%
# copy files
diskutil unmountDisk /dev/diskN
sudo fdisk -e /dev/diskN
print
@jacoelho
jacoelho / version.rb
Created December 12, 2016 15:29
self cookbook version
def cookbook_version
metadata = Chef::Cookbook::Metadata.new
metadata.from_json ::File.read ::File.join ::File.dirname(__dir__),
"metadata.json"
metadata.version
end
vm.dirty_background_ratio = 5
vm.dirty_ratio = 80
vm.swappiness = 1
@jacoelho
jacoelho / x-request-start.tcl
Created October 3, 2016 20:03
irule f5 X-Request-Start
when HTTP_REQUEST {
HTTP::header insert X-Request-Start [clock clicks -milliseconds]
}
@jacoelho
jacoelho / .kitchen.yml
Created September 22, 2016 15:09
kitchen multi node
suites:
- name: node1
run_list:
- recipe[app_vault::default]
attributes:
app_vault:
node2: <%= '"' + YAML::load_file('.kitchen/node2-rhel-7.yml')['hostname'] + '"' %>
node3: <%= '"' + YAML::load_file('.kitchen/node3-rhel-7.yml')['hostname'] + '"' %>
- name: node2
run_list:
@jacoelho
jacoelho / app.service
Created August 22, 2016 17:58
node systemd
[Unit]
Description=GPS node
After=network.target
[Service]
User=appuser
Group=appgroup
WorkingDirectory=/var/www/
ExecStart=/usr/bin/node index.js
ExecReload=/bin/kill -HUP $MAINPID
func fetchWeather(location string) string {
time.Sleep(time.Duration(rand.Intn(10)) * time.Second)
return "sunny"
}
func fallbackWeather() string {
return "raining"
}
func main() {