Skip to content

Instantly share code, notes, and snippets.

View danieltdt's full-sized avatar
👋
Hi!

Daniel danieltdt

👋
Hi!
View GitHub Profile
@danieltdt
danieltdt / joystick.conf
Created April 5, 2020 14:52
ArchLinux gamepad kernel modules
# at /etc/modules-load.d/joystick.conf
# Read more at
# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/input/joydev/joystick.rst
# https://wiki.archlinux.org/index.php/Gamepad#Joystick_input_systems
# Enable joystick drivers interface
joydev
# Enable gameport joysticks
ns558
@danieltdt
danieltdt / docker-services.sh
Created April 23, 2018 03:05
my local services
# mysql/mariadb
docker run --restart unless-stopped --name mysql -d -v /home/daniel/.local/mysql-data:/var/lib/mysql -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes bianjp/mariadb-alpine
# postgres
docker run --restart unless-stopped --name postgres -d -v /home/daniel/.local/postgres-data:/var/lib/postgresql/data -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres:alpine
# redis
docker run --restart unless-stopped --name redis -d -v /home/daniel/.local/redis-data:/data -p 6379:6379 redis:alpine
@danieltdt
danieltdt / requirements.txt
Created May 18, 2016 00:09
updated requirements for cuckoo 2.0-rc1
alembic==0.8.0
beautifulsoup4==4.4.1
cffi==1.6.0
chardet==2.3.0
cryptography==1.3.2
Django==1.8.4
dpkt==1.8.6.2
ecdsa==0.13
enum34==1.0.4
Flask==0.10.1
@danieltdt
danieltdt / Makefile
Created March 31, 2016 18:28
Makefile padrão para documentos tex
DOC=csi-ficcao-realidade
TEX=latex # or xelatex
all: clean tex
clean:
rm -f *.{aux,bbl,blg,brf,dvi,idx,ilg,ind,lof,log,lot,pdf,toc}
tex:
$(TEX) $(DOC).tex
;(function (global) { 'use strict';
window.load = function () { setPreferred(getCookie()); };
window.onunload = function () { setCookie(getPreferred()); };
function setPreferred(style) {
eachAlternative(function (link, title) {
link.disabled = (title !== style);
});
}
@danieltdt
danieltdt / dotenv
Created October 27, 2014 15:19
load .env before executing anything
set -e
set -o pipefail
root=$(cd $(dirname $0); cd ..; pwd)
PATH=$PATH:$root/node_modules/.bin
NODE_PATH=${NODE_PATH:-$root}
if [[ -f $root/.env ]]; then
while read -r dotenv_var; do
@danieltdt
danieltdt / redis-monitor.js
Last active August 29, 2015 14:07
test helper for redis
'use strict';
var util = require('util');
var assert = require('assert');
var bluebird = require('bluebird');
var EventEmitter = require('events').EventEmitter;
module.exports = RedisMonitor;
function RedisMonitor(url) {
#!/bin/bash
# Example: "h dev logs -t" runs "heroku logs -t -r dev"
args=$@
heroku $2 -r ${args/$2/}
@danieltdt
danieltdt / install.sh
Created June 2, 2013 08:51
Install UnQLite as a shared library on Linux (tested on ubuntu 12.04).
#!/usr/bin/env bash
# Before executing it, you must download UnQLite source code (http://www.unqlite.org/downloads.html)
# unzip all the files and execute this script inside the unzipped folder. For example:
# mkdir /tmp/unqlite; cd /tmp/unqlite; unzip ~/Downloads/unqlite-db-116.zip
gcc -Wall -fPIC -c *.c
gcc -shared -Wl,-soname,libunqlite.so.1 -o libunqlite.so.1.0 *.o
sudo cp `pwd`/libunqlite.so.1.0 /usr/local/lib/
sudo cp `pwd`/unqlite.h /usr/local/include/
sudo ln -sf /usr/local/lib/libunqlite.so.1.0 /usr/local/lib/libunqlite.so.1