Skip to content

Instantly share code, notes, and snippets.

View arlm's full-sized avatar

Alexandre Rocha Lima e Marcondes arlm

View GitHub Profile
@arlm
arlm / requirements.txt
Last active March 7, 2024 21:13
Unpairing a DualShock 4 and Setting a new BDADDR
netaddr==1.2.1
pyusb==1.2.1
hidapi==0.14.0
@arlm
arlm / Grab exercism tracks.txt
Created February 20, 2024 11:03
Better algorithm to find all tracks from exercism from the page: https://exercism.org/tracks
var links = '';
[...Array.from(document.querySelectorAll('#page-tracks > div > div > section.lg-container.container > div > div.--tracks > div > a'), (a) => (/^https?:\/\/exercism\.org\/tracks\/((.*)$/g).exec(a.href)[1])];
console.log(links);
@arlm
arlm / General SDR Radio Notes.md
Created February 20, 2024 11:03
General SDR Radio Notes focused in Germany

The RTL2832U Chipset

The frequency range of the RTL2832U SDR radio chipset is 500 kHz –1.75GHz ¹ ². This range can be extended to 24 MHz in direct sampling mode ¹.

It can capture up to 2.4 MHz of the RF spectrum at one time ³. The RTL2832U supports tuners at Intermediate Frequency (IF) at 36.125MHz, low-IF a 4.57MHz, or Zero-IF output using a 28.8MHz crystal, and includes FM/DAB/DAB+ Radio Support ⁴.

(1) RTL-SDR Blog V3 Datasheet (2) Listen In - DIYODE Magazine (3) RTL2832 - All You Need to Know - Amateur Radio Wiki. (4) RTL2832U - REALTEK.

ffmpeg -ss "0:28:10" -i $(yt-dlp -f b --get-url "https://www.youtube.com/watch?v=yfi3gvLnY6g") -vframes 1 -q:v 2 "overlay-%03d.png"
for i in vtt ttml srv3 srv2 srv1 json3; do yt-dlp --skip-download --write-auto-sub --sub-lang en-orig,en,de,pt,en-en-US,de-en-US,pt-en-US --sub-format $i https://www.youtube.com/watch\?v\=6fSXKthsPjU; done
git config --global --add url."git@bitbucket.org:".insteadOf "https://bitbucket.org/"
git config --global --add url."git@gitlab.com:".insteadOf "https://gitlab.com/"
git config --global --add url."git@bitbucket.org:".insteadOf "https://bitbucket.org/"
git config --global --add url."git@github.com:".insteadOf "https://github.com/"
var links = [];
[].forEach.call(document.querySelectorAll("a[id^='game_']"), function(element) {
if (!!element) {
links.push(element.href);
}
});
links;
var getProfileImage = async function () {
var header = document.querySelector("#app-mount > div > div > div:nth-child(3) > div > div > div > div > header");
var url = header.querySelector("div > div:nth-child(1) > div > svg > foreignObject > div > img").src;
var name = header.querySelector("div:nth-child(3)").innerText
return "curl " + url + " --output \"" +name + "." + url.substring(url.lastIndexOf('/') + 1, url.indexOf('?')).split('.').pop() + "\"";
};
await getProfileImage();
var articles = [];
var maps = [];
var execRegex = function (regex, callback, buffer) {
var matches = regex.exec(buffer);
if ((matches?.length ?? 0) > 0) {
callback(matches);
return buffer.replace(regex, "");
}
/*
Steps to draw an SVG to canvas:
* Find the width and height of an SVG
* Clone the SVG node
* Create a blob object from the SVG
* Create a URL for the blob
* Load the URL into an image element
* Create a canvas with width and height of the SVG
* Draw the image to the canvas