Skip to content

Instantly share code, notes, and snippets.

@mbr0wn
mbr0wn / luks-cryptsetup.md
Last active March 10, 2019 02:15
Create LUKS encrypted storage, remount

Setup

$DEV=/dev/sdXY # This is the device that gets blown away and encrypted
$MAP=backup # This is an identifier, will create a node at /dev/mapper/$MAP

Create encrypted volume:

cryptsetup -y -v luksFormat $DEV

To open it, check status:

@mbr0wn
mbr0wn / mass-delete-mediawiki-users.md
Last active August 4, 2017 17:03
Mass-deleting users on mediawiki

Haven't gotten very far with this. Best approach so far was call a script to open:

https://$URL/index.php/Special:UserMerge?wpolduser=$user&wpnewuser=Anonymous&wpdelete=1

...where $user is the old username. Needs to be escaped, obv.

I called this through firefox, so I inherit the session cookie.

@mbr0wn
mbr0wn / firefox-internal-pdf-preview
Created April 9, 2017 20:25
How to enable internal preview of PDF files in Firefox
1. Go to preferences
2. Applications
3. Select PDF
4. Select 'Preview in Firefox'
@mbr0wn
mbr0wn / install-acrobat-ubuntu16.04.md
Created March 16, 2017 05:31
Installing Acrobat Reader on Ubuntu 16.04

Download installer: ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/ ...and run. I installed .tar.bz2 into /opt.

$ sudo dpkg --add-architecture i386
$ sudo apt install libgdk-pixbuf2.0-0:i386

$ sudo apt install libgtk2.0-0:i386

@mbr0wn
mbr0wn / export-wiki-redmine-to-mediawiki
Last active February 23, 2023 18:48
Exporting wiki from Redmine, importing into MediaWiki
This method does *not* preserve history. Recollected from memory.
1. Make sure you have access to the Redmine MySQL database. This is even easier when using phpmyadmin.
2. Open database
3. Export a table with page title and content. I forget the exact name of the tables, but it was something like:
SELECT a.id, a.title, b.content FROM wiki_contents a, wiki_pages b WHERE a.id = b.id;
4. Export that result as whatever. I exported it as YAML.
5. If you're lucky, you can load the YAML file. I couldn't, there were special characters that would crash the loader (same for JSON).
@mbr0wn
mbr0wn / gist:7127663
Created October 23, 2013 22:10
modtool-todo
- & is not removed e.g. for const std::string &foo
- libs are placed in wrong place for components