Skip to content

Instantly share code, notes, and snippets.

View RaphaelWimmer's full-sized avatar

Raphael Wimmer RaphaelWimmer

View GitHub Profile
@sharmaeklavya2
sharmaeklavya2 / create_timetable.py
Last active July 23, 2017 11:11
Script to make timetable in HTML using a list of sections
#/usr/bin/env python
'Generate Time Table'
from __future__ import print_function
import sys
import argparse
from collections import defaultdict
START_TIME = 8
# Time when classes start
@bodil
bodil / fix-my-stupid-folio.service
Created November 24, 2016 15:05
Hacks for Linux kernel glitches on the HP Elitebook Folio G1
[Unit]
Description=HP Elitebook Folio G1 fixes
[Service]
ExecStart=/sbin/fix-my-stupid-folio
[Install]
WantedBy=basic.target
@bhive01
bhive01 / see3cam_test.py
Last active December 17, 2018 16:30
reading images from a see3cam CU40
import math
import numpy as np
import cv2
cam = cv2.VideoCapture(0)
cam.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
cam.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
cam.set(cv2.CAP_PROP_CONVERT_RGB, False) # turn off RGB conversion
# cam.set(cv2.CAP_PROP_FOURCC('Y', '1', '6', ''))
@pklaus
pklaus / arbitrary-waveform-test.py
Created May 4, 2012 19:05
Controlling the Rigol DG1022 with Python on Linux (using the usbtmc driver) – Proof of Concept
#!/usr/bin/env python2
import usbtmc
import time
from math import sin
listOfDevices = usbtmc.getDeviceList()
dn = listOfDevices[0]
d = usbtmc.UsbTmcDriver(dn)
print d.getName()
@bhive01
bhive01 / see3cam_good_np_slicing.py
Created April 16, 2018 02:49
CU40 with Numpy Slicing (efficient for video on Raspberry Pi)
# TESTING HARDWARE
# see3CAM_CU40
# raspberry Pi 3 bf8
# Raspbian Stretch 13-03-2018
# Python 3.5.3
# OpenCV 3.4.1
# load required libraries
import math
import numpy as np
@chopfitzroy
chopfitzroy / client.sh
Created August 4, 2016 06:26
Synergy multiple servers for one client
#!/bin/bash
# IP address to cycle through (in order of priority)
ip=( "192.168.20.102" "192.168.20.103" )
# Check if synergy is already connected
if pgrep "synergyc"; then
# Synergy already connected
echo "Synergy is already running."
else
@dajiaji
dajiaji / python_cwt_sample_eudcc_02.py
Last active November 17, 2021 11:50
A simple EUDCC verifier implementation with Python CWT.
import json
import os
import zlib
import requests
from base45 import b45decode
import cwt
from cwt import load_pem_hcert_dsc

How to make a small tweak to free software

The target audience for this is people who are beginners at software engineering and using linux. A lot of the information here may be obvious or already known to you. The language involved is C but you do not need to know any C to read this tutorial. I used mg to write this blog post. I used vs code to edit the source code.

This post is also available on gopher://tilde.team:70/0/~river/tweak-free-software

If you use a piece of free software and it's 99% perfect but there's just this one thing it does that annoys the hell out of you.. you can in theory just fix it! Here's a look at what doing that is like. Hopefully it inspires you, or you pick up a could tricks on the way!

Step 0: Have a problem

#!/usr/bin/env python
import math
import sys
from moviepy.editor import AudioClip, VideoFileClip, concatenate_videoclips
# Get average RGB of part of a frame. Frame is H * W * 3 (rgb)
# Assumes x1 < x2, y1 < y2
@Toliak
Toliak / shame.py
Last active February 14, 2023 10:16
Python runtime bytecode patch example
import functools
import struct
import types
import dis
def _patch_code(code: types.CodeType):
# Call function with 0 arguments
function_call_bytearray = bytearray(dis.opmap['CALL_FUNCTION'].to_bytes(1, byteorder='little') + b'\x00')