Skip to content

Instantly share code, notes, and snippets.

View jonasmalacofilho's full-sized avatar

Jonas Malaco jonasmalacofilho

View GitHub Profile
@jonasmalacofilho
jonasmalacofilho / NeedlemanWunsch.hx
Last active April 29, 2023 13:32
Adapted Needleman-Wunsch algorithm for general array alignment implemented in Haxe (3).
/**
Adapted Needleman-Wunsch algorithm for general array alignment
If NeedlemanWunsch is used as entry point the unit tests are executed
Copyright (c) 2013, Jonas Malaco Filho
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
@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
*/

Some tips on GnuPG

1. Basics

First, some definitions:

  • key: ID, partial name, email
  • <keyId>: key ID prefixed by 0x
@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;
}
@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 / MS Office 2010 on Ubuntu 13.10.md
Last active September 27, 2023 13:26
Guide for installing MS Office 2010 on Ubuntu 13.10 (using Wine)

Installing Microsoft Office 2010 on Ubuntu 13.10/14.04

Results

Word works. Excel works.(1) PowerPoint works.

Access and Outlook were not tested.

@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 / Mini2.hx
Created April 15, 2014 11:36
Neko client for neko ThreadRemotingServer example
import haxe.remoting.Context;
import haxe.remoting.HttpConnection;
import haxe.remoting.SocketConnection;
import haxe.remoting.SocketProtocol;
import neko.vm.Thread;
import sys.net.Host;
import sys.net.Socket;
import Sys.println;
class Mini2 {
@jonasmalacofilho
jonasmalacofilho / safesign.md
Created July 1, 2014 22:12
Instalando o SafeSign Crypto USB Token no Firefox/Linux

Instalando o SafeSign Crypto USB Token no Firefox/Linux

Hardware: Giesecke & Devrient SafeSign Crypto USB Token

Sistema operacional: Ubuntu 14.04 LTS AMD 64

  1. Dependências: libccid, pcscd e libpcsclite1. Adicionalmente, é interessante instalar o pacote pcsc-tools e executar pcsc_scan para verificar a visibilidade do token.