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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
"""Script to draw bounding boxes and text from a Tesseract box file. | |
The script takes an image TIFF_FILE, draws the text and bounding boxes | |
of the corresponding BOX_FILE and saves the resulting OUT_FILE. | |
Tesseract box file columns: | |
<symbol> <left> <bottom> <right> <top> <page> |
- Find out where your WoW directory is installed (i.e.
C:\Blizzard\World of Warcraft\
). - Install Git for Windows.
- Download [https://gist.githubusercontent.com/mahmoudimus/24c0d7c57abf8118a67b3bf89f1308ba/raw/48cf40254f65d9f9febef4f2f3264b3c438bab27/Utils.lua.patch] to your
_retail_/Interface/AddOns/!KalielsTracker
folder. - Run
git apply --whitespace=fix Utils.lua.patch
. You can read more about this here: stackoverflow.com/a/40919520/13351
(This is a translation of the original article in Japanese by moratorium08.)
(UPDATE (22/3/2019): Added some corrections provided by the original author.)
Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/opt/jabba/jdk/openjdk@1.17/bin/java -Xms30g -Xmx30g -XX:+UseG1GC -XX:+PrintCodeCache -XX:NonProfiledCodeHeapSize=512m -XX:NonNMethodCodeHeapSize=32m -XX:ReservedCodeCacheSize=2g -XX:InitialCodeCacheSize=512m -XX:CodeCacheExpansionSize=2m -XX:+PrintFlagsFinal | |
[Global flags] | |
int ActiveProcessorCount = -1 {product} {default} | |
uintx AdaptiveSizeDecrementScaleFactor = 4 {product} {default} | |
uintx AdaptiveSizeMajorGCDecayTimeScale = 10 {product} {default} | |
uintx AdaptiveSizePolicyCollectionCostMargin = 50 {product} {default} | |
uintx AdaptiveSizePolicyInitializingSteps = 20 {product} {default} | |
uintx AdaptiveSizePolicyOutputInterval = 0 {product} {default} | |
uintx AdaptiveSizePolicyWeight = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import struct | |
import math | |
# Constants | |
# Internal (LEB128 buffer) | |
MAX_ULEB_SIZE = 256 # Maximum proto size here is 2^7^256 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import idautils | |
import idc | |
import ida_bytes | |
from pprint import pprint, pformat | |
def demangle_name(name): | |
return idc.Demangle(name, idc.GetLongPrm(idc.INF_SHORT_DN)) or name | |
def get_primary_vtables(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
[search folders] | |
folder_1 = | |
folder_2 = | |
[ignore paths] | |
C:\Users\documents\scripts\example script name.ahk | |
C:\Users\documents\scripts\example folder name | |
[settings] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
#if !defined(__STDC__) || !defined(__STDC_VERSION__) | |
puts("This compiler is garbage."); | |
#elif (__STDC_VERSION__ >= 201112L) | |
#if (__STDC_NO_VLA__==1) | |
puts("This compiler is mighty strange but compliant."); | |
#else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Autohotkey Capslock Remapping Script | |
; - Deactivates capslock for normal (accidental) use. | |
; - Hold Capslock and drag anywhere in a window to move it (not just the title bar). | |
; - Access the following functions when pressing Capslock: | |
;Cursor keys - h, j, k, l | |
;Home,End - N, ; | |
;Page up,down - - = | |
;Esc - CapsLock only | |
;CapsLock - Space |