/nix | Aug 22, 2017
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!
By default, --symmetric uses AES128. Find supported ciphers with --version:
$ gpg --version
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
To disable gpg-agent, change use-agent to no-use-agent in ~/.gnupg/gpg.conf.
Why gpg rather than openssl enc?
More from The GNU Privacy Handbook: Documents may also be encrypted without using public-key cryptography. Instead, only a symmetric cipher is used to encrypt the document. The key used to drive the symmetric cipher is derived from a passphrase supplied when the document is encrypted, and for good security, it should not be the same passphrase that you use to protect your private key. Symmetric encryption is useful for securing documents when the passphrase does not need to be communicated to others. A document can be encrypted with a symmetric cipher by using the --symmetric option.
/nix | May 30, 2017
Sources & More
/nix | Mar 05, 2017
Even as root, ls and find produced too many errors ("Permission denied", "Not a directory", "directory causes a cycle", "Input/output error", etc) when attempting to list all files on disk. Tree worked a treat:
$ tree -a -i -f / > filesystemlist.txt -a All files are listed. -i Don't print indentation lines. -f Print the full path prefix for each file.See also Tree for Windows and LINUX Recursively list all files in a directory including files in symlink directories.
/nix | Feb 06, 2017
Install pandoc and asciidoc
$ sudo apt install pandoc asciidoc
Convert asciidoc to docbook
$ asciidoc -b docbook foo.adoc
foo.xml will be output into the same directory as foo.adoc
Convert docbook to markdown
$ pandoc -f docbook -t markdown_strict foo.xml -o foo.md
Unicode symbols were mangled in foo.md. Quick workaround:
$ iconv -t utf-8 foo.xml | pandoc -f docbook -t markdown_strict | iconv -f utf-8 > foo.md
Pandoc inserted hard line breaks at 80 characters. Removed like so:
$ iconv -t utf-8 foo.xml | pandoc -f docbook -t markdown_strict --wrap=none | iconv -f utf-8 > foo.md
/nix | Jan 24, 2017
|lfhex missing Cursor Offset||lfhex with Cursor Offset|
As Kalle Olavi Niemitalo explains in the aforementioned bug report, removing statusBar()->showMessage("Ready",2000); from hexGui.cpp before compiling works, but only if you have older versions of Qt, gcc, g++, etc. to compile with (or manage to resolve compatibility problems like this one).
After several false starts, I got a x64 binary compiled under Ubuntu 12.04, gcc 4.6.3, and Qt 4.8.1. Works fine under newer Debian-based distros as well.
See also wxHexEditor, a cross-platform (Linux, Windows, OS X), open source hex editor with support for very large files (up to 2EB) and raw disk access (under POSIX systems). The current version, 0.23 beta, is available via # apt install wxhexeditor.
UPDATE 1: Just noticed this on the lfhex homepage under "Limitations": "Search/compare can be slow (compared to cmp or any other non-paged IO app)". Note that cmp -s is faster than just cmp and roughly equal to diff -q. More info. Tip: If you just need to know whether two large files differ, first check the file sizes. Only then if necessary run: diff --speed-large-files --brief --report-identical-files file1 file2.
UPDATE 2: To compare two files, run $ lfhex -c file1 file2 (there isn't a comparison option within the GUI, though the preceding command will launch the GUI in comparison mode).
/nix | Nov 05, 2016
/nix | Oct 24, 2016
"libguestfs can access almost any disk image imaginable. It can do it securely — without needing root and with multiple layers of defence against rogue disk images. It can access disk images on remote machines or on CDs/USB sticks. It can access proprietary systems like VMware and Hyper-V."
/nix | Oct 02, 2016
Don't install from the official repositories unless you want version 1.19 from 2014 (current version is 1.21 from 2016):
# apt install ddrescue
E: Unable to locate package ddrescue
# apt install gddrescue
Setting up gddrescue (1.19-1) ...
(Note that while the repositories refer to it as "gddrescue", it is invoked via "ddrescue" once installed.)
If you receive an error like this one while running make:
c++ -W -O2 -c -o arg_parser.o arg_parser.cc
make: c++: Command not found
Makefile:64: recipe for target 'arg_parser.o' failed
make: *** [arg_parser.o] Error 127
you need to install build-essential first:
# apt install build-essential
The rest is straightforward:
$ lzip -d ddrescue-1.21.tar.lz && tar xvf ddrescue-1.21.tar && cd ddrescue-1.21 && ./configure && make
/nix | Sep 30, 2016
According to the developers, "Apricity OS idles at around 500 megabytes of memory usage, as opposed to other popular operating systems that idle at up to several gigabytes. This also helps bring boot times down to just a few seconds." I found it fast and responsive running in a VM with just 2GB of RAM. Love the little coffee cup icon in the menu bar which functions much like OS X's caffeinate, though it has the added benefit of disabling the screensaver as well.
(via Hacker News)
/nix | Apr 03, 2016
Subscribe or visit the archives