Skip to content

Instantly share code, notes, and snippets.

View afonsoguerra's full-sized avatar

José Afonso Guerra-Assunção afonsoguerra

View GitHub Profile
@afonsoguerra
afonsoguerra / koreader_on_tolino.md
Created July 1, 2024 12:11 — forked from hasezoey/koreader_on_tolino.md
Install KOReader on a Tolino device (Vision 5)

Install KOReader on a Tolino Device

Tolino Debug Menu codes

For KOReader (or any other APK) to be installed on a Tolino device, the debug menu has to be enabled:

  • if the tolino is on system version 14, search for code 124816 source
  • if the tolino is on system version 15, search for code 1123581321 source
  • if the tolino is on system version 16, search for code 112358132fb source

Note: "searching" as in the search for books on the tolino itself (the magnifying glass in the top bar)

# Why?
# To paste text into windows that normally don't allow it or have access to the clipboard.
# Examples: Virtual machines that do not yet have tools installed, websites that hijack paste
#
# Extended vs Simple?
# * Includes an initial delay to allow you to change active windows
# * Adds small delay between keypresses for slower responding windows like SSH sessions
# * Better handling of numbers
# * VMWare bug fix
#
@afonsoguerra
afonsoguerra / setup-dashbutton.py
Created December 16, 2023 09:39 — forked from fffonion/setup-dashbutton.py
Setting up dash button without Amazon App
import requests
import re
import sys
# Initial work from: https://mpetroff.net/2016/07/new-amazon-dash-button-teardown-jk29lp/
h = requests.Session()
BASE_URL = "http://192.168.0.1"
@afonsoguerra
afonsoguerra / paper-qa-zotero.py
Created October 16, 2023 10:19 — forked from lifan0127/paper-qa-zotero.py
Streamlining Literature Reviews with Paper QA and Zotero
import os
os.environ['OPENAI_API_KEY'] = '<Your OpenAI API Key>'
# See here on how to find your Zotero info: https://github.com/urschrei/pyzotero#quickstart
ZOTERO_USER_ID = '<Your Zotero User ID>'
ZOTERO_API_KEY = '<Your Zotero API Key>'
ZOTERO_COLLECTION_ID = '<Your Zotero Collection ID>'
question = 'What predictive models are used in materials discovery?'
# The following prompt instruction is injected to limit the number of keywords per query
@afonsoguerra
afonsoguerra / qnap-clientenc-decrypt.sh
Created September 25, 2023 09:01 — forked from dguerri/qnap-clientenc-decrypt.sh
Quick shell script to decrypt client-side encrypted file using QNAP HBS *Sync* jobs. Only work with version 2 files - Doesn't work with QNAP HBS Backup jobs!
#!/bin/sh
set -ue
[ "$#" -lt 2 ] && { echo "Syntax: $0 <filename> <key>"; exit 1; }
filename="$1"
key="$2"
# Compose the key by repeating the user input until we have 32 characters (64 hex digits)
@afonsoguerra
afonsoguerra / HFS.md
Created September 1, 2023 07:22 — forked from r0mdau/HFS.md
How to recover pictures and files from failed MacOS / HFS+ hard drive with Linux

How to recover pictures and files from failed MacOS / HFS+ hard drive with Linux

A couple months ago, a friend ask me to repair a failing macintosh.

It appears the hard drive has multiple failures from SMART anlysis.

Next reboot... Oh crap, the operating system does not start anymore. The drive contains 10 years of pictures to recover. A heart pinch :'(

Important thing to know, if (certainely) the disk is crypted and you don't know the principal user login password,

@afonsoguerra
afonsoguerra / read_vcf.py
Created April 27, 2023 08:07 — forked from dceoy/read_vcf.py
[Python] Read VCF (variant call format) as pandas.DataFrame
#!/usr/bin/env python
import io
import os
import pandas as pd
def read_vcf(path):
with open(path, 'r') as f:
lines = [l for l in f if not l.startswith('##')]
@afonsoguerra
afonsoguerra / igv_test_bat.md
Created April 28, 2022 06:50 — forked from stevekm/igv_test_bat.md
Sample Batch Script for IGV Snapshots
@afonsoguerra
afonsoguerra / star.scad
Created August 4, 2021 14:56 — forked from anoved/star.scad
OpenSCAD pointed star module
// points = number of points (minimum 3)
// outer = radius to outer points
// inner = radius to inner points
module Star(points, outer, inner) {
// polar to cartesian: radius/angle to x/y
function x(r, a) = r * cos(a);
function y(r, a) = r * sin(a);
// angular width of each pie slice of the star
@afonsoguerra
afonsoguerra / UCL_Eduroam.md
Created March 19, 2018 12:10 — forked from Jimbles/UCL_Eduroam.md
UCL Eduroam on Raspberry Pi

UCL Eduroam on Raspberry Pi

add this to /etc/wpa_supplicant/wpa_supplicant.conf

network = {
ssid="eduroam"
key_mgmt=WPA-EAP IEEE8021X
eap=PEAP
identity="#####@ucl.ac.uk"
anonymous_identity="anonymous@ucl.ac.uk"