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.
{lib, ...}: { | |
toBase64 = text: let | |
inherit (lib) sublist mod stringToCharacters concatMapStrings; | |
inherit (lib.strings) charToInt; | |
inherit (builtins) substring foldl' genList elemAt length concatStringsSep stringLength; | |
lookup = stringToCharacters "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | |
sliceN = size: list: n: sublist (n * size) size list; | |
pows = [(64 * 64 * 64) (64 * 64) 64 1]; | |
intSextets = i: map (j: mod (i / j) 64) pows; | |
compose = f: g: x: f (g x); |
# Syntax | |
nix run github:<owner>/<repo>/<revision>#<executable> | |
# Examples | |
## Specific commit ID | |
nix run github:DeterminateSystems/riff/a71a8b5ddf680df5db8cc17fa7fddd393ee39ffe | |
## Tag |
Running into this error message when trying to run a mosh server on macOS Catalina? The steps below should solve the problem which is most likely either a $PATH and/or firewall issues.
command not found: mosh-server
Connection to X.X.X.X closed.
/usr/local/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)
#!/bin/bash | |
## postinstall script to remove CCDA applications | |
# remove any existing version of the tool | |
echo "Moving the CC Cleaner app to Utilities in case users need it later" | |
rm -rf /Applications/Utilities/Adobe\ Creative\ Cloud\ Cleaner\ Tool.app ||: | |
mv /Applications/Adobe\ Creative\ Cloud\ Cleaner\ Tool.app /Applications/Utilities/Adobe\ Creative\ Cloud\ Cleaner\ Tool.app | |
# run the cleaner tool to remove EVERYTHING! | |
echo "Running the CC Cleaner app with 'removeAll=All' option" |
Download and run the Adobe Creative Cloud Cleaner Tool, their multi-app uninstaller and wipe assistant. Adobe does recommend running individual application uninstallers first, your call. Click the Clean All option.
Type a one line command in terminal find ~/ -iname "*adobe*"
and it's shows up all files which match pattern.
To remove all files
`sudo rm -rf /Applications/Adobe* /Applications/Utilities/Adobe* /Library/Application\ Support/Adobe /Library/Preferences/com.adobe.* /Library/PrivilegedHelperTools/com.adobe.* /private/var/db/receipts/com.adobe.* ~/Library/Application\ Support/Adobe* ~/Library/Application\ Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.adobe* ~/Library/Application\ Support/CrashReporter/Adobe* ~/Library/Caches/Adobe ~/Library/Caches/com.Adobe.* ~/Library/Caches/com.adobe.* ~/Library/Cookies/com.adobe.* ~/Library/Logs/Adobe* ~/Librar
I have found that Adobe services still worked fine after doing this, but your milage may vary, so be sure to have a back-up of your original install media or whatever.
You may or may not have these services, you can lookup what is running on your machine with launchctl list |grep -i adobe
also run with sudo
to find what is running at higher privledges.
launchctl stop com.adobe.acc.AdobeDesktopService.2252.965FE800-C621-41D6-898D-821201FB2F8A
# I have 3 btrfs subvolume /root, /home, /nix-store and these are used as the name suggest | |
# Now, when i create new nixos configuration i can make a snapshot of root and home, before i switch to a new config. | |
CURRENT_GENERATION=`readlink /nix/var/nix/profiles/system | cut -d'-' -f2`; echo Determined current generation: $CURRENT_GENERATION | |
sudo mkdir -p /btrfs | |
# the / is not mounted in my btrfs filesystem by default, because my filesystem root is the /root subvolume | |
sudo mount /dev/mapper/NixOS /btrfs | |
sudo btrfs subvolume snapshot /btrfs/root /btrfs/root-$CURRENT_GENERATION-snapshot | |
# I also make a snapshot of home, because i use gnome or KDE, which contains a lots of config and cache, which can broke by a rollback. | |
sudo btrfs subvolume snapshot /btrfs/home /btrfs/home-$CURRENT_GENERATION-snapshot |
// This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally | |
package main | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/x509" | |
"encoding/pem" | |
"golang.org/x/crypto/ssh" |
#!/bin/bash -xe | |
# Below command can be replaced to the required CLI, including with custom JSON output, assuming the NextToken is in the same location. | |
AWS_CLI_COMMAND="aws elasticbeanstalk list-platform-versions --max-records 100 --query={NextToken:NextToken,PlatformARNs:PlatformSummaryList[*].PlatformArn}" | |
OUTPUT_FILE="./output-$(date +%s)" | |
function CLI_call() { | |
if [ ! -v NEXT_TOKEN ]; then | |
cli_output=$($AWS_CLI_COMMAND) | |
else |