Skip to content

Instantly share code, notes, and snippets.

@doArcanjo
doArcanjo / save-sqs-queue.py
Last active June 27, 2024 13:34 — forked from fabiob/save-sqs-queue.py
Saves all messages from an AWS SQS queue into a folder
# https://gist.github.com/1b4dfa82be2d0251fd13bf319fcb4a49.git
#!/usr/bin/env python3
import argparse
import boto3
import json
import os
from datetime import datetime
@doArcanjo
doArcanjo / script.sh
Created January 7, 2020 14:22 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@doArcanjo
doArcanjo / Makefile
Created December 30, 2019 16:09 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@doArcanjo
doArcanjo / BigInt.jq
Created August 17, 2019 15:27 — forked from pkoppstein/BigInt.jq
BigInt library of functions for jq
# Copyright (c) 2014-2015 Peter Koppstein (pkoppstein at gmail dot com) 2015.05.02
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
@doArcanjo
doArcanjo / nodejs.md
Created June 27, 2019 18:14 — forked from joshenders/nodejs.md
How to patch the NodeJS binary to write perfdata to a path other than /tmp

Background

The current verison of NodeJS hardcodes the path where perf data is written when the --perf-basic-prof flag is used.

https://github.com/v8/v8/blob/061c2ab23a1d4cd192b935e7912e7dfb1fed845d/src/log.cc#L236

At Pinterest, /tmp has limited capacity and so we weren't able to utilize perf data to troubleshoot NodeJS without filling the disk and crashing the running system.

How to patch

First I'll copy the system node binary to my local directory so this set of actions isn't destructive to the running system:

@doArcanjo
doArcanjo / Unicode table
Created August 8, 2018 20:33 — forked from ivandrofly/Unicode table
Unicode table - List of most common Unicode characters *
Unicode table - List of most common Unicode characters *
* This summary list contains about 2000 characters for most common ocidental/latin languages and most printable symbols but not chinese, japanese, arab, archaic and some unprintable.
Contains character codes in HEX (hexadecimal), decimal number, name/description and corresponding printable symbol.
What is Unicode?
Unicode is a standard created to define letters of all languages ​​and characters such as punctuation and technical symbols. Today, UNICODE (UTF-8) is the most used character set encoding (used by almost 70% of websites, in 2013). The second most used character set is ISO-8859-1 (about 20% of websites), but this old encoding format is being replaced by Unicode.
How to identify the Unicode number for a character?
Type or paste a character:
@doArcanjo
doArcanjo / lista-de-nacionalidade.txt
Created April 19, 2018 16:33 — forked from antonioj-mattos/lista-de-nacionalidade.txt
Lista de países em português com suas respectivas nacionalidades
Afeganistão - Afegã
África do Sul - Sul-africana
Albânia - Albanês
Alemanha - Alemã
Andorra - Andorrana
Angola - Angolana
Anguilla - Anguilana
Antárctida -
Antígua e Barbuda - Antiguana
Antilhas Holandesas - Antilhana
@doArcanjo
doArcanjo / ExcelResult.cs
Created April 4, 2018 16:33 — forked from aprilyush/ExcelResult.cs
ExcelExporter.Mvc – A simple ActionResult for returning Excel files from ASP.Net MVC actions using ExcelExporter
using System;
using System.Collections.Generic;
using System.IO;
using System.Web.Mvc;
namespace ExcelExporter.Mvc {
///<summary>An ActionResult that sends an Excel spreadsheet to the client.</summary>
public class ExcelResult : FilePathResult {
static readonly Dictionary<ExcelFormat, string> ContentTypes = new Dictionary<ExcelFormat, string> {
{ ExcelFormat.Excel2003, "application/vnd.ms-excel" },
@doArcanjo
doArcanjo / npm-list-globally.md
Created November 22, 2017 08:29 — forked from brenopolanski/npm-list-globally.md
Listing globally installed NPM packages and version
npm list -g --depth=0