Skip to content

Instantly share code, notes, and snippets.

View DavideGalilei's full-sized avatar
🐝

Davide Galilei DavideGalilei

🐝
View GitHub Profile
@senderle
senderle / hand-modify-pdf.md
Created September 23, 2020 15:03
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.

@ColinShark
ColinShark / PyroPay.md
Last active October 5, 2024 23:44
Simple demonstration of Payments with Pyrogram

Payments with Pyrogram

[pyrogram]
api_id = 123456
api_hash = 123abc456def789ghi
bot_token = 123456:abcdefg

[paybot]
stripe_token = 123456:TEST:somerandomsecret
@coolreader18
coolreader18 / segfault.py
Last active August 12, 2025 17:18
CPython segfault in 5 lines of code
class E(BaseException):
def __new__(cls, *args, **kwargs):
return cls
def a(): yield
a().throw(E)
@linuxkathirvel
linuxkathirvel / install-oxygen-theme-in-kde-in-fedora30.md
Created October 9, 2019 02:01
Install Oxygen theme in KDE in Fedora 30
sudo dnf update
sudo dnf install oxygen-gtk2.x86_64 oxygen-icon-theme.noarch oxygen-mono-fonts.noarch oxygen-sans-fonts.noarch oxygen-cursor-themes.noarch oxygen-sound-theme.noarch qt5-style-oxygen.x86_64 oxygen-fonts.x86_64 plasma-oxygen.x86_64
@fs0c131y
fs0c131y / get_sqlcipher_password.js
Created January 27, 2019 20:57
Frida script to get the password of a sqlcipher database
/*
* get_sqlcipher_password.js
* Copyright (c) 2019 Elliot Alderson <[email protected]>
*
* Frida.re JS functions to get SQLCipher database passwords.
*
* Example usage:
* # frida -U -f in.gov.uidai.mAadhaarPlus -l get_sqlcipher_password.js --no-pause
*
*/
//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
https://youtu.be/-C-JoyNuQJs?t=39m45s
When I put the reference implementation onto the website I needed to
put a software license on it.
And I looked at all the licenses that were available, and there were a lot
of them. And I decided that the one I liked the best was the MIT License,
which was a notice that you would put on your source and it would say,
"you're allowed to use this for any purpose you want, just leave the
notice in the source and don't sue me."
@joepie91
joepie91 / you-dont-need-a-blockchain.md
Last active May 7, 2024 11:54
You Don't Need A Blockchain

You don't need a blockchain.

If you're reading this, you probably suggested to somebody that a particular technical problem could be solved with a blockchain.

Blockchains aren't a desirable thing; they're defined by having trustless consensus, which necessarily has to involve some form of costly signaling to work; that's what prevents attacks like sybil attacks.

In other words: blockchains must be expensive to operate, to work effectively. This makes it a last-resort solution, when you truly have no other options available for solving your problem; in almost every case you want a cheaper and less complex solution than a blockchain.

In particular, if your usecase is commercial, then you do not need or want trustless consensus. This especially includes usecases like supply chain tracking, ticketing, and so on. The whole *p

@andreaferretti
andreaferretti / nim_magic.py
Created June 14, 2018 14:36 — forked from apahl/nim_magic.py
Nim cell magic for Jupyter and JLab Notebooks
"""
nim_magic.py
Jupyter cell magic for your favorite programming language.
Requirements: Nim (https://nim-lang.org), nimpy (`nimble install nimpy`, thanks to @yglukhov for this great library!)
Just put this file in some Python import dir
and then, in a Jupyter or JLab Notebook: