Skip to content

Instantly share code, notes, and snippets.

View thmosqueiro's full-sized avatar
👾
I may be slow to respond.

Thiago Mosqueiro thmosqueiro

👾
I may be slow to respond.
View GitHub Profile
@thmosqueiro
thmosqueiro / gitlab-from-source+viewing-ipython-notebooks.md
Last active June 10, 2019 12:17
This is what I needed to complete Gitlab installation + jupyter notebook rendering

Gitlab from source + viewing ipython notebooks

This is what I needed to complete Gitlab installation by using @martijnvermaat's fork. Some guidelines are provided here. This is supposed to allow you to use a local installation of gitlab capable of rendering Ipython Notebooks. This was based on GitLab's documentation.

Pre-installation

cd
@thmosqueiro
thmosqueiro / Missing FTDI kernel module on nvidia jetson.md
Last active August 21, 2018 08:34
Missing FTDI kernel module on nvidia jetson

Quick view of the problem

I can see FTDI device plugged in:

user@nose:~$ lsusb 
Bus 002 Device 002: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC

But it won't mount as serial port:

@thmosqueiro
thmosqueiro / BinarySearch.py
Last active January 8, 2017 01:01
Animating the binary search using bars...
import numpy as np
from bisect import bisect_left
def binary_search( X, list_values ):
listVals = np.array( list_values )
nElem = listVals.shape[0]
listPos = []
import time
key = True
intrval = 0.050
for j in range(10000):
while key:
now = ( time.time() % 1 )
dif = intrval - now % intrval
import numpy as np
def smooth(x, window_len = 9, window = 'hanning', keepSameMax = False):
"""
Smoothing algorithm especially designed to smooth the instantaneous firing
rates calculated for Mushroom Bodies activity.
"""
if not window in ['flat', 'hanning', 'hamming', \
## Downloading image
wget http://cdimage.ubuntu.com/releases/12.04/release/ubuntu-12.04-preinstalled-server-armhf+omap4.img.gz
gzip -d ubuntu-12.04-preinstalled-server-armhf+omap4.img.gz
## Checking where the disk is mounted
diskutil list
## Assuming disk mounted on disk1
sudo diskutil unmountDisk disk1
## Writing image with dd
@thmosqueiro
thmosqueiro / Makefile
Created January 28, 2017 02:25
LaTeX makefile
#
# Simple Makefile for LaTeX projects
# Suggestions (pull requests) are welcome!!
#
#
# Simple example: suppose you want to compile the file paper.tex, then run
#
# make f=paper
#
# Remember to drop the file extension (.tex, .aux, etc).

Pwn2Win CTF 2016: Timekeeper's Lock

This is the challenge.

In order to protect their maximum security facilities, the Club employs an electronic security lock activated by a 256-bit key which changes every minute. When a Club member is authorized to enter some of these facilities, he receives this key in hexadecimal format, the same format which is used to enter the key in the electronic lock’s keyboard. The last year (in 2015),

@thmosqueiro
thmosqueiro / jitterExperiment.C
Last active February 15, 2017 05:03
Arduino jitter experiment
// Ping of the LED's positive leg
int ledPin=7;
int state = 0;
int count;
unsigned long previousMillis = 400L;
double timer;
unsigned long interval = 3L;
unsigned long delta;
import numpy as np
import pylab as pl
from polarError import polarError
f, ax = pl.subplots(1, 1, figsize=(4,1.8) )
bsize = 0.5
theta = np.array( [np.pi*5./4. - bsize, np.pi/2. - bsize, np.pi*7.5/4. - bsize, 0] )
data = np.array( [0.7, 0.3, 0.52, 0.8] )
edata = np.array( [0.2, 0.1, 0.5, 0.2] )