tinyapps.org / blog


"Burning" an ISO image to USB flash drive with just dd #

More

/nix | Oct 28, 2018

NVMe Sanitize #

posted to the docs section.

/nix | Sep 13, 2018

NVMe Secure Erase #

posted to the docs section.

/nix | Jun 30, 2018

Saving RealAudio streams and extracting audio without RealPlayer #

  1. Save audio.rm to stream.dump:
    $ mplayer -dumpstream -bandwidth 20000000 -cache 30000 -noframedrop rtsp://example.com/audio.rm

  2. Direct audio output of stream.dump to audiodump.wav:
    $ mplayer -ao pcm stream.dump

Sources:

Wikipedia entry on RealAudio file extensions:

RealAudio files were originally identified by a filename extension of .ra (for Real Audio). In 1997, RealNetworks also began offering a video format called RealVideo. The combination of the audio and video formats was called RealMedia and used the file extension .rm. However, the latest version of RealProducer, Real's flagship encoder, reverted to using .ra for audio-only files, and began using .rv for video files (with or without audio), and .rmvb for VBR video files. The .ram (Real Audio Metadata) and .smil (Synchronized Multimedia Integration Language) file formats are sometimes encountered as links from web pages (see Streaming Audio section below).

/nix | Jun 17, 2018

ATA Sanitize and hdparm #

posted to the docs section.

/nix | Jun 10, 2018

Guide to handling read errors while verifying a hard disk wipe #

posted to the docs section.

/nix | Jun 02, 2018

Convert MP4 to GIF #

1. Simplest method:

$ ffmpeg -i in.mp4 out.gif

out.gif did not display in Finder, Safari, or Preview, but worked in Firefox and Chrome.

2. Oft-cited method using ffmpeg and convert:

$ ffmpeg -i in.mp4 -r 10 frames/frame%03d.png
$ convert -delay 5 -loop 0 frames/frame*.png out.gif

out.gif was over 14 times larger than in.mp4.

3. Best results obtained via this advice:

$ ffmpeg -y -i in.mp4 -vf palettegen palette.png
$ ffmpeg -y -i in.mp4 -i palette.png -filter_complex paletteuse -r 10 out.gif

out.gif was smaller than in.mp4, playable everywhere, and very high quality.

/nix | May 24, 2018

Remove all color but black from an image #

Background removal apps and web-based services don't do well with noisy images like this one of sheet music on thin parchment paper which has text from the next page bleeding through:

Image of sheet music before removing background

However, ImageMagick works, well... magic: $ convert in.png -fill white -fuzz 80% +opaque "#000000" out.png

Image of sheet music after removing background

If the results aren't satisfactory, try tweaking the fuzz value (e.g., 20%). For multiple images, use a for loop: $ for i in *.png; do convert "$i" -fill white -fuzz 20% +opaque "#000000" "$i-out.png"; done

/nix | Feb 02, 2018

whois terminal command not returning registrant contact info #

At some point in recent history, whois stopped returning registrant contact info for a number of TLDs, including .com*. In Why is 'whois' showing no registrant information?, bu11etpr00f explains that the specific registrar whois server must now be queried directly in order to get registrant contact information, i.e.,

$ whois reddit.com
...
Registrar WHOIS Server: whois.markmonitor.com
...
$ whois -h whois.markmonitor.com reddit.com
...
Registrant Name: Domain Administrator
Registrant Organization: Reddit Inc.
Registrant Street: 548 Market St.,
...

Rather than running two commands, I cobbled together this oneliner:

$ whois -h $(whois reddit.com | grep 'Registrar WHOIS Server:' | cut -f2- -d:) reddit.com

but quickly realized that I use whois often enough to create a bash function for it.

So I saved this in ~/.bash_profile:

function w2 {
  whois -h $(whois $1 | grep 'Registrar WHOIS Server:' | cut -f2- -d:) $1
}

then ran source ~/.bash_profile to reload.

Much easier now:

$ w2 reddit.com
...
Registrant Name: Domain Administrator
Registrant Organization: Reddit Inc.
Registrant Street: 548 Market St.,
...

* Thanks to Guy at easyDNS for kindly informing me of the difference between thick and thin WHOIS registries. See also Anthony Geoghegan's reply to Why do some domain names have extremely truncated whois information? for more information.

/nix | Nov 14, 2017

Cracking Microsoft Office password protection #

A new guide has been added to the dusty docs section: Cracking Microsoft Office password protection via hashcat, locally or in the cloud. Enjoy!

/nix | Aug 22, 2017


Subscribe or visit the archives