Wednesday, September 27, 2023

Save MySQL data to compressed CSV file using a FIFO named pipe

It's very easy to save MySQL data to a compressed file by using a named pipe.
You need to have two bash terminals open, A & B, presumably in screen/tmux sessions since you are likely interested in large tables that take a long time to export.

Terminal A, Step 1: Create the FIFO named pipe (make sure MySQL can write to it):

mkfifo "/path/to/data.csv"
sudo chown mysql 
"/path/to/data.csv"

Terminal A, Step 2: Have zstd read from the FIFO pipe and write to an output file:

zstd -o "/tmp/data.csv.zst" < "/path/to/data.csv" &

Terminal B: Save the MySQL data:

SELECT * FROM your_table
 INTO OUTFILE '/path/to/data.csv'
 CHARACTER SET UTF8MB4
 FIELDS TERMINATED BY ','
        OPTIONALLY ENCLOSED BY '"'
        ESCAPED BY '"'
 LINES TERMINATED BY '\n';

The only issue would be the NULL columns, which  you can deal with manually by using IFNULL when constructing your query.

Tuesday, September 19, 2023

Tamagotchi RakuRaku Dinokun

I owned one of these in the 90s, it was very fun. Several blogs are dedicated to this particular toy, and you can also find videos on YouTube.
https://dinkiepets.tumblr.com/
http://gotchi-garden.blogspot.com/p/dinkie-dino-care-sheet.html


And an old page dedicated to the first generation Tamagotchi:

Resource Hacker

A resource editor for Windows executables. It should be familiar to anyone who enjoys exploring the internals of computers and operating systems.

http://www.angusj.com/resourcehacker/

Windows Enabler

A very interesting Windows utility that helps you "hack" certain applications by allowing you to enable disabled buttons, checkboxes, menu options, and other UI elements, making them clickable.

https://iowin.net/en/windows-enabler/
https://www.softpedia.com/get/Others/Miscellaneous/Windows-Enabler.shtml

HideWindow by Adrian Lopez

This is an ancient piece of software written back in the 90s by Adrian Lopez that interestingly enough still works to this day in toggling the visibility state of windows in Windows.

The version hosted by the Wayback Machine is 1.31:

https://archive.org/details/HIDEWNDW_ZIP

Version 1.43 is also known to exist, but I could not find it online:
- http://assiste.com.free.fr/p/abc/b/liste_misc_tool.php
- https://web.archive.org/web/20071109174738/http://assiste.com.free.fr/p/abc/b/liste_misc_tool.php
- https://web.archive.org/web/20050113175440/http://pestpatrol.com/pestinfo/h/hidewindow_1_43.asp

While not malicious, it has been bundled together with malware and used to hide the application windows of third party executables, like mIRC operating as a "zombie" (bot).

mdm.exe is in reality HideWindow by Adrian Lopez, but he's quite innocent otherwise.

https://seclists.org/incidents/2003/Jan/86