Skip to content

Instantly share code, notes, and snippets.

View marians's full-sized avatar

Marian Steinbach marians

View GitHub Profile
@marians
marians / My_First_Raspberry.md
Last active January 7, 2021 08:31
Notes on my Raspberry Pi setup
@marians
marians / Re-partition_a_disk_on_a_Mac.md
Created December 19, 2019 10:44
How to re-partition an external drive from a Mac

WARNING: This erases all data stored on the drive.

I couldn't re-partition a freshly bought USB SSD via the Apple Disk Utility app. With the help of a Stack Overflow thread I came up with this method to create two partitions on the disk.

After this process, the disk can be re-partitioned interactively using Disk Utility.

  1. Plug in the drive to the Computer.
@marians
marians / README.md
Last active October 30, 2019 22:33
Phoniebox installation log
@marians
marians / read-sds011-data.sh
Created February 1, 2019 20:52
How to read data from SDS011 sensor via USB serial connection, from http://opengeiger.de/Feinstaub/FeinstaubDatenLogger.pdf
#!/bin/bash
# Anpassung für big endian unter RHEL 7
WDIR=~
while true; do
stty -F /dev/ttyUSB0 9600 raw
INPUT=$(dd conv=swab bs=10 count=1 </dev/ttyUSB0 2>/dev/null | od -x -N10 |head -n 1|cut -f2-10 -d" ");
#Ausgabe
#echo $INPUT
<Absender>
CleverReach GmbH & Co. KG
Mühlenstr. 43
26180 Rastede
<Datum>
@marians
marians / import.py
Created March 16, 2017 13:09
Migrating a Ghost blog database to Jekyll
# coding: utf8
"""
This script helps to import content from a Ghost blog database to Jekyll.
The database is expected to be running on a reachalbe MySQL host.
See the very end for DB configuration.
Quick Usage:
pip install -r requirements
@marians
marians / test.py
Last active July 10, 2017 23:47
Using Tor Browser Bundle for anonymous HTTP requests in Python - supplement for http://www.sendung.de/2014-09-16/anonymous-scraping-via-python-tor/
import socket
import socks # pip install PySocks - https://github.com/Anorov/PySocks
# configure default proxy. 9150 is the Tor Browser Bundle socks proxy port
socks.set_default_proxy(socks.SOCKS5, "127.0.0.1", 9150)
socket.socket = socks.socksocket
import urllib
print(urllib.urlopen('http://icanhazip.com').read())

Keybase proof

I hereby claim:

  • I am marians on github.
  • I am marians (https://keybase.io/marians) on keybase.
  • I have a public key ASC59Z_e1Q8cm9jPZ4xhDuDFkxS1DJuecrMCau60nd58jgo

To claim this, I am signing this object:

@marians
marians / Podcasts.md
Created January 31, 2017 21:21
Podcasts in English or German that could help you find out what's going on in the U.S. (politics)
@marians
marians / openapi-spec.yaml
Created November 14, 2016 15:45
How to avoid repeating a parameter definition in an Open API 2.0 spec?
swagger: "2.0"
host: api.example.com
schemes:
- https
info:
title: An Example API Spec
version: "1"
paths:
/users/{user_id}/: