Skip to content

Instantly share code, notes, and snippets.

@dc740
dc740 / install_dnie.sh
Last active December 24, 2025 15:52
Ubuntu: script para configurar DNIe (España) en Firefox
#!/usr/bin/env sh
sudo apt install libccid opensc pcsc-tools pinentry-gtk2 opensc-pkcs11 libnss3-tools default-jre
sudo systemctl enable --now pcscd.service
mkdir ~/dnie
mkdir ~/dnie/.firefox_profile
mkdir ~/dnie/certificados
cd ~/dnie
curl -A 'Mozilla' -fLC - --retry 3 --retry-delay 3 -o ACRAIZ-DNIE2.zip "https://www.dnielectronico.es/ZIP/ACRAIZ-DNIE2.zip"
@dc740
dc740 / update_discord.sh
Last active October 24, 2022 09:07
Install or update discord from tar.gz
#!/usr/bin/env sh
INSTALL_BASE=$HOME/.local/share
INSTALL_DIR=$INSTALL_BASE/Discord
echo Removing old installation
rm -rf $INSTALL_BASE/Discord
echo Downloading latest version
wget "https://discord.com/api/download?platform=linux&format=tar.gz" -O /tmp/discord.tar.gz
tar -xvf /tmp/discord.tar.gz -C $INSTALL_BASE
@dc740
dc740 / init.nvim
Created December 10, 2021 15:40
Neovim as a Python and Rust IDE with blazing fast autocomplete
" save this file as ~/.config/nvim/init.nvim
" Remember to execute :PlugInstall, and later :COQdeps AFTER you install the depencencies from below.
" External dependencies:
" # install rust+cargo+rust_analyzer BEFORE proceeding.
" # install required dependencies for the plugins
" sudo apt install xclip libclang-dev cmake python3-dev build-essential
" sudo pip3 install pynvim pyright
" # install the nerd font you prefer.
" https://www.nerdfonts.com/font-downloads
@dc740
dc740 / inject_vector_checksum.py
Created May 22, 2020 03:31
Inject LPC vector checksum in files to remove openOCD warning. Run it before flashing.
#!/usr/bin/env python3
import argparse
def calculate_checksum(file1):
BIT_LEN = 32
NUM_INTS = 1 << BIT_LEN # 0b1000000
BIT_MASK = NUM_INTS - 1 # 0b111111
checksum=0;
for i in range(0, 7):