Skip to content

Instantly share code, notes, and snippets.

View andrerocker's full-sized avatar
🤓
Clojure / SRE

Andre Souza andrerocker

🤓
Clojure / SRE
View GitHub Profile
@brodock
brodock / logrotate_rails_application
Last active August 29, 2015 14:04
Silver Bullet Nginx Vhost Recipe for Rails application with HTTPS + Webp + Capistrano + Linux FHS
# This file should be placed at /etc/logrotate.d/
/srv/*/shared/log/*.log {
daily
missingok
dateext
rotate 30 # amount of days to keep compressed logs (you should backup it up externally)
compress
delaycompress
notifempty
@salizzar
salizzar / gist:e63ca53de0d63e433779
Last active August 29, 2015 14:06
Processing CSV files more fast with Fibers + EM.defer
require 'bundler/setup'
require 'fiber'
require 'csv'
require 'pp'
require 'eventmachine'
def a_slow_api_call(row)
sleep 0.3
row.collect(&:to_i).inject(&:+)
@salizzar
salizzar / Manual de sobrevivência para fechar um aluguel em pouquíssimo tempo.markdown
Last active June 13, 2019 18:35
Um guia de dicas para fechar aluguel e organizar mudança em tempo recorde

Manual de sobrevivência para fechar um aluguel em pouquíssimo tempo

Bem, se tu estás lendo este guia provavelmente estás numa situação delicada. Separação, ordem de despejo, o que for; tens pouquíssimos dias para arranjar um lugar para morar. Baseado na minha experiência, resolvi montar este guia com dicas para auxiliar nesta procura e fechar um aluguel, bem como todos os preparativos para a mudança.

Primeiro de tudo, você terá de desenvolver algumas habilidades pessoais ESSENCIAIS tais como:

  • organização
  • boa apresentação
  • persuasão
  • assertividade
@alopresto
alopresto / gpg_git_signing.md
Last active January 18, 2024 22:42
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@kaleksandrov
kaleksandrov / global-protect.sh
Last active April 19, 2024 03:46
Simple script that starts and stops GlobalProtect.app on Mac OSX.
#!/bin/bash
case $# in
0)
echo "Usage: $0 {start|stop}"
exit 1
;;
1)
case $1 in
start)
@nathan-osman
nathan-osman / win32.go
Last active May 14, 2024 14:18
Simple Windows GUI application written in Go
package main
import (
"log"
"syscall"
"unsafe"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")
@maikell
maikell / kickstart-centos7-usb.md
Created October 13, 2016 05:14
Kickstart driven CentOS 7 install from USB

Kickstart driven CentOS 7 install from USB

None of what is written below is particularly original, however, I was unable to find a method documented on the internet at the time of writing that successfully created a kickstart driven CentOS 7 USB installer.

My interest was in doing this manually as I require this USB (image) to be created from a script. Therefore, I did not look into using ISO to USB applications - in addition, these typically do not allow custom kickstart files to be used.

References

Much of the process described below was found on the CentOS Wiki page on Installing from USB key, and from the Softpanorama page on the same subject. I thoroughly recommend reading all of the latter as it highlights the shortcomings/dangers associated with the steps below.

USB key preparation

@ipbastola
ipbastola / jq to filter by value.md
Last active April 25, 2024 17:14
JQ to filter JSON by value

JQ to filter JSON by value

Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'

Example: To get json record having _id equal 611

cat my.json | jq -c '.[] | select( ._id | contains(611))'

Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)

@antoniomo
antoniomo / s2distance.go
Last active March 4, 2023 15:13
Distance calculation on databases using S2 Geometry in Golang (POC)
package main
import (
"fmt"
"github.com/golang/geo/s1"
"github.com/golang/geo/s2"
)
// https://blog.nobugware.com/post/2016/geo_db_s2_geohash_database/