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.
{ | |
"dependencies": { | |
"@actual-app/api": "^6.7.0", | |
"dotenv": "^16.4.5", | |
"openai": "^4.33.0" | |
} | |
} |
# Bun is now officially supported and these environments variables are no longer needed. Keeping this gist for legacy purposes. | |
# SKIP_DEPENDENCY_INSTALL=true | |
# UNSTABLE_PRE_BUILD=asdf install bun latest && asdf global bun latest && bun i |
library(tidyverse) | |
library(paletteer) | |
library(gt) | |
pizzaplace %>% | |
mutate(type = case_when( | |
type == "chicken" ~ "chicken (pizzas with chicken as a major ingredient)", | |
type == "classic" ~ "classic (classical pizzas)", | |
type == "supreme" ~ "supreme (pizzas that try a little harder)", | |
type == "veggie" ~ "veggie (pizzas without any meats whatsoever)", |
I've had some fun ruining Python recently, but Python is what I use at work. I prefer to use other languages when I'm doing stuff for fun.
And obfuscation only really makes sense in fun and competition - given a suffeciently determined actor, your code will be reverse engineered. Unless you write it in Malboge.
For this particular experiment, I'll be using Lua 5.3. As I'll probably need to dive into some of the less portable functions to commit our atrocities, I can't guarantee it will run on other popular versions like Luajit or 5.1.
Obfuscation isn't difficult in most programming languages. It's why we have "good practices" because it is so easy to hide what you mean in badly written code.
Obfuscation tends to be even easier in dynamic languages because of how forgiving they tend to be - and because they tend to give you direct access to the environment so that you can manipulate it.
Today, for fun, I'm going to obfuscate this code:
def _(n):
if n <= 0:
More recent resolution: | |
1. cd ~/../../etc (go to etc folder in WSL). | |
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line). | |
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line). | |
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian). | |
5. cd ~/../../etc (go to etc folder in WSL). | |
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file). | |
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and | |
secondary. |
// %%javascript | |
window.executePython = function(python) { | |
return new Promise((resolve, reject) => { | |
var callbacks = { | |
iopub: { | |
output: (data) => resolve(data.content.text.trim()) | |
} | |
}; | |
Jupyter.notebook.kernel.execute(`print(${python})`, callbacks); | |
}); |
The PATH
is an important concept when working on the command line. It's a list
of directories that tell your operating system where to look for programs, so
that you can just write script
instead of /home/me/bin/script
or
C:\Users\Me\bin\script
. But different operating systems have different ways to
add a new directory to it:
- The first step depends which version of Windows you're using:
- If you're using Windows 8 or 10, press the Windows key, then search for and
TL;DR: Edit .travis.yaml
to install Anaconda and to run conda_upload.sh
after testing. Edit meta.yaml
to take in the environmental variables $VERSION
and $CONDA_BLD_PATH
. Create conda_upload.sh
which sets the needed environmental variables, builds the tar archive, and uploads it to Anaconda. Finally edit some stuff on your Anaconda and Travis CI account so they can talk.
The following steps will detail how to automatically trigger Anaconda builds and uploads from Travis CI. This will only upload successful builds in the master branch and if there are multiple commits in a single day, it'll only keep the latest one. Both of these settings can easily be changed.
First, edit .travis.yml
so that it installs Anaconda.
install: