Un naufragio personal

Ángel Ortega

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 

#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/

LDM: My Favorite ARM Instruction

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

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/

Satanasa's Oubliette

"Fast food for sick motherfuckers"

https://comam.es/oubliette/index.html

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:

https://mango.pdf.zone/finding-former-australian-prime-minister-tony-abbotts-passport-number-on-instagram

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.

https://idlewords.com/talks/website_obesity.htm

Hardening Perl’s Hash Function

Inside a £30 record player

Even on a tangentially relevant article, somebody had to say it:

Vinyl is not a great format for high-fidelity audio. The constant rotational velocity design means that the sound quality gets progressively worse towards the centre of the record. [...]

Anyone who says vinyl is better than a CD is a muppet.

https://shkspr.mobi/blog/2020/08/inside-a-30-record-player/

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 🤯?

http://sven.stormbind.net/blog/posts/misc_wlan_psk_nmcli/