The Oracle of God #
Yet still there whispers the small voice within,
Heard through Gain's silence, and o'er Glory's din:
Whatever creed be taught, or land be trod,
Man's conscience is the oracle of God.
(via Gentle World)
/misc | Apr 08, 2015
iPhone: Resize photos before texting via Messages #
While the Mail app in iOS offers to resize photos before sending (Small, Medium, Large, Actual Size), the Messages app does not; in fact, there is no built-in method for resizing photos before texting them, resulting in unnecessarily large files being sent. Even the popular photo editor Snapseed does not offer a resize option. Searching the App Store was (as usual) an exercise in futility, but a too-lengthy (i.e., over 30 second) Google search turned up the aptly-named Resize Image, which makes resizing photos and then texting them (or posting to Twitter, Facebook, Instagram) a breeze.
/mac | Apr 01, 2015
"Restore Failure #
Could not validate source - Operation not supported" kept appearing in Disk Utility as I tried unsuccessfully to restore a bootable USB flash drive image to a new USB flash drive. The asr workaround did not work either, returning Source volume format on device "/dev/disk3" is not valid for restoring. Could not validate source - error 254.
By happy chance, I stumbled onto Max's answer which credited drgeoff's reply, which linked to PureDarwin's Disk images page. The secret was to convert the image format to raw before writing with dd (attempting to restore even the converted image via Disk Utility returned the same "Restore Failure" error above).
Here is the process I used to backup my DiskWarrior bootable USB flash drive and restore it to a new flash drive:
- Insert USB flash drive to be imaged
- Open Disk Utility
- Click root of USB flash drive
- Click "New Image"
- Select desired Image Format (tested restore of "read-only" and "compressed (bzip2)" images successfully)
- Save image to desired location
- $ hdiutil convert /path/to/image_created_above.dmg -format UDTO -o new_image.img
- Remove the .cdr extension that hdiutil automatically appended to new_image.img
- Run Disk Arbitrator and set to "Block Mounts"
- Plug in new USB flash drive (WARNING: all contents will be erased) and note the assigned device name in Disk Arbitrator's Disks Window (e.g., diskx)
- $ sudo dd if=/path/to/new_image.img of=/dev/rdiskx bs=8192
(Pipe through pv or use a dd alternative like dcfldd to easily track progress.)
In retrospect, it might've been better to avoid Disk Utility altogether and simply use dd to create the image:
$ sudo dd if=/dev/rdiskx | bzip2 -9f > usb_image.bz2
obviating the need to convert with hdiutil before restoring:
$ bzip2 -dc usb_image.bz2 | sudo dd of=/dev/rdiskx
UPDATE: It appears that dd/bzip2 creates a more faithful image than Disk Utility's compressed (bzip2) format does:
- The image created using dd and bzip2 was 810.7MB vs. 626.6MB for the compressed (bzip2) image created by Disk Utility.
- The MD5 checksum of the USB flash drive differed based on which image file was restored to it, so the difference in file sizes was not merely some difference in the compression algorithm (which should have been the same anyway).
- When the dd-created image was restored and the USB flash drive plugged in, it mimicked the original DiskWarrior flash drive's behavior (only the /Volumes/DW Finder window automatically opened).
- When the Disk Utility-created image was restored and the USB flash drive plugged in, Finder windows automatically opened for both /Volumes/DW and /Volumes/DiskWarrior Recovery (unlike the original DiskWarrior flash drive).
For Disk Utility to achieve similar results as dd/bzip2, one would need to select "entire device" as the Image Format and then compress the image afterwards in Terminal: $ bzip2 -9f usb_image.dmg > compressed_usb_image.bz2. And, before restoring the image, it would need to first be converted with hdiutil as shown above. Back to dd for imaging disks!
/mac | Mar 19, 2015
Monodraw makes me smile :-) #
Monodraw brings ASCII diagramming into the 21st century, eclipsing even vector diagram tools like Visio and OmniGraffle in ease of use and speed:
Those who have struggled with the exisitng ASCII diagram options for decades will appreciate what a radical leap forward Monodraw represents; it's like going from black and white to color TV.
Free during beta and currently available at a 40% discount. Refreshing licensing policy for a Mac shareware app: "Each license is assigned to a single person and it can be used on multiple Macs owned by the licensee. Monodraw does not use activation or any other form of DRM. We have complete trust in our customers."
(Full disclosure: I've been alpha testing Monodraw the last few months; bought the software today at the same beta discount available to everyone. Sadly, I have no stake in Monodraw, financial or otherwise - just an ecstastic and grateful customer. I must also admit to being a fan of their whimsical illustrations.)
/mac | Mar 04, 2015
Concatenate multiple HTML files into a single EPUB file #
Since Kindle e-Readers inexplicably do not support EPUB, users can convert the generated EPUB file to MOBI with calibre:
- "File" > "Add" > "Existing Files..."
- select desired HTML files
- "File" > "Save As..." > set filename and destination for EPUB.
- "Add books" > select desired EPUB file
- "Convert books" > Output format: "MOBI" > "OK"
- After conversion, right click title > "Open containing folder" > copy MOBI file to Kindle
UDPATE: Combine multiple HTML files into a single PRC ebook
/eink | Feb 26, 2015
Mount USB drives as read-only in Windows #
via a quick registry edit (no reboot required - tested in XP SP2, 7 SP1, and 8.1). Simply save the following text as an .reg file and double click to merge:
Windows Registry Editor Version 5.00
To restore mounting removable disks as read-write, just change "00000001" to "00000000", resave the file, and double click to merge. Not as sound as a hardware write blocker like the Forensic UltraDock, but might come in handy for less sensitive work.
/windows | Feb 17, 2015
Find out what software and services a website uses #
at BuiltWith.com. Testing this domain took less than a second, and the results were detailed and accurate.
/misc | Jan 14, 2015
Tiny freeware apps from Sector Seven #
Jonathan Gallant kindly informs us of Sector Seven's tiny freeware offerings:
/windows | Dec 23, 2014
SSL: Getting to A+ #
My apologies for the delay; the promised guide to migrating nginx from HTTP to HTTPS is finally live. Thanks to Iain Cheyne for his encouragement ;-)
/nix | Dec 23, 2014
Change to downloads directory #
For the past several years, the downloads directory has been fenced off via basic access authentication due to legitimate sysadmin tools like Atomic Web Server and X-Pass being flagged as malware (a quick scan of the downloads directory shows that the false positives have only increased in the interim).
Kristof kindly wrote in with a compelling argument for encrypting the archives instead:
archive.org cannot archive your great site this way. I think it is so much worth preserving.
Convinced by this sound logic (and being rather weak on the side of flattery), basic access authentication has been removed from the downloads directory and all files therein have been encrypted and compressed using the 7z format; the password can be found in the FAQ. So long as this method is equally effective at keeping misguided virus scanners at bay, it seems to strike a better balance between access and appeasement.
I suggest use zip password instead. Imagine this:
as it is now:
* 20 years from now, in 2034, a user finds the archive of your site and finds a great tiny tool with open source, all backed up on your site!
* the tool has no homepage as of 2014 anymore. your site is the only backup!
* web.archive.org cannot archive the page because of the http auth. the backup is NOT archived
* the user in 2034 is sad because this gem of history is lost
if you switch to a zip-password way:
* in 2014 user finds the archive of tinyapps.org at web.archive.org
* the tool has no homepage archived. it was down in 2005.
* (the archive of) your site has the only backup
* the user downloads the zip. archive.org could archive it automatically
* the user cannot open the zip because it is password protected
* the user finds the archived faq of your site, obtains the password
* the user in 2034 can still reach the glow of the great tiny tool!
TinyApps.Org is of such great value that I think it should really be preserved to further generations. For many tools this site is the only source now, because the original is already lost.
(For the few who might be interested in how the change was made:
- Used the aforementioned PeaZip to batch convert and encrypt all existing files in /downloads
- Used the following regex to find all instances of href="/downloads/.exentsion"> and replace extension with 7z:
- Uploaded archives and HTML to server
- Disabled ngx_http_auth_basic_module in nginx.conf and reloaded (nginx -s reload))
/misc | Nov 29, 2014
Subscribe or visit the archives