Skip to content

Instantly share code, notes, and snippets.

View rodolfobandeira's full-sized avatar

Rodolfo rodolfobandeira

View GitHub Profile
@rodolfobandeira
rodolfobandeira / puma_rc.d.sh
Created April 13, 2018 01:00 — forked from katafrakt/puma_rc.d.sh
simple and stupid Arch Linux rc.d script for starting and stopping puma (http://puma.io) with certain rails app
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
. /etc/profile
DAEMON=prozatorium
PIDFILE=/path/to/pidfile
app_path=/path/to/rails_app
config=config/puma.rb
class Hash
def nested_each_pair
self.each_pair do |k,v|
if v.is_a?(Hash)
v.nested_each_pair {|k,v| yield k,v}
else
yield(k,v)
end
end
@rodolfobandeira
rodolfobandeira / hash_to_breadcrumb.rb
Created March 5, 2018 20:01 — forked from dbrady/hash_to_breadcrumb.rb
hash_to_breadcrumb - turn a hash containing items, arrays, or nested hashes into a flattened list of "breadcrumbs" -- e.g. the path through the hash to get to the last value in the list.
# hash_to_breadcrumbs
#
# hash_to_breadcrumb - turn a hash containing items, arrays, or nested hashes
# into a flattened list of "breadcrumbs" -- e.g. the path through the hash to
# get to the last value in the list.
hash = {
a: 1,
b: [2, 3, 4],
c: {
@rodolfobandeira
rodolfobandeira / authfp-power.c
Last active January 31, 2018 04:21
AuthenTec fingerprint sensor SPI bus driver (android_kernel_samsung_coriplus/drivers/spi/authfp-power.c)
/*
* Driver for AuthenTec fingerprint sensor
*
* Copyright (C) 2011 AuthenTec, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
@rodolfobandeira
rodolfobandeira / openbsd.md
Created January 19, 2018 22:49
OpenBSD ASCII
      _____                 ____   _____ _____   
     / ___ \               |  _ \ / ____|  __ \  
    / /  / /___  ___  ____ | |_) | (___ | |  | | 
   / /  / / __ \/ _ \/ __ \|  _ < \___ \| |  | | 
  / /__/ / /_/ /  __/ / / /| |_) |____) | |__| | 
  \_____/ .___/\___/_/ /_/ |____/|_____/|_____/  
       /_/                                       
              |    .            The proactively secure Unix-like
 . |L /| . Operating System.
@rodolfobandeira
rodolfobandeira / django_install.md
Last active December 21, 2017 03:00
Install Django on Ubuntu

pip install virtualenv

cd ~

virtualenv newenv

cd newenv

source newenv/bin/activate

Compiling PHP 7.0.4 on Ubuntu


sudo apt-get install autoconf

sudo autoconf

sudo chown -R rbandeira:rbandeira .

Domain /dev/pci0:
0:0:0: Intel 82441FX
0x0000: Vendor ID: 8086 Product ID: 1237
0x0004: Command: 0103 Status: 0000
0x0008: Class: 06 Subclass: 00 Interface: 00 Revision: 02
0x000c: BIST: 00 Header Type: 00 Latency Timer: 00 Cache Line Size: 00
0x0010: BAR empty (00000000)
0x0014: BAR empty (00000000)
0x0018: BAR empty (00000000)
0x001c: BAR empty (00000000)
@rodolfobandeira
rodolfobandeira / rtwn.c
Created December 1, 2017 13:28
Source Code - rtwn.c on OpenBSD - Effort to add RTL8192SE driver
/* $OpenBSD: rtwn.c,v 1.36 2017/10/26 15:00:28 mpi Exp $ */
/*-
* Copyright (c) 2010 Damien Bergamini <[email protected]>
* Copyright (c) 2015 Stefan Sperling <[email protected]>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
openbsd_pledge_test_ioctl: file format elf64-x86-64
Disassembly of section .init:
0000000000000350 <__init>:
350: 48 83 ec 08 sub $0x8,%rsp
354: e8 07 01 00 00 callq 460 <__register_frame_info+0x10>
359: 48 83 c4 08 add $0x8,%rsp
35d: c3 retq