Skip to content

Instantly share code, notes, and snippets.

View nyptus's full-sized avatar
😃

Maxim Borozdin nyptus

😃
  • 03:04 (UTC +03:00)
View GitHub Profile
@nyptus
nyptus / script-template.sh
Created March 29, 2022 06:05 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@nyptus
nyptus / macos-app-icon.md
Created December 31, 2021 15:11 — forked from jamieweavis/macos-app-icon.md
How to make an app icon for macOS using iconset & iconutil
@nyptus
nyptus / openwrt-lede-on-wd-mbl.sh
Created November 20, 2021 09:03 — forked from braian87b/openwrt-lede-on-wd-mbl.sh
Install OpenWRT or LEDE on WD MBL Western Digital MyBookLive
# Instructions to Install OpenWRT or LEDE on WD MBL Western Digital MyBookLive (Tested on Single, but it should work on Duo too)
# Recommended to use a Linux / Debian box with wget, dd, gunzip, lsblk
# Using a Debian box (it could be a VM) with the harddrive connected (it could be a minimal net-install Debian)
See ip with:
ip addr show
# connect remotely using:
user@outside:~/# ssh user@10.211.55.6
# We elevate permissions or even better install and config sudo
user@debian8vm:~/# su
@nyptus
nyptus / code.py
Created November 5, 2021 09:19 — forked from idriszmy/code.py
DIY USB Keyboard Mouse Using Maker Pi Pico
'''
References:
- CircuitPython HID Keyboard and Mouse
https://learn.adafruit.com/circuitpython-essentials/circuitpython-hid-keyboard-and-mouse
CircuitPython libraries bundle: https://circuitpython.org/libraries
Additional libraries:
- adafruit_hid
@nyptus
nyptus / amqp.py
Created June 4, 2016 11:46 — forked from wadewegner/amqp.py
Code used to turn the IoT Thermal Printer into a lunch menu & text message receiver
import pika, os, urlparse, sys
from Adafruit_Thermal import *
printer = Adafruit_Thermal("/dev/ttyAMA0", 19200, timeout=5)
url_str = os.environ.get('CLOUDAMQP_URL','amqp://YOUR_CLOUDAMQP_URL')
url = urlparse.urlparse(url_str)
params = pika.ConnectionParameters(host=url.hostname, virtual_host=url.path[1:],
credentials=pika.PlainCredentials(url.username, url.password))