Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
..

magnus magnusja

👨‍💻
..
View GitHub Profile
@mvanga
mvanga / music_theory.py
Last active Sep 23, 2021
Basic Music Theory in ~200 Lines of Python
View music_theory.py
# The code for my article with the same name. You can find it at the URL below:
# https://www.mvanga.com/blog/basic-music-theory-in-200-lines-of-python
# 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
Depau / README.md
Last active Jan 13, 2020
Libaums QEMU setup
View README.md

Steps

  • Install qemu-system-x86_64
  • Download Android-x86 RPM from https://www.fosshub.com/Android-x86.html
  • 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
oseme-techguy / Correct_GnuPG_Permission.sh
Last active Nov 19, 2021
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
View Correct_GnuPG_Permission.sh
#!/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
View docker_hygiene.sh
# 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
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
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 (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@eLement87
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
hhromic / raspbian-stretch-lite-slimdown.md
Last active Sep 29, 2021
Slimming Down Raspbian Stretch Lite
View raspbian-stretch-lite-slimdown.md

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.

Instructions

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

$ unzip -p 2018-04-18-raspbian-stretch-lite.zip | dd bs=4M of=/dev/sdX conv=fsync
@tanaikech
tanaikech / submit.md
Last active Oct 8, 2021
Downloading Shared Files on Google Drive Using Curl
View submit.md

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

CURL

filename="### filename ###"
fileid="### file ID ###"
curl -L -o ${filename} "https://drive.google.com/uc?export=download&id=${fileid}"