Skip to content

Instantly share code, notes, and snippets.

View breuerfelix's full-sized avatar
🤓
learning by doing

Felix Breuer breuerfelix

🤓
learning by doing
View GitHub Profile
@breuerfelix
breuerfelix / backlight.sh
Created February 13, 2020 13:44
simple script for changing your backlight
#!/bin/bash
# search for your driver in /sys/class/backlight
# usage: backlight intel_backlight inc 10
# this will increase your backlight by 10 % (5 is default)
rootpath='/sys/class/backlight/'
driver=$1
brightness_file=$rootpath$driver'/brightness'
@breuerfelix
breuerfelix / change_git_email.sh
Created February 4, 2020 12:45
rewrites the git history with correct email
#!/bin/sh
owner="breuerfelix"
repos="
instapy-gui
jinsta
"
for repo in $repos
do
@breuerfelix
breuerfelix / rpi_sensors.py
Last active December 2, 2019 13:35
read in rpi sensors and output values to a file
import RPi.GPIO as board
import time
import json
# bewegungssensor plus ist rechts wenn man auf die rueckseite guckt und die kontakte oben sind
board.setwarnings(False)
board.setmode(board.BCM)
data_path = './data.json'
@breuerfelix
breuerfelix / arch.md
Last active March 13, 2019 08:23
dual boot macos - arch linux / efi / 2019

partitioning

  • make a partition for arch in macos with disk utilities
    • filesystem doesn't matter
  • launch live system
  • setfont latarcyrheb-sun32
  • run cgdisk
    • wipe the partition you made in macos
    • create a partition for root / (~25G)
      • type +128M for the first sector
@breuerfelix
breuerfelix / rpi-fan-control.py
Last active November 28, 2020 16:40
service that starts / stops a fan plugged into a raspberry pi at a certain temperature
import RPi.GPIO as board
import time
import os
import datetime
# setup
board.setwarnings(False)
board.setmode(board.BCM)
pin = 17

Keybase proof

I hereby claim:

  • I am breuerfelix on github.
  • I am felixbreuer (https://keybase.io/felixbreuer) on keybase.
  • I have a public key ASAmTUqDAcRiOiOZTIXtRLRhTloUbLntsS9pqD4xKEuNZAo

To claim this, I am signing this object:

@breuerfelix
breuerfelix / cartpole-dnn.py
Created December 16, 2018 17:36
cartpole-v1 solved with machine learning
import sys
import random
from statistics import mean, median
from collections import Counter
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.estimator import regression
import numpy as np
import tflearn
import gym
@breuerfelix
breuerfelix / tribal_wars_login.py
Created October 19, 2018 13:09
login to the unofficial tribal wars api
import requests
import time
s = requests.Session()
username = 'scriptworld'
password = 'apitest123'
gameworld = 'en104'
s.headers['User-Agent'] = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:63.0) Gecko/20100101 Firefox/63.0"
@breuerfelix
breuerfelix / chromedriver-updater.py
Last active September 22, 2018 14:27
routine which updates chromedriver-py package on its own
# constants
CHROME_DL_URL = 'https://chromedriver.storage.googleapis.com'
CHROME_URL = 'http://chromedriver.chromium.org/downloads'
REPO_PATH = './GitHub/chromedriver-py/'
VERSION_FILE = './GitHub/chromedriver-py/version.txt'
DOWNLOAD_DIR = './'
CURRENT_VERSION = []
UPDATE_SCRIPT = './update_chromedriver.sh'
# chromedriver versions for downloading only
@breuerfelix
breuerfelix / devcon-worker.exe
Last active June 28, 2018 21:12
system.exe at ~25% CPU fix (with devcon)
@echo off
set to=15
:loop
rem moves to execution directory
cd %~dp0
rem executes devcon.exe with rescan
devcon.exe rescan