Skip to content

Instantly share code, notes, and snippets.

@santiagobasulto
santiagobasulto / README.md
Last active May 16, 2021 10:13
Download HumbleBundle books in batch with a simple Python script.

Download HumbleBundle books

This is a quick Python script I wrote to download HumbleBundle books in batch. I bought the amazing Machine Learning by O'Reilly bundle. There were 15 books to download, with 3 different file formats per book. So I scratched a quick script to download all of them in batch.

(Final Result: books downloaded)

@ludeeus
ludeeus / install_mosquitto.sh
Last active September 24, 2018 20:02
171272017_mosquitto_fix
#!/bin/bash
function mosquitto-show-short-info {
echo "Mosquitto Installer for Hassbian"
}
function mosquitto-show-long-info {
echo "Installs the Mosquitto package for setting up a local MQTT server"
}

Setup MQTT with SSL

  • :1883 will be for local use only
  • :8083 websocket secure
  • :8883 mqtt secure
sudo apt-get install mosquitto

Getting certificate & Auto-Renewal

Don't forget to change the domain and allow port 443 through firewall

@ruanbekker
ruanbekker / lxd-usage.txt
Created November 14, 2016 06:34
LXD Usage
Docs - LXD Helpful Docs:
https://www.stgraber.org/2016/03/30/lxd-2-0-image-management-512/
https://www.flockport.com/flockport-first-look-at-lxd/
http://insights.ubuntu.com/2016/03/14/the-lxd-2-0-story-prologue/
Docs - Installation:
http://insights.ubuntu.com/2016/03/14/the-lxd-2-0-story-prologue/
Docs - API:
https://linuxcontainers.org/lxd/getting-started-cli/
# Instructions
## Content
1. Install OS
2. Connecting to the Pi
3. Setting up Raspian
4. Enable secure login
5. Install openHAB
6. Install mosquitto
@probonopd
probonopd / mosquitto-on-uberspace.txt
Last active June 2, 2019 03:56
mosquitto MQTT on uberspace
# Make a directory
mkdir ~/mosquitto
cd ~/mosquitto
# Get mosquitto for CentOS 6 and locally unpack it
wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/oojah:/mqtt/RedHat_RHEL-6/x86_64/mosquitto-1.2-6.1.x86_64.rpm
rpm2cpio mosquitto-*.rpm | cpio -idmv
mosquitto-*.rpm
# Set up ~/service on uberspace
@gbaman
gbaman / HowToOTG.md
Last active June 15, 2024 17:17
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@sheikhwaqas
sheikhwaqas / setup-mysql.sh
Last active September 6, 2023 15:59
Install MySQL Server on Ubuntu (Non-Interactive Installation)
# Download and Install the Latest Updates for the OS
apt-get update && apt-get upgrade -y
# Set the Server Timezone to CST
echo "America/Chicago" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# Enable Ubuntu Firewall and allow SSH & MySQL Ports
ufw enable
ufw allow 22
@embolalia
embolalia / gist:5660363
Last active December 17, 2015 19:29
A quick script that makes my raspi light up for different ping times. It's a terrible hack, and was not written with the intent of making it public. Please don't hurt me.
#!/usr/bin/env python
import RPi.GPIO as gpio
from time import sleep
import re
import sys
gpio.setmode(gpio.BCM)
red = 23
yel = 24