Skip to content

Instantly share code, notes, and snippets.

@melissaboiko
melissaboiko / lockwise2bitwarden.py
Created Aug 25, 2021
Alternative Bitwarden importer for Firefox Lockwise passwords, keeps everything into a separate folder
View lockwise2bitwarden.py
#!/usr/bin/env python3
'''lockwise2bitwarden.py:
Converts a Firefox Lockwise export CSV into a Bitwarden-format CSV.
Compared to using the built-in Firefox importer, this will:
- Save everything into a Lockwise-{timestamp} folder, and
- Save some extra Firefox stuff in the Notes field.
(Would be nice to use custom fields for those, but then we need
.json, and then we need to create folders, and then we need API
@melissaboiko
melissaboiko / fediblock-archive-to-glitchsoc.py
Created Jun 27, 2021
injects everything in fediblock.org directly in the glitch-soc blocked domains database
View fediblock-archive-to-glitchsoc.py
#!/usr/bin/env python3
import sys
import psycopg2
import urllib.request
import json
from datetime import datetime
from typing import List
# expects working pgident auth. edit parameters to your own:
database='mastodon_production'
@melissaboiko
melissaboiko / pspsps.py
Last active Mar 13, 2021
pspsps – show catgirls on Linux terminal
View pspsps.py
#!/usr/bin/env python3
# pspsps – show catgirls on Linux terminal
import os
import sys
try:
import ascii_magic
except ModuleNotFoundError:
sys.stderr.write("Install ascii_magic first nya~\n")
sys.stderr.write("pip3 install ascii_magic")
@melissaboiko
melissaboiko / 99dynamic-fonts.el
Created Nov 27, 2020
Code to set emacs font to best font, and workaround some fallback bug by forcing it to certain codeblocks
View 99dynamic-fonts.el
;; default
(progn
(setq melissa/font-default "Iosevka Term SS05 Medium")
(set-face-attribute 'default nil :font melissa/font-default :height 140 :slant 'normal)
;; (setq melissa/font-default "Victor Mono SemiBold")
;; (set-face-attribute 'default nil :font melissa/font-default :height 140 :slant 'italic)
;; (setq melissa/font-default "Iosevka Term SS05 Semibold")
@melissaboiko
melissaboiko / soxbeep.sh
Last active Aug 10, 2020
make fun beep boop sounds
View soxbeep.sh
#!/bin/bash
# usage: soxbeep [N] [duration]
# where N = number of beeps (default 1) and duration = duration in seconds (default 0.2)
# try e.g. soxbeep.sh 7
# c g d a e # penta M
notes=( 323.63 384.87 432.00 513.74 576.65 647.27 769.74 864.00 1027.47 1153.30 1294.54 ) # 1539.47 1728.00)
duration=0.2
function beep() {
View kill-switch.sh
#!/bin/bash
if=tun0
ufw --force reset
ufw default deny incoming
ufw default deny outgoing
ufw allow out on $if from any to any
ufw allow in on $if from any to any
@melissaboiko
melissaboiko / sparkasse-credit.py
Created Jun 1, 2018
Converts Sparkasse CVS file FOR CREDIT CARDS to YNAB4 CVS format.
View sparkasse-credit.py
#!/usr/bin/env python3
# Converts Sparkasse CVS file FOR CREDIT CARDS to YNAB4 CVS format.
#
# For the main account extract, see Markus Seidl's sparkasse.py at
# https://github.com/ma-ver-ick/ynab-converter/
# usage: sparkasse-credit.py umsatz-[number]-[date].CSV credit-ynab4.csv
import os
View watchfila.bash
#!/bin/bash
mailto=admin@ime.usp.br
replyto=admin@ime.usp.br
limit=1000
waitfor=30 # minutes
# debug
if [ "$1" ] && [ "$1" == -d ]; then
limit=10
@melissaboiko
melissaboiko / record-and-play.sh
Last active Dec 18, 2015
script for language learners to record and listen their own voice while studying
View record-and-play.sh
#!/bin/bash
# apt-get install sox
unset ans
tmp=$(mktemp).wav
while true; do
echo -n "Enter to start recording (Ctrl+C to finish), p to play again, q to quit... "
read ans
case "$ans" in
p) play $tmp;;
@melissaboiko
melissaboiko / compile-vocbras.sh
Created Mar 18, 2013
script to adapt "Vocabulário na Língua Brasílica", a 1621 Portuguese / Old Tupi dictionary, from its digitalized wiki version at http://vlb.wikispaces.com/ , to tab-separated and DICT (dictd) formats.
View compile-vocbras.sh
#!/bin/bash
#
# O "Vocabulário na Língua Brasílica", de 1621, é um dicionário jesuíta
# português/tupi antigo. Uma versão digital por Ensjo está disponível em
# http://vlb.wikispaces.com/ .
#
# Este script simples adapta a versão wiki para:
# 1. formato texto .tsv, separado por tabs (bom para grep, cut e afins), e
# 2. formatos .index e .dict para o protocolo DICT (dictd, dict(1) etc.)
#