Skip to content

Instantly share code, notes, and snippets.

View danielkza's full-sized avatar

Daniel Miranda danielkza

  • Vonage
  • London, United Kingdom
View GitHub Profile
#!/bin/bash
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
export WINEPREFIX="/home/danielkza/.PlayOnLinux//wineprefix/lol2"
export WINEDEBUG="-all"
LOL_DIR="$HOME/Games/League of Legends"
BEFORE_WINE='env LD_PRELOAD=libpthread.so.0:libGL.so.1 __GL_THREADED_OPTIMIZATIONS=1'
@danielkza
danielkza / ignore-ms-fonts.css
Created June 25, 2015 03:58
Ignore Microsoft Fonts
@namespace url("http://www.w3.org/1999/xhtml");
@font-face { font-family: 'Andale Mono'; src: local('monospace'); }
@font-face { font-family: 'Arial'; src: local('sans-serif'); }
@font-face { font-family: 'Arial Black'; src: local('sans-serif'); }
@font-face { font-family: 'Calibri'; src: local('serif'); }
@font-face { font-family: 'Cambria'; src: local('serif'); }
@font-face { font-family: 'Candara'; src: local('sans-serif'); }
@font-face { font-family: 'Comic Sans MS'; src: local('sans-serif'); }
@font-face { font-family: 'Consolas'; src: local('monospace'); }
@danielkza
danielkza / .gitignore
Created November 15, 2015 01:04
gitignore for home
*
!.gitignore
!/.bash*
!/.zsh/
!/.zsh/*
!/.env*
!/.aliases*
!/.profile*
@danielkza
danielkza / download_ego_top.py
Created June 15, 2016 23:21
extensions.gnome.org crawler - downloads extensions available, ordered by popularity. Usage: ./download_ego_top.py dest_dir max_num shell_version. Requires wget and GNU parallel installed.
#!/bin/env python3
import os
import sys
import urllib.request
import json
import subprocess
EXTENSION_BASE_URL = 'https://extensions.gnome.org'
EXTENSION_QUERY_URL_FORMAT = EXTENSION_BASE_URL + '/extension-query/?sort=popularity&page={page}'
--- !ruby/object:Gem::Specification
name: kalibro_client
version: !ruby/object:Gem::Version
version: 4.0.0
platform: ruby
authors:
- Daniel Quadros Miranda
- Diego de Araújo Martinez Camarinha
- Heitor Reis Ribeiro
- Rafael Reggiani Manzo
$ PROFILE_NUM_RUNS=3 command time -v ruby performance/tests/aggregation.rb
warning: parser/current is loading parser/ruby22, which recognizes
warning: 2.2.x-compliant syntax, but you are running 2.3.0.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
Profiling Performance::Aggregation
Setup: start
Created 1023 ModuleResults and 4096 MetricResults
Setup: finish
Run 1: start
Run 1: finish
@danielkza
danielkza / lambda.py
Last active October 19, 2016 20:45
Stacker hook for uploading lambda functions
import os
import os.path
import fnmatch
import stat
import logging
import hashlib
from StringIO import StringIO
from zipfile import ZipFile, ZIP_DEFLATED
import boto3
@danielkza
danielkza / ipsec
Created November 29, 2016 13:54
Strongswan IPSec init script with UCI support
#!/bin/sh /etc/rc.common
START=90
STOP=10
NAME=ipsec-uci
USE_PROCD=1
IPSEC_BIN=/usr/sbin/ipsec
IPSEC_SECRETS=/var/run/ipsec/ipsec.secrets
@danielkza
danielkza / reddit-update-filters.py
Created December 3, 2016 19:18
Python3 script to synchronize Reddit /r/all filters from a list file
#!/bin/env python3
# Copyright (c) 2016, Daniel Miranda <[email protected]>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
(require '[clojure.java.io :as io]
'[clojure.tools.logging :refer [infof]]
'[riemann.common :refer [encode decode-inputstream]]
'[riemann.config :refer [service!]]
'[riemann.service :refer [thread-service]]
'[riemann.time :refer [unix-time]])
(import '[java.io.File FileOutputStream])
(defn index-save
[file index]