Skip to content

Instantly share code, notes, and snippets.

Avatar
☢️
Quarantine

Héctor A. h3ct0r

☢️
Quarantine
View GitHub Profile
@h3ct0r
h3ct0r / COPPELIA_4.1.0_UBUNTU_16.04.md
Created Mar 22, 2021
How to Install CoppeliaSim 4.1.0 in Ubuntu 16.04 with ROS Bridge and the Velodyne plugin
View COPPELIA_4.1.0_UBUNTU_16.04.md

How to Install CoppeliaSim 4.1.0 in Ubuntu 16.04 with ROS Bridge and the Velodyne plugin

Install Tutorial Coppeliasim - Espeleo Simulation

@h3ct0r
h3ct0r / .block
Created Jun 5, 2019 — forked from mapio/.block
Force-based label placement (d3.v5.js)
View .block
license: gpl-3.0
height: 600
@h3ct0r
h3ct0r / hold_current_kernel_ubuntu_16.04.sh
Created Jun 4, 2019
Mark the kernel as hold so its never updated. Useful for cases where a kernel upgrade breaks your cuda/nvidia/etc environment.
View hold_current_kernel_ubuntu_16.04.sh
echo linux-image-generic hold | sudo dpkg --set-selections
dpkg -l linux-image-generic
echo linux-headers-generic hold | sudo dpkg --set-selections
dpkg -l linux-headers-generic
sudo apt update
apt-mark showhold
@h3ct0r
h3ct0r / python_keyboard_release.py
Created Feb 27, 2019
Python keyboard bindings with "key release"
View python_keyboard_release.py
#!/usr/bin/env python
import sys, select, termios, tty
def getKey():
tty.setraw(sys.stdin.fileno())
rfds, wfds, efds = select.select([sys.stdin], [], [], 0.3)
print(rfds, wfds, efds)
if len(rfds) > 0 or len(wfds) > 0 or len(efds) > 0:
key = sys.stdin.read(1)
@h3ct0r
h3ct0r / spotify_keybindings
Created Jun 29, 2018 — forked from jbonney/spotify_keybindings
Spotify - Linux key bindings. From XFCE / Ubuntu keyboard shortcuts configuration, assign the control command to their key. http://shkspr.mobi/blog/2011/12/linux-spotify-keybindings/
View spotify_keybindings
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious
@h3ct0r
h3ct0r / test_bad_nodes_network.py
Last active Feb 24, 2018
Check for 'bad' or 'slow' nodes on paths using a metric for every path. Python + networkx.
View test_bad_nodes_network.py
import networkx as nx
import matplotlib.pyplot as plt
import random
import numpy as np
def outliers_modified_z_score(ys):
threshold = 1.5
median_y = np.median(ys)
View python_node_link_counter.py
@h3ct0r
h3ct0r / recall_precision_ap.py
Created Nov 22, 2017
Calculate recall and precision of a hit/miss query
View recall_precision_ap.py
def calc_precision(rel):
"""
return the precision from a series of hit or miss data
"""
p = []
hit = 0
for i in xrange(len(rel)):
if rel[i] > 0:
hit += 1
@h3ct0r
h3ct0r / license-badges.md
Created Sep 8, 2017 — forked from lukas-h/license-badges.md
License Badges for your Project
View license-badges.md

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • Badges are made with Shields.io.
  • This badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.  
  • 🇫🇷 Cette liste en français
@h3ct0r
h3ct0r / outlier_mad.py
Last active Jul 28, 2017
Test if a number is an outlier from a 1D list python using Median Absolute Deviation (MAD)
View outlier_mad.py
import numpy as np
import math
def is_mad_based_outlier(points, compare_to, thresh=3.5):
if len(points.shape) == 1:
points = points[:,None]
median = np.median(points, axis=0)
diff = np.sum((points - median)**2, axis=-1)