Skip to content

Instantly share code, notes, and snippets.

@NSBum
NSBum / wiki_code_russian_content.py
Created December 20, 2023 21:59
Get wiki code of ru.wikitionary.org entry but only Russian language.
import re
import requests
def get_wiktionary_russian_content(word):
url = "https://ru.wiktionary.org/w/api.php"
params = {
"action": "query",
"format": "json",
"titles": word,
"prop": "revisions",
@NSBum
NSBum / WD_My_Cloud_EX2.txt
Created April 19, 2023 10:48 — forked from diffficult/WD_My_Cloud_EX2.txt
Fan control notes for WD My Cloud EX2 Ultra
~ # fan_control -?
*** Fan Cobtrol Help Message ***
fan_control b c: for NAS booting
fan_control 0 d : [auto: low/medium/high/max] open debug msg
fan_control 0 c : [auto: low/medium/high/max] close debug msg
fan_control -L [value] : set Lower (THYST)
fan_control -H [value] : set Upper(TOS)
fan_control -g 0 : get current temperature
fan_control -g 1 : get Lower temperature
fan_control -g 2 : get Upper temperature
@NSBum
NSBum / anki.html
Created April 20, 2022 11:45
anki tts snippet
<!-- if there's no alternate pronunciation, play the TTS default -->
{{^alt_pronunciation_2}}
{{tts ru_RU voices=AwesomeTTS:sentence_ru_pf}}
{{/alt_pronunciation_2}}
<!-- if an alternate pronunciation is provided, then play it -->
{{#alt_pronunciation_2}}
{{alt_pronunciation_2}}
{{/alt_pronunciation_2}}
@NSBum
NSBum / mcp3008.c
Created March 3, 2018 23:39
Reading MCP3008 using C on the Raspberry Pi
// Using C to read the MCP3008 10-bit
// ADC via SPI
#include <stdio.h>
#include <bcm2835.h>
uint8_t start = 0x01;
uint8_t end = 0x00;
uint8_t chan = 0x00;
@NSBum
NSBum / CompressAndTruncate.txt
Created July 13, 2020 14:31
Audacity macro to trim silence and compress dynamic range
SelectAll:
TruncateSilence:Action="Truncate Detected Silence" Compress="50" Independent="0" Minimum="0.5" Threshold="-20" Truncate="0.5"
Compressor:AttackTime="0.2" NoiseFloor="-40" Normalize="1" Ratio="2" ReleaseTime="1" Threshold="-12" UsePeak="0"
@NSBum
NSBum / check_mlhu_vaccine.py
Last active April 7, 2021 10:38
MHLU vaccine notifier
#!/usr/bin/env python3
try:
# Python 2
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen, Request
from lxml import etree
import re
from py_imessage import imessage
@NSBum
NSBum / KjellinSentences.txt
Created July 13, 2020 14:43
Generate six iterations of the track content + 650 ms silence
SelEnd:
Select:End="-0.65" Mode="Set" RelativeTo="SelectionEnd" Start="0"
Silence:Use_Preset="User Preset:650ms"
SelectAll:
CursSelEnd:
Repeat:Count="5"
@NSBum
NSBum / df
Created March 11, 2020 17:59
External note editor error log
Syncing failed:
Traceback (most recent call last):
File "aqt/sync.py", line 376, in _sync
File "aqt/sync.py", line 356, in _abortingSync
File "anki/sync.py", line 44, in sync
File "anki/sync.py", line 592, in meta
File "anki/sync.py", line 556, in req
File "anki/sync.py", line 441, in post
File "requests/sessions.py", line 572, in post
File "requests/sessions.py", line 510, in request
@NSBum
NSBum / foldergallery.html
Last active January 18, 2020 11:20
Adaptation of this fancybox-based folder gallery: https://greekdeveloper.com/2018/folder-based-gallery-for-hugo/
<!-- /layouts/shortcodes/foldergallery.html -->
<style>
div.gallery {
display: flex;
flex-wrap: wrap;
}
div.gallery a {
flex-grow: 1;

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o