Skip to content

Instantly share code, notes, and snippets.

View zimmerle's full-sized avatar
☠️
Doing something cool :)

Felipe Zimmerle zimmerle

☠️
Doing something cool :)
View GitHub Profile
@mentlsve
mentlsve / scrooge-coin-main.java
Last active May 27, 2021 05:40
Coursera - Programming Assignment: Scrooge Coin - Simple Main Class
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import java.math.BigInteger;
import java.security.*;
public class Main {
public static void main(String[] args) throws NoSuchProviderException, NoSuchAlgorithmException, InvalidKeyException, SignatureException {
// Crypto setup
#!/bin/sh
# in case it's already installled
vagrant plugin uninstall vagrant-libvirt
# vagrant's copy of curl prevents the proper installation of ruby-libvirt
sudo mv /opt/vagrant/embedded/lib/libcurl.so{,.backup}
sudo mv /opt/vagrant/embedded/lib/libcurl.so.4{,.backup}
sudo mv /opt/vagrant/embedded/lib/libcurl.so.4.4.0{,.backup}
sudo mv /opt/vagrant/embedded/lib/pkgconfig/libcurl.pc{,.backup}
@defanator
defanator / nginx-memleaktest.sh
Last active November 9, 2016 19:31
nginx memory leaks monitoring
#!/bin/sh
nginxpidfile=/var/run/nginx.pid
if [ ! -e ${nginxpidfile} ]; then
echo "nginx pid file (${nginxpidfile}) not found" >&2
exit 1
fi
ppid=`cat ${nginxpidfile}`
@acdha
acdha / simple_cors_server.py
Last active May 3, 2024 22:08
Python 3: serve the current directory as HTTP while setting CORS headers for XHR debugging
#!/usr/bin/env python3
# encoding: utf-8
"""Use instead of `python3 -m http.server` when you need CORS"""
from http.server import HTTPServer, SimpleHTTPRequestHandler
class CORSRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header('Access-Control-Allow-Origin', '*')
@yackx
yackx / hello-boot.asm
Created December 10, 2014 10:56
Hello World bootloader in assembly language
;----------------------------------------------;
;
; A minimal bootloader that prints a hello world
; then halts.
;
; nasm -f bin hello-boot.asm -o hello-boot.bin
;
; @YouriAckx
;
;----------------------------------------------;
@christianroman
christianroman / training.sh
Last active October 26, 2021 06:04
Tesseract OCR training new font
#! /bin/bash
# build the environment
mkdir tessenv; cd tessenv
TROOT=`pwd`
mkdir $TROOT/stockfonts; mkdir $TROOT/build; mkdir $TROOT/build/eng
echo "Environment built"
# Get the stock english fonts from Google (old, but they work)
cd $TROOT/stockfonts
GET http://tesseract-ocr.googlecode.com/files/boxtiff-2.01.eng.tar.gz > boxtiff-2.01.eng.tar.gz
@Macil
Macil / local.usr.bin.skype
Last active January 31, 2017 06:14
Skype AppArmor profile(tested with Ubuntu 14.10 and Skype 4.3)
#include <tunables/global>
/usr/bin/skype {
#include <abstractions/base>
#include <abstractions/user-tmp>
#include <abstractions/audio>
#include <abstractions/nameservice>
#include <abstractions/ssl_certs>
#include <abstractions/fonts>
#include <abstractions/ibus>
#include <abstractions/dbus>