Skip to content

Instantly share code, notes, and snippets.

View leodutra's full-sized avatar
🦙
Llama and other LLMs

Leo Dutra leodutra

🦙
Llama and other LLMs
View GitHub Profile
@leodutra
leodutra / pi-hole-blacklist
Last active September 10, 2019 08:07
Pi-hole blacklist
# Basic tracking list by leodutra
# License: MIT
# Contact: leodutra.br [at] gmail.com
www.serveradx.com
@leodutra
leodutra / enable-WSL2.ps1
Last active August 19, 2021 17:51
Enable Windows Subsystem Linux 2 ( WSL 2 )
# AS ADMIN
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
# Use this command to convert a distro to use the WSL 2 architecture or use the WSL 1 architecture.
# <Distro>: the specific Linux distro (e.g. “Ubuntu”)
# <Version>: 1 or 2 (for WSL 1 or 2)
# wsl --set-version <Distro> <Version>
# Changes the default install version (WSL 1 or 2) for new distributions.
@leodutra
leodutra / Office_kms
Created August 28, 2019 05:46 — forked from CHEF-KOCH/KMS_office.cmd
KMS server Windows
cd\Program Files\Microsoft Office\Office16
cd\Program Files (x86)\Microsoft Office\Office16
cscript OSPP.VBS /sethst:kms.digiboy.ir
cscript OSPP.VBS /actcscript OSPP.VBS /dstatus
slmgr.vbs /ckms
@leodutra
leodutra / buffer-from-data-uri.js
Created July 2, 2019 09:58
Node.js Buffer from Data URI
function bufferFromDataURI(dataURI) {
const [, mimeType, encoding, data] = dataURI.match(
/^data:((?:[^,](?!,|;base64))*[^,])?(?:;(base64))?,(.+)/im
)
return {
mimeType: mimeType,
data: encoding
? Buffer.from(data, encoding)
: data
}
@leodutra
leodutra / satoshistreasure.md
Created June 29, 2019 18:30 — forked from johncantrell97/satoshistreasure.md
How I Obtained Satoshi's Treasure Keys 1, 2, and 3 in Minutes

Today (April 16th 2019 at noon) the first major clues to discover key #1 was set to be released in a few cities. A QR code with the words 'orbital' were found at these locations and looked like this: (https://imgur.com/a/6rNmz7T). If you read the QR code with your phone you will be directed to this url: https://satoshistreasure.xyz/k1

At this URL you are prompted to input a passphrase to decrypt the first shard. An obvious first guess was to try the word 'orbital' from the QR code. Not suprisingly this worked! This reveals a congratulations page and presents the first key shard:

ST-0001-a36e904f9431ff6b18079881a20af2b3403b86b4a6bace5f3a6a47e945b95cce937c415bedaad6c86bb86b59f0b1d137442537a8.

Now, we were supposed to wait until April 17th to get clues from the other cities for keys #2 and #3 but that wouldn't stop me from digging around with all the new information we had. All that time "playing" notpron (http://notpron.org/notpron/) years ago was going to help me here.

The first thing I noticed was

@leodutra
leodutra / index.js
Last active November 5, 2022 23:21 — forked from shospodarets/Chrome headless Puppeteer- capture DOM element screenshot using
Capture DOM elements screenshot using Chrome headless
const puppeteer = require('puppeteer')
// Related Issues:
// 3118 - https://github.com/GoogleChrome/puppeteer/issues/3118#issuecomment-417754246
async function main() {
const browser = await puppeteer.launch({
args: ['--start-maximized'],
headless: false,
defaultViewport: null
@leodutra
leodutra / etc-systemd-system-noip2.service
Created June 25, 2019 15:16
No-IP 2 restart on boot Ubuntu 18.04
[Unit]
Description=noip2 service
[Service]
Type=forking
ExecStart=/usr/local/bin/noip2
Restart=always
[Install]
WantedBy=default.target
@leodutra
leodutra / vscode-extensions.bat
Last active April 20, 2024 17:39
My Visual Studio Code Extensions for Windows and Linux (vscode ext)
call code --install-extension alefragnani.bookmarks
call code --install-extension amandeepmittal.pug
call code --install-extension amazonwebservices.aws-toolkit-vscode
call code --install-extension angular.ng-template
call code --install-extension bierner.markdown-preview-github-styles
call code --install-extension coenraads.bracket-pair-colorizer-2
call code --install-extension cweijan.vscode-office
call code --install-extension DavidAnson.vscode-markdownlint
call code --install-extension dbaeumer.vscode-eslint
call code --install-extension eamodio.gitlens
@leodutra
leodutra / match-pattern.js
Last active May 25, 2019 17:25
Regular expression matcher (RegExp + match as generator function) #regex
function matchPattern(str, regexp, fn) {
const regexpClone = new RegExp(
regexp.source,
regexp.flags ||
(regexp.global ? 'g' : '') +
(regexp.ignoreCase ? 'i' : '') +
(regexp.multiline ? 'm' : '') +
(regexp.dotAll ? 's' : '') +
(regexp.unicode ? 'u' : '') +
(regexp.sticky ? 'y' : '')
@leodutra
leodutra / unfollow-instagram.js
Created February 10, 2019 01:40
Instagram - auto unfollow
// open "following" on web browser
async function main() {
const buttons = document.querySelectorAll('button')
for (let button of buttons) {
if (button.textContent.trim().toLowerCase() === 'seguindo') {
button.click()
await wait(5000)
const unfollowBtns = document.querySelectorAll('button')
for (let x of unfollowBtns) {
if (x.textContent.trim().toLowerCase() === 'deixar de seguir') {