Skip to content

Instantly share code, notes, and snippets.

View utzig's full-sized avatar

Fabio Utzig utzig

  • Brazil
View GitHub Profile
#!/bin/bash
URL="http://www.revistabula.com/647-100-livros-classicos-para-download/"
wget ${URL}
lines=$(grep "http://www\.dominiopublico" index.html)
echo "$lines" | while read line; do
obra=$(echo "$line" | sed 's/^.*co_obra=\([^\"]*\).*$/\1/g')
titulo=$(echo "$line" | sed 's/.*>\(.*\) <\/a>.*$/\1/g')
#!/bin/bash
URL="http://www.revistabula.com/647-100-livros-classicos-para-download/"
wget ${URL}
lines=$(grep "http://www\.dominiopublico" index.html)
echo "$lines" | while read line; do
obra=$(echo "$line" | sed 's/^.*co_obra=\([^\"]*\).*$/\1/g')
titulo=$(echo "$line" | sed 's/.*>\(.*\) <\/a>.*$/\1/g')
@utzig
utzig / gist:3e73cd655fb53ed8ff99
Created August 29, 2014 13:14
ChibiOS/RT Kinetis I2C driver preview
/**
* @file KINETIS/i2c_lld.c
* @brief KINETIS I2C subsystem low level driver source.
*
* @addtogroup I2C
* @{
*/
#include "osal.h"
#include "hal.h"
@utzig
utzig / gist:f5aad9e3de2d735c10ac
Created November 23, 2014 18:46
Algorithms: Design and Analysis - Programming Exercise 5 (Dijkstra)
#!/usr/bin/env ruby
require 'priority_queue'
class Edge
attr_accessor :vertex, :distance
def initialize(vertex, distance)
@vertex, @distance = vertex, distance
end
@utzig
utzig / DiskDescriptor.xml
Created December 10, 2014 16:18
Parallels 8 - Arch Linux
<?xml version='1.0' encoding='UTF-8'?>
<Parallels_disk_image Version="1.0">
<Disk_Parameters>
<Disk_size>1465149168</Disk_size>
<Cylinders>1453521</Cylinders>
<Heads>16</Heads>
<Sectors>63</Sectors>
<Padding>0</Padding>
<Encryption>
<Engine>{00000000-0000-0000-0000-000000000000}</Engine>
@utzig
utzig / gist:4d6f5b9c6b131d65ee28
Created January 11, 2015 09:41
Linker file for MCHCK with DFU bootloader
ENTRY(Reset_Handler)
MEMORY
{
flash : org = 0x00000c00, len = 128k - 0xc00
ram : org = 0x1FFFE000, len = 16k
}
__ram_start__ = ORIGIN(ram);
__ram_size__ = LENGTH(ram);
@utzig
utzig / gist:b2c1463f65f33085d5e2
Created January 11, 2015 09:45
Linker file for MCHCK with DFU bootloader
ENTRY(Reset_Handler)
MEMORY
{
flash : org = 0x00000c00, len = 128k - 0xc00
ram : org = 0x1FFFE000, len = 16k
}
__ram_start__ = ORIGIN(ram);
__ram_size__ = LENGTH(ram);
@utzig
utzig / gist:a21c3e9b07a50946fe1a
Created February 2, 2015 13:05
FizzBuzz yay!
#!/usr/bin/env python
def fizzbuzz(n):
if n % 15 == 0:
print("FizzBuzz")
elif n % 3 == 0:
print("Fizz")
elif n % 5 == 0:
print("Buzz")
else:
@utzig
utzig / keybase.md
Created April 2, 2015 00:57
keybase.md

Keybase proof

I hereby claim:

  • I am utzig on github.
  • I am utzig (https://keybase.io/utzig) on keybase.
  • I have a public key whose fingerprint is 3373 5035 8EC3 3C2D E7E9 F8FA 8830 6970 9DA6 A9CF

To claim this, I am signing this object:

@utzig
utzig / gist:9c02f4507632d19c7bfd
Created May 16, 2015 00:17
ChibiOS/RT nRF51822
*** ChibiOS/RT test suite
***
*** Kernel: 3.0.0p3
*** Compiled: May 15 2015 - 20:57:05
*** Compiler: GCC 4.8.4 20140725 (release) [ARM/embedded-4_8-branch revision 213147]
*** Architecture: ARMv6-M
*** Core Variant: Cortex-M0
*** Port Info: Preemption through NMI
*** Platform: Nordic Semiconductor nRF51822
*** Test Board: WvShare BLE400