algorithms (24)
AES-GCM and breaking it on nonce reuse »
A good explanation of the arithmetics in AES/GCM (Galois Counter Mode).
Sir, there's a cat in your mirror dimension »
This makes you wonder: if the frequency-domain representation of a typical image looks like diffuse noise, if most of it is perceptually unimportant, and if the transform is just a lever that takes us back and forth between two functionally-equivalent dimensions… could we start calling that mirror dimension home and move some stuff in?
To answer this stoner question, I grabbed a photo of a cat and then calculated its frequency-domain form with the discrete cosine transform (DCT) [...] Next, I reused the photo of a woman from an earlier example and placed the mirror-dimension “cat noise” pattern over it, dialing down opacity to minimize visible artifacts [...]
https://lcamtuf.substack.com/p/sir-theres-a-cat-in-your-mirror-dimension
Fast character case conversion »
QOI - The "Quite OK Image" format for fast, lossless image compression »
Interesting things: the overall simplicity and the chunk QOI_OP_LUMA, which implements diff compression from previous byte giving more weight to the green channel.
Compressing and embedding a Wordle word list »
Another very interesting essay by Chris Wellons on methods of compressing and storing a Wordle word database list:
What's Inside the EU Green Pass QR Code? »
Shrink, Reduce, and Implode: The Legacy Zip Compression Methods »
Hans Wennborg:
Zip files support many different compression methods, however, and although Deflate is the one most commonly used today, it was not added until several years after the introduction of the Zip file format. While the earlier methods are not in themselves relevant today, the techniques involved are still both interesting and relevant. For example, the first method used LZW compression, which popularised dictionary compression, gained notoriety due to patent issues, and is still widely used in GIF files. From a historical perspective, the older methods allow us to trace the evolution from the roots of PKZip to the Deflate method that we use today.
State machines are wonderful tools »
Chris Wellons:
I love when my current problem can be solved with a state machine. They’re fun to design and implement, and I have high confidence about correctness [...]
Inspired by a puzzle, I came up with this deterministic state machine for decoding Morse code. It accepts a dot ('.'), dash ('-'), or terminator (0) one at a time, advancing through a state machine step by step [...]
Scroll Back: The Theory and Practice of Cameras in Side-Scrollers »
You might not need machine learning »
An implementation of the ChaCha20 algorithm in Bash »
This is an implementation of the ChaCha20 algorithm in Bash Script.
"chacha20.sh
by zx2c4
You probably shouldn't use this for anything."
Web Demo of the Voxel Space Engine »
Comanche uses a technique called Voxel Space, which is based on the same ideas like of ray casting.
Dissecting the GZIP format »
How to Write a Spelling Corrector »
Floyd's linked list detection algorithm »
Computer Archeology: Space Invaders »
Levenshtein distance »
The Levenshtein distance between two strings is defined as the minimum number of edits needed to transform one string into the other, with the allowable edit operations being insertion, deletion, or substitution of a single character.
A lecture on a Bayes Classifier »
A Better Strategy for Hangman »
Treaps: a simple balanced binary tree »
Understanding Pac-Man Ghost Behavior »
Math explanation of the JPEG format »
Dictionary of Algorithms and Data Structures »
artwork (27)
Old Book Illustrations »
"Old Book Illustrations was born of the desire to share illustrations from a modest collection of books, which we set out to scan and publish."
Bouletcorp »
Zdzisław Beksiński (more) »
Dark Classics »
Óscar Sanmartín »
The Zoomquilt 2 »
The Zoomquilt 1 »
Mathew Borrett »
Sailor Twain or The Mermaid in the Hudson »
http://sailortwain.com/ [500]
Pawel Kuczynski »
Michael Hutter »
Don Kenn »
Franz Sedlacek »
Things could be worse (Tragedy series) »
Incidental Comics »
Claude Lazar »
Zdzislaw Beksinski »
Jacek Yerka »
Chapman Brothers - The Fucking Hell »
Brian Despain »
Chris Ryniak »
Shaun Tan »
Mark Ryden »
Ray Caesar »
fish / вавилон »
assembler (3)
asshole corporations (5)
The 2020 Linux Foundation annual report »
The Linux Foundation 2020 Report document was written on a Mac with MacOS. Why are you a fucking lie, Linux Foundation?
https://daniel-lange.com/archives/166-No-dog-food-today-the-Linux-Foundation-annual-report.html
HP Invents Printer-As-A-Service »
HP has reached a new level on motherfuckery:
HP has begun a new program called the "HP Instant Ink" plan. Under this plan, printers monitor how many pages are printed, and HP bills customers monthly. If a customer does not pay his bill, his Instant Ink cartridge stops working. [...] And, according to Paragraph 10a of HP's terms of service agreement, HP makes no guarantees that Instant Ink cartridges will arrive on time or that they will work. So, if the inkjets in a cartridge clog, HP is not responsible.
https://cheapskatesguide.org/articles/printer-as-a-service.html
It’s Time for Twitter to Die »
If Zoom Is Wrong, So Is Apple »
Jeffrey Paul on sleazy lies Zoom and Apple try to make us swallow:
Apple (and the FBI and US military intelligence, by extension) can easily look at your photos, see the genitals of yourself and your loved ones, read your private notes, and read all of your message history, including iMessages and SMSes!
[...]
Apple, like Zoom, has danced around this, saying that your chat histories in your device backups and private notes and photos are “encrypt[ed] in transit” and “encrypt[ed] on server”.
In both cases, they’re encrypted with Apple’s keys, not yours. This is exactly the same situation as Zoom’s current encryption, and it’s exactly as unacceptable, for exactly the same reasons.
As it's said there, If Zoom is wrong for doing this, then so is Apple, and they should be subject to the same criticism
, but people is always unexplainably indulgent with Apple's bullshit.
macOS 10.15: Slow by Design »
I just can't believe this:
Apple has introduced notarization, setting aside the inconvenience this brings to us developers, it also results in a degraded user experience, as the first time a user runs a new executable, Apple delays execution while waiting for a reply from their server. This check for me takes close to a second.
This is not just for files downloaded from the internet, nor is it only when you launch them via Finder, this is everything. So even if you write a one line shell script and run it in a terminal, you will get a delay!
[...]
Honestly, this is downright baffling. Are Apple sending the source of all my custom scripts to their server? With their stance on privacy, I wouldn’t think so, so they are likely just sending a checksum, but what are they doing with that checksum that the system couldn’t do locally?
If this is true it must be the biggest perverseness and assholery ever seen in the computing world (coming from Apple is not that all surprising, though).
https://sigpipe.macromates.com/2020/macos-catalina-slow-by-design/
c (29)
Opening X11 windows in linux with sockets, bare hands and 200 lines of C »
GitHub - tidwall/neco: Concurrency library for C (coroutines) »
My personal C coding style as of late 2023 »
A simple, arena-backed, generic dynamic array for C »
An easy-to-implement, arena-friendly hash map »
Arena allocator tips and tricks »
Translucent typedefs in C »
The established terminology here is subtyping: we want
dchar *
to be a subtype ofchar *
, so that everydchar *
is-achar *
, but not everychar *
is-adchar *
.[...] There is a widely-supported C extension that sort of acts like subtyping: aligned types.
typedef __attribute__((aligned(2))) char dchar;
Turns are Better than Radians »
In turns, 0 is 0 degrees, 0.5 is 180 degrees, 1 is 360 degrees, 2 is 720 degrees, and so on. [...]
Seen mentioned in Faster accurate range reduction.
https://www.computerenhance.com/p/turns-are-better-than-radians
My favorite C compiler flags during development »
Practical libc-free threading on Linux »
Few lesser known tricks, quirks and features of C »
The quick and practical "MSI" hash table »
My new debugbreak command »
Includes some notes on breaking programs being debugged on Windows and UNIX systems.
QOI - The "Quite OK Image" format for fast, lossless image compression »
Interesting things: the overall simplicity and the chunk QOI_OP_LUMA, which implements diff compression from previous byte giving more weight to the green channel.
Compressing and embedding a Wordle word list »
Another very interesting essay by Chris Wellons on methods of compressing and storing a Wordle word database list:
Single-primitive authenticated encryption for fun »
Another interesting blog entry by Christopher Wellons:
Just as a fun exercise, I designed and implemented from scratch a standalone, authenticated encryption tool, including key derivation with stretching, using a single cryptographic primitive. Or, more specifically, half of a primitive. That primitive is the encryption function of the XXTEA block cipher.
What are X-macros? »
Arthur O'Dwayer:
"X-macros" is a neat C and C++ technique that doesn’t get enough advertisement. Here’s the basic idea:
Suppose we have a table of similar records, each with the same schema. In games, this might be our collection of monster types (each with a display name, a representative icon, a dungeon level, a bitmask of special attack types, etc). In networking, this might be our collection of error codes (each with an integer value, a message string, etc).
We could encode that information into a data structure that we traverse at runtime to produce interesting effects — for example, an array of structs that we index into or loop over to answer a question like “What is the error string for this enumerator?” or “How many monsters have dungeon level 3?”.
How to Get Fired Using Switch Statements and Statement Expressions »
An orchard of batshit insane things done using the switch
C keyword. For example, co-routines:
#include <stdio.h> #define coroutine_begin() static int state=0; switch(state) { case 0: #define coroutine_return(x) { state=__LINE__; return x; case __LINE__:; } #define coroutine_finish() } int get_next(void) { static int i = 0; coroutine_begin(); while (1){ coroutine_return(++i); coroutine_return(100); } coroutine_finish(); } int main(void){ printf("i is %d\n", get_next()); /* Prints 'i is 1' */ printf("i is %d\n", get_next()); /* Prints 'i is 100' */ printf("i is %d\n", get_next()); /* Prints 'i is 2' */ printf("i is %d\n", get_next()); /* Prints 'i is 100' */ return 0; }
https://blog.robertelder.org/switch-statements-statement-expressions/
Implementing simple cooperative threads in C »
Back in the nineties I created a collaborative multitasking library for MSDOS using the setjmp()
/ longjmp()
functions: it had some minor restrictions that I couldn't find the time to fix so I finally got bored and abandoned it. This article describes the development of a very similar library in a very didactic way.
https://brennan.io/2020/05/24/userspace-cooperative-multitasking/
No more leaks with sanitize flags in gcc and clang »
Summary:
CFLAGS="-g -fsanitize=address -fno-omit-frame-pointer" ./config.sh
https://lemire.me/blog/2016/04/20/no-more-leaks-with-sanitize-flags-in-gcc-and-clang/
GitHub - mcgarrah/mman-win32: A light implementation of the mmap functions for MinGW. »
tinyc: lexer+parser+code generator+VM in 291 lines of C code »
Static program analysis with LLVM and clang »
LLVM and clang include a C code static analyzer called scan-build. Use it calling
scan-build "make distclean && ./config.sh && make"
https://grep.be/blog/en/computer/code/static_analysis_with_clang/
A regular expression matcher in 30 lines of C »
GCC Function instrumentation »
Coroutines in C »
Adding custom format codes to printf() »
Why C instead of C++ (Linus Torvalds) »
cryptography (7)
AES-GCM and breaking it on nonce reuse »
A good explanation of the arithmetics in AES/GCM (Galois Counter Mode).
Single-primitive authenticated encryption for fun »
Another interesting blog entry by Christopher Wellons:
Just as a fun exercise, I designed and implemented from scratch a standalone, authenticated encryption tool, including key derivation with stretching, using a single cryptographic primitive. Or, more specifically, half of a primitive. That primitive is the encryption function of the XXTEA block cipher.
Monocypher Third Party Audit »
The Monocypher minimal crypto library has been cryptanalyzed and deemed OK.
(Very) Basic Intro To Elliptic Curve Cryptography »
Lane Wagner gives a brief description on how Elliptic Curve Cryptography (ECC) works:
https://blog.boot.dev/cryptography/elliptic-curve-cryptography/
Private Key Redaction: UR DOIN IT RONG »
Because posting private keys on the Internet is a bad idea, some people like to “redact” their private keys, so that it looks kinda-sorta like a private key, but it isn’t actually giving away anything secret. Unfortunately, due to the way that private keys are represented, it is easy to “redact” a key in such a way that it doesn’t actually redact anything at all. RSA private keys are particularly bad at this[...]
A very clear explanation follows about the only really meaningful parts of a private RSA key in base64 DER format and how to rebuild a full key using only these parts, even if the rest have been redacted out, garbled or obfuscated.
https://www.hezmatt.org/~mpalmer/blog/2020/05/17/private-key-redaction-ur-doin-it-rong.html
An implementation of the ChaCha20 algorithm in Bash »
This is an implementation of the ChaCha20 algorithm in Bash Script.
"chacha20.sh
by zx2c4
You probably shouldn't use this for anything."
Famous Unsolved Codes and Ciphers »
curiosities (10)
PGP Word List »
The PGP Word List [...] is a list of words for conveying data bytes in a clear unambiguous way via a voice channel. They are analogous in purpose to the NATO phonetic alphabet used by pilots[...]
Gimme gimme gimme »
If you execute the Linux man
command without arguments, it returns:
What manual page do you want?
But, if you do the same exactly at 00:30, the returned message is:
gimme gimme gimme
Of course, this is after ABBA's song
Sweden Solar System »
The Sweden Solar System is the world's largest permanent scale model of the Solar System. The Sun is represented by the Ericsson Globe in Stockholm, the largest hemispherical building in the world. The inner planets can also be found in Stockholm but the outer planets are situated northward in other cities along the Baltic Sea.
The Elian Script »
MS Estonia accident radio transcript »
Just in case I forget:
- bow
- front of ship (proa)
- stern
- back of ship (popa)
- port
- left of ship (babor)
- starboard
- right of ship (estribor)
- to list
- to lean, to keel (escorar)
Shavian alphabet »
The Shavian alphabet (also known as Shaw alphabet) is an alphabet conceived as a way to provide simple, phonetic orthography for the English language to replace the difficulties of the conventional spelling. It was posthumously funded by and named after Irish playwright George Bernard Shaw. Shaw set three main criteria for the new alphabet: it should be (1) at least 40 letters; (2) as "phonetic" as possible (that is, letters should have a 1:1 correspondence to phonemes); and (3) distinct from the Latin alphabet to avoid the impression that the new spellings were simply "misspellings".
Futility, or the Wreck of the Titan »
"Futility, or the Wreck of the Titan is an 1898 novella written by Morgan Robertson. The story features the ocean liner Titan, which sinks in the North Atlantic after striking an iceberg. The Titan and its sinking have been noted to be very similar to the real-life passenger ship RMS Titanic, which sank fourteen years later."
https://en.wikipedia.org/wiki/Futility,_or_the_Wreck_of_the_Titan
Transcription of Air France 447's black box »
http://www.popularmechanics.com/technology/aviation/crashes/what-really-happened...
More information (in spanish):
http://www.lapizarradeyuri.com/2014/03/02/air-france-447-buscando-cajas-negras-a...
http://www.lapizarradeyuri.com/2014/03/10/air-france-447-buscando-cajas-negras-a...
https://www.popularmechanics.com/flight/a3115/what-really-happened-aboard-air-france-447-6611877/
Magenta Ain't A Colour »
Shepard tone »
disasters (3)
MS Estonia accident radio transcript »
Just in case I forget:
- bow
- front of ship (proa)
- stern
- back of ship (popa)
- port
- left of ship (babor)
- starboard
- right of ship (estribor)
- to list
- to lean, to keel (escorar)
Futility, or the Wreck of the Titan »
"Futility, or the Wreck of the Titan is an 1898 novella written by Morgan Robertson. The story features the ocean liner Titan, which sinks in the North Atlantic after striking an iceberg. The Titan and its sinking have been noted to be very similar to the real-life passenger ship RMS Titanic, which sank fourteen years later."
https://en.wikipedia.org/wiki/Futility,_or_the_Wreck_of_the_Titan
Transcription of Air France 447's black box »
http://www.popularmechanics.com/technology/aviation/crashes/what-really-happened...
More information (in spanish):
http://www.lapizarradeyuri.com/2014/03/02/air-france-447-buscando-cajas-negras-a...
http://www.lapizarradeyuri.com/2014/03/10/air-france-447-buscando-cajas-negras-a...
https://www.popularmechanics.com/flight/a3115/what-really-happened-aboard-air-france-447-6611877/
exploits (3)
PAM Bypass: when null(is not)ok »
A catastrophic security failure due to Arch Linux sloppy maintainers and the fucking mess that is the Pluggable Authentication Module (PAM):
How to get root on Ubuntu 20.04 by pretending nobody’s /home »
When you browse Instagram and find former Australian Prime Minister Tony Abbott's passport number »
A very funny story about why you shouldn't post a photo of your flight boarding pass to Instagram and how website security is crap:
fiction (4)
Twitter API returning results that do not respect arrow of time »
Mazes, mirrors, deception and denial: an in-depth analysis of Kubrick's "The Shining" »
Q. William Bacon (the Linc Chanes chapters) »
Who is behind these mind-bending stories?
Update: the URL above is rotten, but I found the Linc Chanes content in the Wayback Machine:
(1/3) Lincoln Chanes: Plot of Death/Death of Plot
(2/3) Linc Chanes: Objects in Mirror Are Not As They Appear
The Dionaea House - Correspondence from Mark Condry »
fictions (1)
BLIT (short story) »
fun (5)
XFS 2468 Bug »
Jonathan Corbet:
[...] timestamps in this filesystem are now good through 2468. Developers now have clear warning of a problem coming in 448 years, but chances are they will procrastinate on addressing it for at least 440 of them.
Lockless algorithms for mere mortals »
Jon Corbet:
Time, as some have said, is nature's way of keeping everything from happening at once.
God adds an entry on His blog about world's creation, and then there are some comments »
World War II script is crap »
Update: the link above no longer works. I've rescued its content from the Wayback Machine and copy-pasted here. Author is someone nicknamed squid314.
[...]
So Doctor Who is not a complete loss. But then there are some shows that go completely beyond the pale of enjoyability, until they become nothing more than overwritten collections of tropes impossible to watch without groaning.
I think the worst offender here is the History Channel and all their programs on the so-called "World War II".
Let's start with the bad guys. Battalions of stormtroopers dressed in all black, check. Secret police, check. Determination to brutally kill everyone who doesn't look like them, check. Leader with a tiny villain mustache and a tendency to go into apopleptic rage when he doesn't get his way, check. All this from a country that was ordinary, believable, and dare I say it sometimes even sympathetic in previous seasons.
I wouldn't even mind the lack of originality if they weren't so heavy-handed about it. Apparently we're supposed to believe that in the middle of the war the Germans attacked their allies the Russians, starting an unwinnable conflict on two fronts, just to show how sneaky and untrustworthy they could be? And that they diverted all their resources to use in making ever bigger and scarier death camps, even in the middle of a huge war? Real people just aren't that evil. And that's not even counting the part where as soon as the plot requires it, they instantly forget about all the racism nonsense and become best buddies with the definitely non-Aryan Japanese.
Not that the good guys are much better. Their leader, Churchill, appeared in a grand total of one episode before, where he was a bumbling general who suffered an embarrassing defeat to the Ottomans of all people in the Battle of Gallipoli. Now, all of a sudden, he's not only Prime Minister, he's not only a brilliant military commander, he's not only the greatest orator of the twentieth century who can convince the British to keep going against all odds, he's also a natural wit who is able to pull out hilarious one-liners practically on demand. I know he's supposed to be the hero, but it's not realistic unless you keep the guy at least vaguely human.
So it's pretty standard "shining amazing good guys who can do no wrong" versus "evil legions of darkness bent on torture and genocide" stuff, totally ignoring the nuances and realities of politics. The actual strategy of the war is barely any better. Just to give one example, in the Battle of the Bulge, a vastly larger force of Germans surround a small Allied battalion and demand they surrender or be killed. The Allied general sends back a single-word reply: "Nuts!". The Germans attack, and, miraculously, the tiny Allied force holds them off long enough for reinforcements to arrive and turn the tide of battle. Whoever wrote this episode obviously had never been within a thousand miles of an actual military.
Probably the worst part was the ending. The British/German story arc gets boring, so they tie it up quickly, have the villain kill himself (on Walpurgisnacht of all days, not exactly subtle) and then totally switch gears to a battle between the Americans and the Japanese in the Pacific. Pretty much the same dichotomy - the Japanese kill, torture, perform medical experiments on prisoners, and frickin' play football with the heads of murdered children, and the Americans are led by a kindly old man in a wheelchair.
Anyway, they spend the whole season building up how the Japanese home islands are a fortress, and the Japanese will never surrender, and there's no way to take the Japanese home islands because they're invincible...and then they realize they totally can't have the Americans take the Japanese home islands so they have no way to wrap up the season.
So they invent a completely implausible superweapon that they've never mentioned until now. Apparently the Americans got some scientists together to invent it, only we never heard anything about it because it was "classified". In two years, the scientists manage to invent a weapon a thousand times more powerful than anything anyone's ever seen before - drawing from, of course, ancient mystical texts. Then they use the superweapon, blow up several Japanese cities easily, and the Japanese surrender. Convenient, isn't it?
...and then, in the entire rest of the show, over five or six different big wars, they never use the superweapon again. Seriously. They have this whole thing about a war in Vietnam that lasts decades and kills tens of thousands of people, and they never wonder if maybe they should consider using the frickin' unstoppable mystical superweapon that they won the last war with. At this point, you're starting to wonder if any of the show's writers have even watched the episodes the other writers made.
I'm not even going to get into the whole subplot about breaking a secret code (cleverly named "Enigma", because the writers couldn't spend more than two seconds thinking up a name for an enigmatic code), the giant superintelligent computer called Colossus (despite this being years before the transistor was even invented), the Soviet strongman whose name means "Man of Steel" in Russian (seriously, between calling the strongman "Man of Steel" and the Frenchman "de Gaulle", whoever came up with the names for this thing ought to be shot).
So yeah. Stay away from the History Channel. Unlike most of the other networks, they don't even try to make their stuff believable.
(C) 2010 Scott (squid314)
https://web.archive.org/web/20120623135419/http://squid314.livejournal.com/275614.html
42 Essential 3rd Act Twists »
math (8)
Turns are Better than Radians »
In turns, 0 is 0 degrees, 0.5 is 180 degrees, 1 is 360 degrees, 2 is 720 degrees, and so on. [...]
Seen mentioned in Faster accurate range reduction.
https://www.computerenhance.com/p/turns-are-better-than-radians
The radix 2^51 trick »
Tim McLean on Faster addition and subtraction on modern CPUs
:
https://www.chosenplaintext.ca/articles/radix-2-51-trick.html
Kahan summation algorithm »
Summary:
In numerical analysis, the Kahan summation algorithm, also known as compensated summation, significantly reduces the numerical error in the total obtained by adding a sequence of finite-precision floating-point numbers, compared to the obvious approach. This is done by keeping a separate running compensation (a variable to accumulate small errors).
What Every Programmer Should Know About Floating-Point Arithmetic »
Benford's Law »
Mysterious number 6174 »
MathPages »
Polyhedra Coordinates »
music (4)
Printing music with CSS Grid »
Electronic Experimental Music with Debian »
Shepard tone »
PostScript blank score sheets »
Wouter Verhelst posted a useful PostScript snippet to print score sheets. He also describes line by line what that PostScript program does. I pasted a copy here, just in case:
%!PS 50 75 moveto 1 1 13 { 1 1 5 { 500 0 rlineto -500 5 rmoveto } for 0 30 rmoveto } for stroke showpage
oddities (27)
BLIT (short story) »
The Cursed Computer Iceberg Meme »
this is not a hall of shame.
the intent is to awaken you to many of the peculiarities and weirdness of computers.
hopefully, after reading these articles, you will have learned a lot and will embrace chaos.
John Titor »
Twitter API returning results that do not respect arrow of time »
The Vrillon Transmission »
The Curious Case of Smile.jpg »
Scarfolk Council »
comp.basilisk FAQ »
The Toynbee tiles »
The 52-Hertz whale »
The Phantom Time Hypothesis »
Fomenko's New Chronology »
Hollow Earth »
The upside down alphabet »
Just in case I forget:
abcdefghijklmnopqrstuvwxyz eq)paj6y!fk7wuodbjs+n^mxhz
Cotard delusion »
Mysterious number 6174 »
Morgellons »
Globster »
Pioneer anomaly »
This Man »
Winchester Mystery House »
Tunguska event »
Capgras delusion »
Famous Unsolved Codes and Ciphers »
Out-of-place artifact »
The Diana-Morrissey Phenomenon »
programming (53)
Awk in 20 Minutes »
Opening X11 windows in linux with sockets, bare hands and 200 lines of C »
GitHub - tidwall/neco: Concurrency library for C (coroutines) »
OpenBSD's built-in memory leak detection »
My personal C coding style as of late 2023 »
A simple, arena-backed, generic dynamic array for C »
An easy-to-implement, arena-friendly hash map »
Arena allocator tips and tricks »
Translucent typedefs in C »
The established terminology here is subtyping: we want
dchar *
to be a subtype ofchar *
, so that everydchar *
is-achar *
, but not everychar *
is-adchar *
.[...] There is a widely-supported C extension that sort of acts like subtyping: aligned types.
typedef __attribute__((aligned(2))) char dchar;
Exploring the internals of Linux v0.01 »
Turns are Better than Radians »
In turns, 0 is 0 degrees, 0.5 is 180 degrees, 1 is 360 degrees, 2 is 720 degrees, and so on. [...]
Seen mentioned in Faster accurate range reduction.
https://www.computerenhance.com/p/turns-are-better-than-radians
SectorC: A C Compiler in 512 bytes »
SectorC is a C compiler written in x86-16 assembly that fits within the 512 byte boot sector of an x86 machine. It supports a subset of C that is large enough to write real and interesting programs. It is quite likely the smallest C compiler ever written.
My favorite C compiler flags during development »
Practical libc-free threading on Linux »
Few lesser known tricks, quirks and features of C »
Privilege drop, privilege separation, and restricted-service operating mode in OpenBSD »
The quick and practical "MSI" hash table »
My new debugbreak command »
Includes some notes on breaking programs being debugged on Windows and UNIX systems.
Fast character case conversion »
The Illustrated TLS Connection: Every Byte Explained »
QOI - The "Quite OK Image" format for fast, lossless image compression »
Interesting things: the overall simplicity and the chunk QOI_OP_LUMA, which implements diff compression from previous byte giving more weight to the green channel.
Minimum viable declarative GUI in C++ »
I'm not interested in the entry topic itself, but in what the author proposes for defining the UI: nested struct and enum declarations. Example:
struct { enum { hbox }; struct { enum { vbox }; const char* a = "foo"; const char* b = "bar"; } group1; struct { enum { vbox }; const char* a = "quz"; const char* b = "qux"; } group2; } my_ui;
The Undocumented Microsoft 'Rich' Header »
Summary:
There is a bizarre undocumented structure that exists only in Microsoft-produced executables. You may have never noticed the structure even if you've scanned past it a thousand times in a hex dump. This linker-generated structure is present in millions of EXE, DLL and driver modules across the globe built after the late 90's. This was when proprietary features were introduced into both Microsoft compilers and the Microsoft Linker to facilitate its generation. [...]
http://bytepointer.com/articles/the_microsoft_rich_header.htm
Using black magic to make a fast circular buffer »
Specifically, using mmap()
to map a block of memory twice to implement a circular buffer:
What are X-macros? »
Arthur O'Dwayer:
"X-macros" is a neat C and C++ technique that doesn’t get enough advertisement. Here’s the basic idea:
Suppose we have a table of similar records, each with the same schema. In games, this might be our collection of monster types (each with a display name, a representative icon, a dungeon level, a bitmask of special attack types, etc). In networking, this might be our collection of error codes (each with an integer value, a message string, etc).
We could encode that information into a data structure that we traverse at runtime to produce interesting effects — for example, an array of structs that we index into or loop over to answer a question like “What is the error string for this enumerator?” or “How many monsters have dungeon level 3?”.
How to Get Fired Using Switch Statements and Statement Expressions »
An orchard of batshit insane things done using the switch
C keyword. For example, co-routines:
#include <stdio.h> #define coroutine_begin() static int state=0; switch(state) { case 0: #define coroutine_return(x) { state=__LINE__; return x; case __LINE__:; } #define coroutine_finish() } int get_next(void) { static int i = 0; coroutine_begin(); while (1){ coroutine_return(++i); coroutine_return(100); } coroutine_finish(); } int main(void){ printf("i is %d\n", get_next()); /* Prints 'i is 1' */ printf("i is %d\n", get_next()); /* Prints 'i is 100' */ printf("i is %d\n", get_next()); /* Prints 'i is 2' */ printf("i is %d\n", get_next()); /* Prints 'i is 100' */ return 0; }
https://blog.robertelder.org/switch-statements-statement-expressions/
Hardening Perl’s Hash Function »
Decyphering the Business Card Raytracer »
Already a classic (2013), but nice to re-read:
https://fabiensanglard.net/rayTracing_back_of_business_card/
Sending data in a signal »
Dropbear author Craig said on sending additional data or context in a UNIX signal:
"[...] One thing that isn’t as well known is besides sending a signal to a process, you can send some data to it. This can either be an integer or a pointer and uses similar semantics to the known kill and signal handler. [...]"
The key is using sigqueue()
instead of signal()
and a signal handler like:
void signal_handler(int signum, siginfo_t *siginfo, void *ucontext) { if (signum != SIGUSR1) return; if (siginfo->si_code != SI_QUEUE) return; printf("receiver: Got value %d\n", siginfo->si_int); }
The ReiserFS filesystem »
"This document describes the ReiserFS filesystem structures on disk. It was created while writing a ReiserFS reader for Windows NT. I was unsatisfied with the documentation available over at the official URL, www.namesys.com, so I wrote my own. But, since this is my first contact with ReiserFS, it does contain errors, so if in doubt, please consult the original spec first."
"This document is copyrighted by Gerson Kurz and licensed by the GPL."
Rebuilding target files when source files have changed »
Daniel J. Bernstein wrote an extremely simple but brilliant specification for make
-like build system:
http://cr.yp.to/redo.html
He didn't release an implementation, but somebody apparently named apenwarr did it:
What Every Programmer Should Know About Floating-Point Arithmetic »
No more leaks with sanitize flags in gcc and clang »
Summary:
CFLAGS="-g -fsanitize=address -fno-omit-frame-pointer" ./config.sh
https://lemire.me/blog/2016/04/20/no-more-leaks-with-sanitize-flags-in-gcc-and-clang/
GitHub - mcgarrah/mman-win32: A light implementation of the mmap functions for MinGW. »
tinyc: lexer+parser+code generator+VM in 291 lines of C code »
Static program analysis with LLVM and clang »
LLVM and clang include a C code static analyzer called scan-build. Use it calling
scan-build "make distclean && ./config.sh && make"
https://grep.be/blog/en/computer/code/static_analysis_with_clang/
A small, inetd-based HTTP server »
(How to Write a (Lisp) Interpreter (in Python)) »
A regular expression matcher in 30 lines of C »
GCC Function instrumentation »
Coroutines in C »
Constraining a network packet to go out one specific interface »
Summary:
"In Linux, to control the physical topology of communication you use the
SO_BINDTODEVICE
socket option."
https://codingrelic.geekhold.com/2009/10/code-snippet-sobindtodevice.html
Adding custom format codes to printf() »
Variable destructor support in GCC »
Embedding a File in an Executable, aka Hello World, Version 5967 »
Userlevel IPv6 Programming Introduction (Ulrich Drepper) »
Why C instead of C++ (Linus Torvalds) »
Shell date and time tricks »
AT Commands to Access the Motorola V-Series Phonebook »
Know your regular expressions »
The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software »
Dictionary of Algorithms and Data Structures »
science (6)
Color blindness »
An interesting article by Rob Pike on moderate deuteranopia:
The most common variety of color blindness is called red-green color blindness, or deuteranopia, and it affects about 6% of human males.
https://commandcenter.blogspot.com/2020/09/color-blindness-is-inaccurate-term.html
Cotard delusion »
Mysterious number 6174 »
Pioneer anomaly »
Magenta Ain't A Colour »
Capgras delusion »
security (5)
PGP Word List »
The PGP Word List [...] is a list of words for conveying data bytes in a clear unambiguous way via a voice channel. They are analogous in purpose to the NATO phonetic alphabet used by pilots[...]
Using GnuPG for SSH authentication »
The GnuPG agent can be used as an SSH agent:
https://incenp.org/notes/2015/gnupg-for-ssh-authentication.html
The PGP Problem »
OpenSSH tip: connection sharing »
Two-tier encryption strategy: Archiving your files inside an encrypted loopback partition »
sysadmin (53)
Awk in 20 Minutes »
Use Midnight Commander like a pro »
LUKS with USB unlock »
Make your own VPN - Wireguard, ipv6 and ad-blocking included »
How to discover hosts on local network | sleeplessbeastie's notes »
Uses the ARP protocol to discover hosts. Includes information about how to get the IAB and OUI database files (MAC address owners and such) from the IEEE website.
https://sleeplessbeastie.eu/2023/09/27/how-to-discover-hosts-on-local-network/
EFI and Secure Boot Notes – Emanuele Rocca »
Generar un certificado SSL wildcard con Let's Encrypt - Jesús Amieiro »
Several OpenBSD tutorials »
DNS settings to avoid email spoofing and phishing for unused domain »
Self-hosting a static site with OpenBSD, httpd, and relayd - citizen428.net »
How to identify Raspberry Pi device using built-in leds »
Mount a file system in OpenBSD »
fscom switch shell »
Contains use examples for binwalk (to find files inside disk images) and john (to crack passwords), including a big database of common passwords.
A reckless guide to OpenBSD »
Summary:
Welcome to a new weekly series of articles for intermediate to advanced level users of OpenBSD, focusing on aspects of using and customising the system that are not broadly covered or encouraged by the project's own official documentation, (hence the term ‘reckless guide’).
https://research.exoticsilicon.com/series/reckless_guide_to_openbsd
Debian official installer images that include non-free firmware »
Just what it says in the tin.
https://cdimage.debian.org/cdimage/unofficial/non-free/images-including-firmware/
XTerm: It's Better Than You Thought »
Some info and tweaks for xterm
by Bruno Garcia. Summary:
xterm*faceName: Monospace xterm*faceSize: 13 xterm*utf8: true xterm.vt100.translations: #override \n\ Ctrl Shift <Key>C: copy-selection(CLIPBOARD) \n\ Ctrl Shift <Key>V: insert-selection(CLIPBOARD) xterm*background: rgb:1a/1a/1a xterm*foreground: rgb:d6/d6/d6
As usual, write this in ~/.Xresources and update it by running xrdb ~/.Xresources
.
Remotely Installing OpenBSD on a Headless Linux Server »
Minimum Profit text editor compiled statically »
How to properly manage ssh keys for server access »
Summary: By using certificates, revoked certificate lists and certificate roles.
https://www.paepper.com/blog/posts/how-to-properly-manage-ssh-keys-for-server-access/
Retrieve WLAN PSK via nmcli »
Did you know you can get the cleartext PSK of the Wireless LAN you're connected to by using nmcli
🤯?
grub: entering rescue mode »
Víctor Moral:
Así que me he puesto a buscar en la red y he encontrado un error registrado en Debian y que cuenta que este fallo se produce porque grub no está correctamente actualizado si se dan ciertas circunstancias como tener un núcleo de otra rama (backports en mi caso).
https://esferas.org/msqlu/2020/08/12/grub-entering-rescue-mode/
Ventoy »
Ventoy is an open source tool to create bootable USB drive for ISO files. With ventoy, you don't need to format the disk again and again, you just need to copy the iso file to the USB drive and boot it. You can copy many iso files at a time and ventoy will give you a boot menu to select them.
Converting images while extracting a tarball »
An interesting use case of inotifywait
and parallel
while extracting a humungous tar file.
http://notes.secretsauce.net/notes/2020/07/18_converting-images-while-extracting-a-tarball.html
Presenter mode in LibreOffice Impress without an external display »
Elana Hashman) explains how to create X11 virtual screens:
My GPU had this capability innately, it turns out, if I could just whisper the right incantations to unlock its secrets:
ehashman@red-dot:~$ cat /usr/share/X11/xorg.conf.d/20-intel.conf Section "Device" Identifier "intelgpu0" Driver "intel" Option "VirtualHeads" "1" EndSectionAfter restarting X to allow this newly created config to take effect, I now could see two new virtual displays available for use:
ehashman@red-dot:~$ xrandr Screen 0: minimum 8 x 8, current 3840 x 1080, maximum 32767 x 32767 eDP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 310mm x 170mm 1920x1080 60.01*+ 59.93 ... 640x360 59.84 59.32 60.00 DP1 disconnected (normal left inverted right x axis y axis) DP2 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) HDMI2 disconnected (normal left inverted right x axis y axis) VIRTUAL1 disconnected (normal left inverted right x axis y axis) VIRTUAL2 disconnected (normal left inverted right x axis y axis)Nice. Now, to actually use it:
ehashman@red-dot:~$ xrandr --addmode VIRTUAL1 1920x1080 ehashman@red-dot:~$ xrandr --output VIRTUAL1 --mode 1920x1080 --right-of eDP1And indeed, after running these commands, I found myself with a virtual display, very happy to black hole all my windows, available to the imaginary right of my laptop screen.
Printing hard-to-print PDFs on Linux »
François Marier talks about PDFs that trigger out-of-memory conditions in printers:
[The problem seems to be] transparent images, a PDF 1.4 feature which apparently requires a more recent version of PostScript than what my printer supports.
He dogged the bullet by converting some documents to DjVu:
pdf2djvu -d 1200 2002.04049.pdf > 2002.04049-1200dpi.djvu
And others to PDF 1.3:
ps2pdf13 -r1200x1200 dow-faq_v1.1.pdf dow-faq_v1.1-1200dpi.pdf
https://feeding.cloud.geek.nz/posts/printing-hard-to-print-pdfs-on-linux/
One impact of the dropping of Python 2 from Linux distributions »
Chris Siebenmann said:
"Everyone's insistence on getting rid of Python 2 is magically transforming all of this perfectly functional and useful Python 2 code we have from an asset to a liability."
[...]
"Functioning code that you don't have to maintain and that just works is an asset; it sits there, doing a valuable job, and requires no work. Code that you have to do significant work on just so that it doesn't break (not to add any features) is a liability; you have to do work and inject risk and you get nothing for it."
https://utcc.utoronto.ca/~cks/space/blog/python/Python2DroppingImpact
Three wrappers to run commands without impacting the rest of the system »
François Marier) names 3 tools to execute other commands with lower priorities on a Linux system:
- nice
- Runs at a "nicer" (i.e. lower) CPU priority (a UNIX classic that everybody knows).
- ionice
- Sets the I/O priority. Interesting options are
-c3
(needs root) or-n7
. Only useful if you are using the CFQ scheduler. - nocache
- Avoids storing files into the file cache, leaving it ready for other running processes.
Example in a crontab:
0 0 * * * nocache ionice nice /path/to/backup.sh
Using GnuPG for SSH authentication »
The GnuPG agent can be used as an SSH agent:
https://incenp.org/notes/2015/gnupg-for-ssh-authentication.html
Gimme gimme gimme »
If you execute the Linux man
command without arguments, it returns:
What manual page do you want?
But, if you do the same exactly at 00:30, the returned message is:
gimme gimme gimme
Of course, this is after ABBA's song
In defence of swap: common misconceptions »
Chris Down says (on anonymous, i.e. allocated memory pages):
"[...] Swap is a storage area for these seemingly "unreclaimable" pages that allows us to page them out to a storage device on demand. This means that they can now be considered as equally eligible for reclaim as their more trivially reclaimable friends, like clean file pages, allowing more efficient use of available physical memory.
Swap is primarily a mechanism for equality of reclamation, not for emergency "extra memory". Swap is not what makes your application slow – entering overall memory contention is what makes your application slow."
systemd now includes its own ntp service »
Summary:
Uninstall ntp
or chrony
and do
sudo timedatectl set-ntp true
Prefix Bash commands with a space to avoid them being added to history »
Summary:
# .bashrc (ignore duplicates, don't history space-prefixed cmds) HISTCONTROL=ignoredups:ignorespace
OpenSSH tip: connection sharing »
Recording application sound output with ALSA »
Two-tier encryption strategy: Archiving your files inside an encrypted loopback partition »
Forcing a process to run on a single CPU »
XFS is 20x slower than ext3 (with default settings) »
How to shut wine audio output »
Slow starting USB storage in Linux »
RAID: Write Intent Bitmaps »
XStrikeForce/HowToRandR12 - Debian Wiki »
Ian Wienand: Playing with the x86 PMU »
Tips for running Linux on a flash device »
Mutt: autoviewing text/html »
Hard disk cache tuning »
Easy migration of a service to another, totally different host with iptables »
Dead LCD pixels »
Quozl's BlueTooth RSSI Mapping & Debian Configuration »
Has your laptop only two mouse buttons? »
Very brief introduction to create a CA and a CERT »
Blu-ray Disc/ DVD+RW/+R/ -R[W] for Linux »
Rosetta Stone for Unix »
Linux Boot Loaders Compared »
the space (3)
Stuff in Space »
This site shows in real-time 3D the location of satellites and other celestial bodies. You can search for specific units, like PAZ
El modelo de sistema solar a escala de Ciudad Rodrigo »
El proyecto consiste en establecer una reproducción del sistema solar, a escala 1/290.000.000, en la comarca de Ciudad Rodrigo.
Sweden Solar System »
The Sweden Solar System is the world's largest permanent scale model of the Solar System. The Sun is represented by the Ericsson Globe in Stockholm, the largest hemispherical building in the world. The inner planets can also be found in Stockholm but the outer planets are situated northward in other cities along the Baltic Sea.
thinking (5)
Do the Real Thing »
Scott H. Young:
Consider one person who wrote to me saying she turned down a job working in French. She didn’t feel her French was good enough yet. So instead, she planned to listen to podcasts at home every day until she was ready. You know what would have helped her get good at French? Working at the job in French.
https://www.scotthyoung.com/blog/2020/05/04/do-the-real-thing/
50 Ideas That Changed My Life »
I think "life-changing" is saying too much, but there are some useful remarks in this David Perell post:
[...]
9. Competition is for Losers: Avoid competition. Stop copying what everybody else is doing. If you work at a for-profit company, work on problems that would not otherwise be solved. If you’re at a non-profit, fix unpopular problems. Life is easier when you don’t compete. (Hint: don’t start another bottled water company).
[...]
14. The Wisdom of Paradox: Logic is the key to scientific truths, but paradoxes are the key to psychological ones. When it comes to the human condition, the deepest truths are often counter-intuitive. When you find two opposites that are both true, start exploring.
[...]
22. Goodhart’s Law: When a measure becomes a target, it ceases to be a good measure. One hospital took too long to admit patients so a penalty was given for 4+ hour wait times. In response, ambulance drivers were asked to slow down so they could shorten wait times.
[...]
23. Gall’s Law: A complex system that works is invariably found to have evolved from a simple system that worked. A complex system designed from scratch never works and cannot be patched up to make it work. You have to start over with a working simple system.
[...]
30. Hickam’s Dictum: The opposite of Occam’s Razor. In a complex system, problems usually have more than one cause. For example, in medicine, people can have many diseases at the same time.
[...]
37. The Copernican Principle: The more we learn about astronomy, the less it seems that earth is special. It's a small part of the universe, and each human is a small part of the earth. We are all spinning through the solar system — nowhere near the beginning or end of time.
The Voluntary Human Extinction Movement »
"Phasing out the human race by voluntarily ceasing to breed will allow Earth’s biosphere to return to good health. Crowded conditions and resource shortages will improve as we become less dense.
[...]
Thank you for not breeding."
Skeptic's Annotated Bible »
El ateísmo en la red: Lógica y falacias »
version control (9)
How do you merge two Git repositories? »
Summary:
cd path/to/main-project git remote add subproject /path/to/subproject git fetch subproject --tags git merge --allow-unrelated-histories subproject/master git remote remove subproject
Note: If you want subproject
inside a directory of main-project
, move everything into the appropriate subdirectory before merging.
https://stackoverflow.com/questions/1425892/how-do-you-merge-two-git-repositories
How can I split a single file from a git repo into a new repo? »
Summary:
cd oldrepo git fast-export HEAD -- myfile > ../myfile.fi cd .. mkdir newrepo cd newrepo git init git fast-import < ../myfile.fi git checkout
The Thing About Git (Solving The Tangled Working Copy Problem) »
Public Git Hosting »
git[-svn] in 30 minutes »
Splitting a Git repository »
CVS Version Control for Web Site Projects »
Version Control - CVS Procedures, Database Upgrades, Etc. »
Using CVS for Web development »
web (20)
Printing music with CSS Grid »
siderea | How to Compete with Patreon [New Media, Tech, Patreon] »
An insightful essay on what Patreon does well compared with others, and many suggested improvements.
10 useful HTML5 features you may not be using »
Certainly, there are a bunch of things that I didn't know (or remember):
- The
details
,output
,meter
andprogress
tags; - The input types
list
(and relateddatalist
) andrange
; - That text input fields can have attributes
required
andpattern
(to match regular expressions).
https://blog.greenroots.info/10-useful-html5-features-you-may-not-be-using
HTTPWTF »
A compilation of oddities about the HTTP protocol:
Plaintext HTTP in a Modern World »
Here is an interesting solution by Joshua Stein that implements HTTPS redirections only for modern browsers while still serving plaintext HTTP for older ones. A nginx
configuration snippet:
server { server_name example.com; listen *:80; listen *:443 ssl http2; set $need_http_upgrade "$https$http_upgrade_insecure_requests"; location / { if ($need_http_upgrade = "1") { add_header Vary Upgrade-Insecure-Requests; return 301 https://$host$request_uri; } } ... }
The Upgrade-Insecure-Requests
HTTP header (with a value of 1) is sent by modern browsers when they connect through non-encrypted connections.
The Website Obesity Crisis »
[...]text-based websites should not exceed in size the major works of Russian literature.
[...]If you open [a] tweet in a browser, you'll see the page is 900 KB big.
That's almost 100 KB more than the full text of The Master and Margarita, Bulgakov’s funny and enigmatic novel about the Devil visiting Moscow with his retinue (complete with a giant cat!) during the Great Purge of 1937, intercut with an odd vision of the life of Pontius Pilate, Jesus Christ, and the devoted but unreliable apostle Matthew.
For a single tweet.
How To Create An IndieWeb Profile »
Kev Quirk gives a primer on h-card
creation:
SSL Server Online Test »
This site provides a free online test of SSL/TLS connections.
I was reprimanded because I had support for TLS 1.0 and TLS 1.1 still enabled for this site, so I changed the configuration lines in /etc/nginx.conf
and /etc/nginx/conf.d/samael.conf
to support only version 1.2:
ssl_protocols TLSv1.2;
Telegram Bot - how to get a group chat id? »
Summary:
Here is the sequence that worked for me after struggling for several hours:
Assume the bot name is my_bot.
1- Add the bot to the group. Go to the group, click on group name, click on Add members, in the searchbox search for your bot like this: @my_bot, select your bot and click add.
2- Send a dummy message to the bot. You can use this example: /my_id @my_bot (I tried a few messages, not all the messages work. The example above works fine. Maybe the message should start with /)
3- Go to following url: https://api.telegram.org/botXXX:YYYY/getUpdates replace XXX:YYYY with your bot token
4- Look for
"chat":{"id":-zzzzzzzzzz
, -zzzzzzzzzz is your chat id (with the negative sign).5- Testing: You can test sending a message to the group with a curl:
curl -X POST "https://api.telegram.org/botXXX:YYYY/sendMessage" -d "chat_id=-zzzzzzzzzz&text=my sample text"If you miss step 2, there would be no update for the group you are looking for. Also if there are multiple groups, you can look for the group name in the response ("title":"group_name").
Hope this helps.
https://stackoverflow.com/questions/32423837/telegram-bot-how-to-get-a-group-chat-id
Cookieless Cookies »
Or how to do web tracking using ETag
and If-None-Match
.
REST Do,s and Don't,s »
A small, inetd-based HTTP server »
How to Create a REST Protocol »
Building Web Services the REST Way »
Versioning REST Web Services »
Preventing Image Bandwidth Theft With .htaccess (thesitewizard.com) »
MINI FAQ ABOUT THE ALTERNATE TEXT OF IMAGES »
Caching Tutorial for Web Authors and Webmasters »
CVS Version Control for Web Site Projects »
Using CVS for Web development »
writing (16)
Havocscope - Information about the global black market »
Prices of illegal products in the black market, taken from news sources.
https://havocscope.com/ [999]
S.S. Van Dine - Twenty Rules for Writing Detective Stories »
Rule 20 is specially funny because features a list of things-not-to-do that were already overused in 1928 (and that you have seen a million times).
Historical Dictionary of Science Fiction »
Welcome to the Historical Dictionary of Science Fiction. This work-in-progress is a comprehensive quotation-based dictionary of the language of science fiction.
Most terms defined here feature the first year they were used.
Remarkable StackExchange subdomains »
links://scifi.stackexchange.com
links://literature.stackexchange.com
links://english.stackexchange.com
links://spanish.stackexchange.com
links://movies.stackexchange.com
Thoughts on Writing by Cat Valente »
Part 2
"And know that someone, always, will not like your work. Those voices sound louder than the ones who love it sometimes, because we are human and hurt easily. Because these books are pieces of our hearts bound in glue and cardstock. If you can't fake grace, just don't read your reviews. Reviews are a brutal kind of crack: when they're good you feel you can conquer the world and everything is fine. When they aren't, it's a painful come down from the level of ego it took to write a book in the first place. All these things are normal. A mask of grace will get you further than Hulking out on every blog that reminds you of how much painful, painful rejection and misery comes stapled to the contract.
Carrie's mom was right: they're all going to laugh at you. Bucket of blood is not actually the answer."
Part 3
"Take one (1) unformed character, be they protagonist, antagonist, comic relief, or BFF, then: 1) Give them something to want, 2) Give them something to hide, 3) Give them something to fear, 4) Give them something to obsess over, 5) Then hurt them."
http://www.antipope.org/charlie/blog-static/2012/02/between-the-perfect-and-the-re.html
The myth of the 99 cent book »
Or why I (and another trillion of mediocre artists) don't make a buck selling e-books. We are the long tail. Those authors in the short head may make dumps of money. But the one who is winning billions is the platform.
https://www.baekdal.com/thoughts/the-myth-of-the-99-cent-book/
Some famous books compacted in 5 sentences »
Turkey City Lexicon - A Primer for SF Workshops »
42 Essential 3rd Act Twists »
One sentence summaries for famous novels and stories »
The infernal names »
Ingermanson: Critiquing Your One Sentence Summaries »
Archetype - Lostpedia »
Advanced Fiction Writing Blog : Answers to Some Questions (how many scenes in a 80000 words book?) »
Common Errors in English »
Structure of George Polti's 36 Dramatic Situations »
zx spectrum (3)
★ newest (10)
Awk in 20 Minutes »
BLIT (short story) »
AES-GCM and breaking it on nonce reuse »
A good explanation of the arithmetics in AES/GCM (Galois Counter Mode).
Sir, there's a cat in your mirror dimension »
This makes you wonder: if the frequency-domain representation of a typical image looks like diffuse noise, if most of it is perceptually unimportant, and if the transform is just a lever that takes us back and forth between two functionally-equivalent dimensions… could we start calling that mirror dimension home and move some stuff in?
To answer this stoner question, I grabbed a photo of a cat and then calculated its frequency-domain form with the discrete cosine transform (DCT) [...] Next, I reused the photo of a woman from an earlier example and placed the mirror-dimension “cat noise” pattern over it, dialing down opacity to minimize visible artifacts [...]
https://lcamtuf.substack.com/p/sir-theres-a-cat-in-your-mirror-dimension