Skip to content

Instantly share code, notes, and snippets.


magnus magnusja

View GitHub Profile
mvanga /
Last active Sep 23, 2021
Basic Music Theory in ~200 Lines of Python
# The code for my article with the same name. You can find it at the URL below:
# MIT License
# Copyright (c) 2021 Manohar Vanga
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
Depau /
Last active Jan 13, 2020
Libaums QEMU setup


  • Install qemu-system-x86_64
  • Download Android-x86 RPM from
  • Extract the RPM (I'm using rpmextract from Arch, GitHub)
  • cd into the android-[version] directory from the RPM
  • Create a backing image for the USB drive:
    • qemu-img create -f raw USB.img 4G
  • Use my adapted QEMU launcher script
View led_audio_input_visualizer_esp8266.ino
LED audio inputVisualizer for ES8266
Hardware requirements:
- ESP8266 or any compatible controller.
- Microphone with amplifier
- LED strip ws2812b
- Optional: battery for portable use (else power through USB or adapter)
Software requirements:
- Adafruit NeoPixel library
oseme-techguy /
Last active Nov 19, 2021
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/usr/bin/env bash
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# Also correct the permissions and access rights on the directory
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg
# Remove all exited containers
docker rm `docker ps -a -q --filter status=exited` 2>/dev/null
# Remove any orphaned containers related to "INSERT_CONTAINER_NAME_HERE"
docker rm `docker ps -a -q --filter ancestor=INSERT_CONTAINER_NAME_HERE` 2>/dev/null
# Remove any orphaned images from aborted/old builds
docker rmi `docker images -q -f "dangling=true"` 2>/dev/null
# Clean up whatever disk-hogging stuff Docker leaves lying aroung
dylanmckay / facebook-contact-info-summary.rb
Last active May 6, 2021
A Ruby script for collecting phone record statistics from a Facebook user data dump
View facebook-contact-info-summary.rb
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
enricofoltran / main.go
Last active Nov 23, 2021
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
eLement87 / mqtt_tls_working.ino
Created Dec 10, 2017
ESP8266 Secure MQTT Connection with Client Certificate Authentication
View mqtt_tls_working.ino
#include <FS.h>
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <PubSubClient.h>
#include <time.h>
// Insert your FQDN of your MQTT Broker
#define MQTT_SERVER "mqtt.srvx1.local"
const char* mqtt_server = MQTT_SERVER;
hhromic /
Last active Sep 29, 2021
Slimming Down Raspbian Stretch Lite

Slimming Down Raspbian Stretch Lite

Notes for slimming down a fresh installation of Raspbian Stretch Lite. This guide does not strip Raspbian of basic functionality such as Bluetooth and mDNS.


Install a fresh Raspbian Stretch Lite image into the SD card ([source][1]).

$ unzip -p | dd bs=4M of=/dev/sdX conv=fsync
tanaikech /
Last active Oct 8, 2021
Downloading Shared Files on Google Drive Using Curl

Downloading Shared Files on Google Drive Using Curl

When the shared files on Google Drive is downloaded, it is necessary to change the download method by the file size. The boundary of file size when the method is changed is about 40MB.

File size < 40MB


filename="### filename ###"
fileid="### file ID ###"
curl -L -o ${filename} "${fileid}"