Skip to content

Instantly share code, notes, and snippets.

View misterjoa's full-sized avatar
🤓

Joachim Kruithof misterjoa

🤓
View GitHub Profile
@misterjoa
misterjoa / DumbHandler.py
Last active October 5, 2018 08:03
Very simple python logging handler using print statements
from logging import Handler, getLevelName
import sys
class DumbHandler(Handler):
def __init__(self):
Handler.__init__(self)
def flush(self):
@misterjoa
misterjoa / get_repo_list.py
Last active October 5, 2018 12:06
Get repo list from github python API
#!/usr/bin/env python
"""
Get a github API token using your account
Then input the name of your org, don't forget '/' at the end.
"""
GH_TOKEN = "XXX"
GH_ORG = "your_org/"
# docker format terminal the right way
# use it like this
# goinside ${CONTAINER_ID}
goinside(){
docker exec -it $1 bash -c "stty cols $COLUMNS rows $LINES && bash";
}
@misterjoa
misterjoa / ipython_fft_example.ipynb
Created March 8, 2019 11:07 — forked from jedludlow/ipython_fft_example.ipynb
IPython Notebook FFT Example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@misterjoa
misterjoa / remove_all_cups_printers.sh
Created October 26, 2019 22:00
remove all cups printers
#!/usr/bin/bash
lpstat -p|grep ^printer|awk '{print $2}'|sed -s 's/inconnue//g'>printers.txt
cat printers.txt | xargs -L1 lpadmin -x
@misterjoa
misterjoa / cmake+pyenv
Created October 28, 2019 21:35
cmake and pyenv : use right version of interpreter and libs
cmake -DPYTHON_LIBRARY=${HOME}/.pyenv/versions/3.8.0/lib/libpython3.8.a -DPYTHON_INCLUDE_DIR=${HOME}/.pyenv/versions/3.8.0/include/python3.8/ cern_root/
@misterjoa
misterjoa / Pipfile
Last active December 4, 2019 15:37 — forked from dankrause/ipc.py
Simple socket IPC in python
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
docopt = "*"
@misterjoa
misterjoa / list_queues.txt
Created April 23, 2020 13:41 — forked from oubiwann/list_queues.txt
A Kombu send/receive example
Listing queues ...
hipri 5
lopri 0
midpri 0
...done.
@misterjoa
misterjoa / install-docker.md
Created June 12, 2020 13:50 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@misterjoa
misterjoa / autoreload.md
Created June 24, 2020 08:59 — forked from deehzee/autoreload.md
Auto reload of modules in jupyter notebook

Module autoreload

To auto-reload modules in jupyter notebook (so that changes in files *.py doesn't require manual reloading):

# for auto-reloading external modules
# see http://stackoverflow.com/questions/1907993/autoreload-of-modules-in-ipython
%load_ext autoreload
%autoreload 2