tinyapps.org / blog


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

/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

Encrypt and decrypt files in GPG without keys; #

that is, using only a symmetric cipher:

Create an encrypted copy of foo, saving it as foo.gpg in the current directory:

$ gpg --symmetric --cipher-algo AES256 foo
Enter passphrase:
Repeat passphrase:

Create a decrypted copy of foo.gpg, saving it as foo in the current directory:

$ gpg --output foo --decrypt foo.gpg
gpg: AES256 encrypted data
Enter passphrase:
gpg: encrypted with 1 passphrase

Create an encrypted copy of foo, saving it as foo.asc in the current directory in ASCII-armored format (suitable for pasting into email, etc):

$ gpg --symmetric --armor --cipher-algo AES256 foo
Enter passphrase:
Repeat passphrase:

Same as above, but send output to stdout instead of saving as foo.asc:

$ gpg --symmetric --armor --cipher-algo AES256 --output - foo
Enter passphrase:
Repeat passphrase:
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1

jA0ECQMCpjdNrpTC689g0kYBkyRd+aGyQwt8sZu+OvEilyCnXd6RiYMXM75MlSb+
OCZnMy6hBhGxvJ7R23HCkNPg76X8dH4O8k5kYtuQwL9fZL8akSY0
=uWsn
-----END PGP MESSAGE-----

Decrypt foo.asc, sending output to stdout:

$ gpg --decrypt foo.asc
gpg: AES256 encrypted data
Enter passphrase:
gpg: encrypted with 1 passphrase
hello, world!

Notes:

/nix | May 30, 2017


Subscribe or visit the archives