Skip to content

Instantly share code, notes, and snippets.

View David-Lor's full-sized avatar
🐍
entro.py

David Lorenzo David-Lor

🐍
entro.py
  • Vigo/Galiza/Spain
View GitHub Profile
@cmj
cmj / nitter-guest_accounts.py
Created September 18, 2023 14:21
Populate guest_accounts.json for Nitter
#!/usr/bin/env python3
# Populate guest_accounts.json for use with Nitter
# Source @OrangeFlavored https://github.com/zedeus/nitter/issues/983#issuecomment-1715487727
import os
import json
import requests
from datetime import datetime, timedelta
from dateutil.parser import parse as parsedate
from time import sleep
@bcdonadio
bcdonadio / static_cgo.md
Last active January 27, 2023 13:50 — forked from zmb3/static_cgo.md
Compile static binaries for Go programs that leverage Cgo.

In order to compile a fully static binary when using Cgo you'll need to use another standard C library like musl instead of the GNU libc, because Canonical and others simply decided that most of the whole damn point of using Golang, which is having a multi-platform and almost universal build toolchain, is simply not to their tastes.

A solution then is to do this messy thingy:

apt update && apt build-dep -y musl
MUSL_VER=2.2.2 # Matches Ubuntu 22.04 "Jammy" as of 2023-01-06
DIR=$(mktemp -d)
pushd $DIR
wget https://www.musl-libc.org/releases/musl-${MUSL_VER}.tar.gz -O musl.tar.gz
@taskylizard
taskylizard / fmhy.md
Last active June 26, 2024 22:20
/r/freemediaheckyeah, in one single file (view raw)
@Rachniotov
Rachniotov / README.md
Last active September 6, 2022 09:50
Darkmode for Mongodb Compass!

Introduction

So I used Mongodb Compass for a little time a few months ago and then i switched to another mongo client gui for the sole reason, Darkmode. That mongo client was good but recently it became paid. I then switched back to Compass but my eyes couldnt take it 😩

Then I spent some time researching what could I do to make compass darker and easier to read and I found this npm package for the Darkreader chrome plugin. I knew that compass was made in Electron as it had .asar files in its source, that means I could easily implemt that npm package into the Electron app.

@aojea
aojea / Dockerfile
Last active December 27, 2023 16:11
Using crio runtime in KIND
ARG IMAGE=kindest/node
ARG VERSION=1.19
ARG MINOR=1
ARG OS=xUbuntu_20.04
FROM ${IMAGE}:v${VERSION}.${MINOR}
ARG VERSION
ARG OS
@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@jsdario
jsdario / el_quijote.txt
Last active June 9, 2024 10:38
El Quijote en texto plano
This file has been truncated, but you can view the full file.
DON QUIJOTE DE LA MANCHA
Miguel de Cervantes Saavedra
PRIMERA PARTE
CAPÍTULO 1: Que trata de la condición y ejercicio del famoso hidalgo D. Quijote de la Mancha
En un lugar de la Mancha, de cuyo nombre no quiero acordarme, no ha mucho tiempo que vivía un hidalgo de los de lanza en astillero, adarga antigua, rocín flaco y galgo corredor. Una olla de algo más vaca que carnero, salpicón las más noches, duelos y quebrantos los sábados, lentejas los viernes, algún palomino de añadidura los domingos, consumían las tres partes de su hacienda. El resto della concluían sayo de velarte, calzas de velludo para las fiestas con sus pantuflos de lo mismo, los días de entre semana se honraba con su vellori de lo más fino. Tenía en su casa una ama que pasaba de los cuarenta, y una sobrina que no llegaba a los veinte, y un mozo de campo y plaza, que así ensillaba el rocín como tomaba la podadera. Frisaba la edad de nuestro hidalgo con los cincuenta años, era de complexión recia, seco de carnes, enjuto de r
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@matriphe
matriphe / ssh-telegram.sh
Last active May 7, 2023 15:00
Bash Script to notify via Telegram Bot API when user log in SSH
# save it as /etc/profile.d/ssh-telegram.sh
# use jq to parse JSON from ipinfo.io
# get jq from here http://stedolan.github.io/jq/
USERID="<target_user_id>"
KEY="<bot_private_key>"
TIMEOUT="10"
URL="https://api.telegram.org/bot$KEY/sendMessage"
DATE_EXEC="$(date "+%d %b %Y %H:%M")"
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt'
if [ -n "$SSH_CLIENT" ]; then
@Zearin
Zearin / python_decorator_guide.md
Last active June 5, 2024 20:26
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].