Skip to content

Instantly share code, notes, and snippets.

View yorch's full-sized avatar

Jorge Barnaby yorch

  • SentinelOne
  • Miami, FL
View GitHub Profile
@Pierstoval
Pierstoval / confirm.Makefile
Last active March 7, 2024 09:34
"confirm" action for your Makefile
# To use the "confirm" target inside another target,
# use the " if $(MAKE) -s confirm ; " syntax.
mycommand:
@if $(MAKE) -s confirm ; then \
execute_your_command_here ; \
fi
.PHONY: mycommand
# The CI environment variable can be set to a non-empty string,
@natcl
natcl / docker-compose.yaml
Last active February 1, 2024 15:02
traefik: node-red + mosquitto using letsencrypt
version: "3.3"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
command:
- "--api=true"
- "--api.dashboard=true"
@kuczmama
kuczmama / id_to_uuid.rake
Last active July 24, 2022 22:06
Migrate a rails project to use uuids
# Inspired by http://www.madebyloren.com/posts/migrating-to-uuids-as-primary-keys
task id_to_uuid: :environment do
puts "[START] Convert id to uuid"
ActiveRecord::Base.connection.enable_extension 'uuid-ossp' unless ActiveRecord::Base.connection.extensions.include? 'uuid-ossp'
ActiveRecord::Base.connection.enable_extension 'pgcrypto' unless ActiveRecord::Base.connection.extensions.include? 'pgcrypto'
table_names = ActiveRecord::Base.connection.tables - ["schema_migrations", "ar_internal_metadata", "migration_validators"]
table_names.each do |table_name|
puts "[CREATE] uuid column for #{table_name}"
@angelamancini
angelamancini / quiver-to-evernote.rb
Created May 20, 2017 16:14
Converts Quiver notebook exports to Evernote *.enex files. Only tested with text and code cells. This *was not tested* with any other cell types.
# Before running this script, go to Quiver and export all notebooks into json/quiver format
# Place them in a folder called `exports` in the same directory as this script.
# In terminal, run `ruby quiver-to-evernote.rb`
# Check for presence of required gems.
# If not present, install the gems
["rubygems", "sanitize"].each do |gem|
begin
gem "#{gem}"
rescue Gem::LoadError
`gem install #{gem}`
@justjanne
justjanne / Price Breakdown.md
Last active April 11, 2024 22:21 — forked from kylemanna/price.txt
Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Permalink: git.io/vps

$5/mo

Provider Type RAM Cores Storage Transfer Network Price
@eko
eko / renamer.go
Created July 30, 2016 09:45
Photo renamer in Golang based on EXIF format
package main
import (
"flag"
"fmt"
"github.com/rwcarlsen/goexif/exif"
"os"
"path"
"path/filepath"
"strings"
@vasanthk
vasanthk / System Design.md
Last active April 24, 2024 00:42
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@dmann
dmann / vpn_fix.sh
Last active August 29, 2015 14:21
#!/usr/bin/env bash
if [ -z $1 ]; then
docker_machine_count=`docker-machine ls -q | wc -l | sed 's/ //g'`
if [ $docker_machine_count == "1" ]; then
machine=`docker-machine ls -q`
elif [ $docker_machine_count == "0" ]; then
echo 'No docker machines were found with the following command:'
echo ' docker-machine ls -q'
exit
else
@kennwhite
kennwhite / vpn_psk_bingo.md
Last active February 24, 2024 12:19
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016