Skip to content

Instantly share code, notes, and snippets.

@myyc
myyc / pdfwatermark.md
Created September 3, 2024 11:55
How to remove a watermark from a PDF

How to remove a watermark from a PDF

We've all downloaded a PDF from somewhere that some idiot (or Google) put a watermark on, to mark their territory somehow. Here's how you might want to proceed.

You might have to install a few tools, mainly pdftk, qpdf and mupdf-tools.

Assume that commands are chained, so input.pdf of any command is the output.pdf of the previous one (if applicable).

@myyc
myyc / how_to_crack_ebooks.md
Last active May 14, 2024 02:33
How to crack ebooks

How to crack ebooks on Linux

If you made the mistake of buying Kindle ebooks and you don't have an iPad or a Kindle to read them on, or if you decided to buy ebooks off a third party reseller and realised they aren't epubs but some bullshit "Adobe DRM" file, this guide is for you.

Adobe DRM

If you have an (unopened) Adobe DRM ebook, forget DeDRM and similar tools,

@myyc
myyc / win_gog_arch_linux.md
Last active April 29, 2024 13:50
Manually install recent Windows GOG games on Arch Linux

If you're gaming on Linux you should probably use Steam. This is pathetic as GOG's initial selling point was "fuck DRM" and all that, but nowadays probably because of the Steam Deck Steam's Windows launcher on Linux is just seamless.

If you made the mistake of buying Windows games on GOG because you thought no DRM was a good idea, well, this guide is for you.

First things first, the setup

  • Recent hardware. Good CPU and recent-enough GPU (I have a Nvidia 3060 Ti).
@myyc
myyc / arch_linux_install_guide.md
Last active October 26, 2024 20:06
Arch Linux setup with all the good stuff (Plymouth, encryption, systemd-boot etc.)

I've used this guide through 2024 despite archinstall and it's still more or less valid. After having used archinstall twice and having encountered obscure issues (luksOpen taking ages, or slow reboots in general) I switched back to a manual setup and it seems to be almost as straightforward.

Always refer to the official guide in case of doubt.

First things first

One important thing first: the environment you will encounter on the live image is very different from what you'll end up installing, some things are significantly easier there: e.g. wifi tools come

@myyc
myyc / esp32_telegram_hi.ino
Last active January 20, 2021 09:39
esp32_telegram_hi
/*
* "params.h"
* const char* ssid = "your SSID";
* const char* password = "wpa password";
* const String token = "telegram_bot_token";
* const String to_id = "numeric telegram id of the recipient";
*/
#include "params.h"
#include <WiFi.h>
@myyc
myyc / genpasswd.py
Last active April 9, 2019 15:52
a password generator
#!/usr/bin/env python3
import random
def genpasswd() -> str:
nc = random.randint(36, 48)
rc = []
for l in ([chr(65+i) for i in range(26)], # uppercase
[chr(97+i) for i in range(26)], # lowercase
@myyc
myyc / ucldraw.py
Last active December 8, 2017 13:14
chelsea is 66.667% fucked
import pandas as pd
import numpy as np
import seaborn as sns
from ipywidgets import interact, RadioButtons as RB
fs = [("Barcelona", "ESP","D"), ("Beşiktaş", "TUR","G"),
("Liverpool", "ENG","E"),
("City", "ENG","F"), ("Man U", "ENG","A"),
("PSG","FRA","B"), ("Roma", "ITA","C"),
("Tottenham", "ENG","H")]
@myyc
myyc / f.py
Created November 1, 2016 14:56
from functools import wraps
def c(f):
@wraps(f)
def w(k):
if k in d:
return d[k]
else:
d[k] = f(k)
return d[k]
@import url("base.css"); /* Happy16 Light theme */
body {background-color: #f9f9f9;}
.container { min-width:60% !important; }
.output_svg div {
width: 100% !important;
height: 100% !important;
}
#!/usr/bin/env zsh
log=/tmp/pybs.log
pip=/opt/local/bin/pip3.6
pkgs=("pip" "numpy" "scipy" "pandas" "matplotlib" "seaborn")
autoload -Uz colors && colors
function y() {
echo "[$fg[$1]$2$reset_color]\t"