Skip to content

Instantly share code, notes, and snippets.

import time
import board
import neopixel
import math
import rotaryio
import board
import digitalio
import adafruit_rgbled
import busio
import adafruit_midi
import time
import board
import neopixel
import math
import rotaryio
import board
import digitalio
import adafruit_rgbled
import busio
import adafruit_midi
@spotlesscoder
spotlesscoder / framework_powerled_color.sh
Created August 27, 2023 13:40 — forked from thejevans/framework_powerled_color.sh
script to change the framework laptop power led color based on battery/charging status. I use it as a cron job
#!/bin/bash
# takes desired critical percentage as first argument and
# charged percentage as second, both with default values.
# example usages:
#
# framework_powerled_color.sh
# framework_powerled_color.sh 10
# framework_powerled_color.sh 10 98
#
@spotlesscoder
spotlesscoder / ceph-commands.txt
Created May 21, 2022 07:17 — forked from pertoft/ceph-commands.txt
Ceph command cheatsheet
ceph -w
ceph health detail
ceph osd df
ceph osd find
ceph osd blocked-by
ceph osd pool ls detail
ceph osd pool get rbd all
ceph pg dump | grep pgid
ceph pg pgid

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@spotlesscoder
spotlesscoder / awoo_tool.lua
Created April 18, 2020 21:47 — forked from wolfiestyle/awoo_tool.lua
the Awoo Tool™
#!/usr/bin/env lua
-- Awoo Tool by @wolfiestyle
-- license: MIT/X11
-- demo: https://twitter.com/wolfiestyle/status/767124329461084161
local lgi = require "lgi"
local Gtk = lgi.Gtk
local GLib = lgi.GLib
local window = Gtk.Window{
title = "awoo tool v0.1-alpha",
@spotlesscoder
spotlesscoder / WinUSBFromLinux.md
Created January 17, 2020 20:07 — forked from kuznero/WinUSBFromLinux.md
How to make Windows 7 USB flash install media from Linux?

How to make Windows 7 USB flash install media from Linux?

StackOverflow

  • Install ms-sys - if it is not in your repositories, get it here. Or alternatively, make sure lilo is installed (but do not run the liloconfig step on your local box if e.g. Grub is installed there!)
  • Check what device your USB media is assigned - here we will assume it is /dev/sdb. Delete all partitions, create a new one taking up all the space, set type to NTFS (7), and remember to set it bootable:
# cfdisk /dev/sdb
or fdisk /dev/sdb (partition type 7, and bootable flag)
@spotlesscoder
spotlesscoder / reclaimWindows10.ps1
Created December 11, 2019 22:06 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.20.2, 2018-09-14
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
public class Main {
public static void main(String[] args) {
String dateStr1 = "2019-01-30T12:04:12.734Z";
String dateStr2 = "2019-01-30T12:04:12.21Z";