Skip to content

Instantly share code, notes, and snippets.

View RafaelWO's full-sized avatar
🤔
thinking...

RafaelWO

🤔
thinking...
  • Salzburg, Austria
  • 13:00 (UTC -12:00)
View GitHub Profile
@aiguofer
aiguofer / README.md
Last active April 27, 2023 19:12
Get info about running jupyter notebooks including memory consumption, how long they've been running, etc.
@roylee0704
roylee0704 / dockergrep.sh
Created December 9, 2016 08:24
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@Rajeshr34
Rajeshr34 / wkhtmltopdf.sh
Last active February 18, 2025 00:30
Wkhtmltopdf With Patched QT Setup Ubuntu 16+
cd ~
apt-get install libfontenc1 xfonts-75dpi xfonts-base xfonts-encodings xfonts-utils openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig -y
#https://github.com/wkhtmltopdf/wkhtmltopdf/releases
#replace arch
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
apt --fix-broken install
@dazza-codes
dazza-codes / check_numpy_types.md
Last active January 13, 2025 12:59
Checking numpy types
@gene1wood
gene1wood / aws-lambda-relative-import-no-known-parent-package.md
Last active February 13, 2025 22:07
Python relative imports in AWS Lambda fail with `attempted relative import with no known parent package`

Python relative imports in AWS Lambda fail with attempted relative import with no known parent package

The Problem

In AWS Lambda if I attempt an explicit relative import like this

.
├── lambda_file.py
└── example.py
@rubo77
rubo77 / rotatescreen.sh
Last active April 2, 2025 08:31
This script rotates the screen (tested on a Lenovo Yoga 730-15iwl) (source: https://askubuntu.com/a/1217290/34298)
#!/bin/bash
# This script rotates the screen and touchscreen
# by Ruben Barkow-Kuder: https://gist.github.com/rubo77/daa262e0229f6e398766
#### configuration
# find your Touchscreen device with `xinput`
TouchscreenDevice="$(xrandr |grep eDP|cut -d" " -f1)"
if [ "$1" = "--help" ] || [ "$1" = "-h" ] ; then
@tomlankhorst
tomlankhorst / docker-swarm-gpu.md
Last active March 17, 2025 06:40
Instructions for Docker swarm with GPUs
@yanqd0
yanqd0 / dl_requests_tqdm.py
Last active April 16, 2025 11:52
Python requests download file with a tqdm progress bar
import requests
from tqdm import tqdm
def download(url: str, fname: str, chunk_size=1024):
resp = requests.get(url, stream=True)
total = int(resp.headers.get('content-length', 0))
with open(fname, 'wb') as file, tqdm(
desc=fname,
total=total,
@andgineer
andgineer / db_fixture.py
Created June 9, 2020 15:38
pytest Fixture to rollback all DB changes after test
from sqlalchemy import event
from sqlalchemy.orm import sessionmaker
from app.db.session import engine
import pytest
import app.tests.config
@pytest.fixture(
scope='function',
autouse=True # New test DB session for each test todo we need it only for tests with Client fixture