Skip to content

Instantly share code, notes, and snippets.

View diegodorado's full-sized avatar

Diego Dorado diegodorado

View GitHub Profile
# how to pair a fucking bluetooth keyboard
# first, make sure bluetooth service is on
# then, enter bluetoothctl
bluetoothctl
#just in case
power on
#filter keyboards
agent KeyboardOnly
let ns pp = note (scale "spanish" $ pp)
pat = "[0 3 4]/12"
nseg ss pp = (round <$> (segment ss $ pp))
nss ss pp = ns (nseg ss pp)
pats =
[
("intro", nss 6 (range 0 "<12 8>" $ sine+0.2*rand) # midi 5),
("intro2", nss (2 * irand 4) (range 0 "<12 8>" $ sine+0.2*rand) # midi 5),
("intro3", nss (2 * irand 4) (range 0 "<12 8>" $ sine+0.2*rand) + stack[midi 5,midi 0 -note 12]),
("bridge", nss (choose([1,3,6,12])) (sine*12+rand*3) + stack[midi 5,midi 0 -note 12]),
include "%L"
<Multi_key> <n> : "ñ"
<Multi_key> <Multi_key> <k> <i> <s> <s> : "💋" U1F48B # KISS MARK
let digits = "0123456789".split('')
function *permute(a, n = a.length) {
if (n <= 1) yield a.slice();
else for (let i = 0; i < n; i++) {
yield *permute(a, n - 1);
const j = n % 2 ? 0 : i;
[a[n-1], a[j]] = [a[j], a[n-1]];
}
}
@diegodorado
diegodorado / backup_and_restore_atmega_hex.sh
Created September 18, 2019 23:21
How to get a full flash backup (and restore) of an atmega328 chip, with usbasp programmer
# How to get a full flash backup (and restore) of an atmega328 chip, with usbasp programmer
# Backup
avrdude -p m328p -c usbasp -U flash:r:flash_backup_file.hex:i
#Restore
avrdude -p m328p -c usbasp -e -U flash:w:flash_backup_file.hex:i
@diegodorado
diegodorado / startup.scd
Created July 12, 2019 23:57
Startup de superdirt que estoy usando ultimamente

( "SC_JACK_DEFAULT_INPUTS".setenv(""); "SC_JACK_DEFAULT_OUTPUTS".setenv("");

s.options.numBuffers = 1024 * 32; // increase this if you need to load more samples s.options.memSize = 8192 * 32; // increase this if you get "alloc failed" messages s.options.maxNodes = 1024 * 32; // increase this if you are getting drop outs and the message "too many nodes" s.options.numOutputBusChannels = 4; // set this to your hardware output channel size, if necessary s.options.numInputBusChannels = 8;

@diegodorado
diegodorado / brindis.hs
Last active August 29, 2019 16:48
Brindis - live coded song with tidalcycles
setcps 1
let pats =
[
("bs", s "[swbd swsn]/2" # gain 1.2 # orbit 3),
("bs2", s "[swbd [swsn!3 [swsn swsn*3]]/4]/2" # gain 1.2 # orbit 3),
("bs3", s "[swbd*4, ~ <swsn <swsn:3*3? swsn:4>>]/2" # gain 1.2 # orbit 3),
("bs4", s "[swbd <swsn <[swsn:3 swsn:3? swsn:3?] swsn:4>>]" # gain 1.2 # orbit 3),
("hh", off "<0.167 0.33>" (|*|gain 0.9) $ s "<hh*2 feel:1*<2 2 3>>" # gain 1.1 # hpf (range 1000 6000 $ slow 4 tri) # hpq (range 0.025 0.3 $ slow 4.3 tri) # lpf 3000),
@diegodorado
diegodorado / flash_disk.sh
Last active April 22, 2019 17:47
dd, cat, etc
sudo dd if=input.img of=/dev/sdX status=progress
# Synchronize cached writes to persistent storage
sync
@diegodorado
diegodorado / ffmpeg_cheatsheet.sh
Last active May 18, 2021 12:52
ffmpeg, mogrify, montage and convert ( imagemagick tools)
#bulk convert with ffmpeg, cmd works, powershell doesnt
for %i in (*.*); do ffmpeg -i %i %~ni.mp4
#extract a video part
ffmpeg -i original.avi -an -ss 17 -t 5 cutted.avi
# -i, is the input file: original.avi
# -an, to not copy the audio (it was giving me troubles and i dont need it now)
# -ss, where to start: at 17 seconds
# -t, duration: 5 seconds
#for more precision
@diegodorado
diegodorado / connect.sh
Last active February 22, 2024 02:42
Execute dictionary attack to Wi-Fi Network
# list wifi interfaces
iw dev
# set wlan up
ip link set wlan0 up
# scan ssids
iw wlan0 scan | grep -i ssid
# create a config file (type the ssid password)