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 / 0my_weechat.md
Last active September 28, 2019 20:58
Logging my weechat configuration before losing it by the 10th time.

WeeChat through Docker

Docker setup

Creating a docker image created from the Docker file attached:

sudo docker build --tag=weechatcontainer .

Running in Docker attached to a screen:

@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 / SlowIntro2TensorFlow.ipynb
Last active May 16, 2019 02:08
A slow introduction to TensorFlow
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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:

Keybase proof

I hereby claim:

  • I am thmosqueiro on github.
  • I am thmosqueiro (https://keybase.io/thmosqueiro) on keybase.
  • I have a public key ASBkLAlSDFGMqYp3FCbOLsH9r6SPyhYSWwslaQl6fuIVGQo

To claim this, I am signing this object:

@thmosqueiro
thmosqueiro / Estimating_TriangleProb.py
Created October 6, 2017 05:54
Probability of forming a triangle
import numpy as np
Nsamples = 10000
p_estimate = 0.
s_estimate = 0.
for j in range(Nsamples):
ps = np.random.random(2)
x = min(ps)
@thmosqueiro
thmosqueiro / Example_Multiprocessing_ODEsolving.ipynb
Created September 21, 2017 21:23
Example of using multiprocessing to solve in parallel a system of ODEs using different conditions
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def convert( image, theta0 = 0. ):
numChannels = image.shape[2]
numPixelX = image.shape[0]
numPixelY = image.shape[1]
newImage = np.zeros( (numPixelX, numPixelY, 3) )
normSum = np.zeros( (3) )
@thmosqueiro
thmosqueiro / RegressionAsymmetricLossFunction.py
Created April 26, 2017 21:19
Regression with asymmetric loss function
import numpy as np
import pylab as pl
from lmfit import minimize, Parameters
# Creating some data with some strong random factor
x = np.linspace(0, 10, 50)
y = (x-3)**2 + np.random.rand( 50 )*5
# Defining residuals using an asymmetric loss function
def residual(params, x, data, eps_data):
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] )