Skip to content

Instantly share code, notes, and snippets.

View jonasmalacofilho's full-sized avatar

Jonas Malaco jonasmalacofilho

View GitHub Profile
@jonasmalacofilho
jonasmalacofilho / git-cheat-sheet.md
Last active August 28, 2015 04:36
Git cheat-sheet para o Frá

Um cheat-sheet do Git para o Frá

O básico

Vamos supor que eu criei um arquivo example_file.

O primeiro passo é ver o estado do repositório com git status:

$ git status
@jonasmalacofilho
jonasmalacofilho / Makefile
Created February 20, 2014 03:36
Create/update dictionary files for Sublime Text 2
# Create/update dictionary files for Sublime Text 2
# Execute somewhere like $HOME/.config/sublime-text-2/Packages/Languages Brazilian/
# `DICTPATH` defines the source for the dictionary files
# This Makefile expects them to be encoded in ISO8859-1
# Makefile based on https://github.com/SublimeText/Dictionaries
# Requires dos2unix
@jonasmalacofilho
jonasmalacofilho / psdash.conf
Created April 6, 2014 06:42
psdash upstart job
# psdash upstart script
# this job will start/stop psdash
description "start and stop the psdash daemon"
author "Jonas Malaco Filho"
start on runlevel [2345]
stop on runlevel [!2345]
#env PSDASH_AUTH_USERNAME=admin
#env PSDASH_AUTH_PASSWORD=admin
@jonasmalacofilho
jonasmalacofilho / Makefile
Created April 15, 2014 11:30
Install keepass from Debian/unstable on Ubuntu
# Assumes debian/unstable source repository on /etc/apt/sources.lists
# Assumes updated apt cache
deb:
fakeroot apt-get source --build keepass2
install:
sudo dpkg -i *.deb
rm *.deb
@jonasmalacofilho
jonasmalacofilho / speedtest_data.tsv
Created July 14, 2015 12:24
Vivo Fibra 200M speed log
We can't make this file beautiful and searchable because it's too large.
2014-12-17T14:22:06.562784 eth0 192.168.1.1 70:62:b8:25:6c:40 8.742 39671183.9133 11016456.4789 3971 http://www.speedtest.net/result/3992112917.png
2014-12-17T14:30:01.345693 eth0 192.168.1.1 70:62:b8:25:6c:40 12.08 42996923.9504 4892259.7027 4003 http://www.speedtest.net/result/3992132536.png
2014-12-17T14:40:01.807608 eth0 192.168.1.1 70:62:b8:25:6c:40 11.285 9797460.53802 5468312.74004 4003 http://www.speedtest.net/result/3992158163.png
2014-12-17T14:50:01.495551 eth0 192.168.1.1 70:62:b8:25:6c:40 8.742 43025701.9719 10473018.778 3971 http://www.speedtest.net/result/3992183070.png
2014-12-17T15:00:01.396479 eth0 192.168.1.1 70:62:b8:25:6c:40 8.345 42726284.1329 15028599.6054 4978 http://www.speedtest.net/result/3992208744.png
2014-12-17T15:10:01.990281 eth0 192.168.1.1 70:62:b8:25:6c:40 8.742 36634410.4463 10716613.0554 3971 http://www.speedtest.net/result/3992234613.png
2014-12-17T15:20:01.885111 eth0 192.168.1.1 70:62:b8:25:6c:40 8.663 14638218.0691 5922438.3267 4003 http://www.speedtest.net/result/39922
@jonasmalacofilho
jonasmalacofilho / TypesOfDays.hx
Created August 7, 2013 07:57
Quick and dirty day type by month calculator in Haxe.
/*
* Quick and dirty day type by month calculator in Haxe.
*
* Counts the number of weekdays, saturdays and sundays for each month
* of the suplied range.
*
* Copyright 2013, Jonas Malaco Filho.
* All rights reserved. Licensed under the BSD 2-clause license:
* http://opensource.org/licenses/BSD-2-Clause
*/
@jonasmalacofilho
jonasmalacofilho / DevRandom.hx
Created December 4, 2013 21:13
Diceware generator in Haxe
class DevRandom {
public static
function randomUInt( ?max:Null<Int> ) {
var rand = getStream().readInt32();
if ( rand < 0 )
rand = ~rand;
return max != null ? rand & (max-1) : rand;
}

Some tips on GnuPG

1. Basics

First, some definitions:

  • key: ID, partial name, email
  • <keyId>: key ID prefixed by 0x
@jonasmalacofilho
jonasmalacofilho / IntDict.hx
Last active July 17, 2017 16:48
Haxe-written IntHash code inspired by Python tables (aka artifact 887b53126e237d6c68951111d594033403889304)
package jonas.ds;
import haxe.Timer;
import jonas.RevIntIterator;
// imports for testing
import haxe.Log;
import jonas.unit.TestCase;
import jonas.unit.TestRunner;
@jonasmalacofilho
jonasmalacofilho / NZXT Smart Device: USB protocol.md
Last active September 7, 2018 02:57
NZXT Smart Device: USB protocol

The NZXT Smart Device

Mostly just data, all conclusions are only documented in the form of code: liquidctl.

vid=1e71
pid=1714
rev=0200