See all of the initialization scripts loaded
When you are crafting custom .vimrc files this is very helpful to see what initialization scripts have been loaded and in what order
:scriptnames
Principal Software Engineer/Architect, motorcyclist, drummer, and artist
All things computing.
When you are crafting custom .vimrc files this is very helpful to see what initialization scripts have been loaded and in what order
:scriptnames
If you have a Windows .bkf file and want to “unpack” in on a Linux box, you can use mtftar to convert an MTF stream to a TAR stream.
This was a great find when a friend lost some data and all they had was an old .bkf file.→ Continue reading “Convert Windows .bkf File to tar File”
First decrypt the drive. When I plugged it in GNOME displayed a dialog and asked for the key. I’m guessing that cryptsetup luksOpen /dev/device device_crypt would work as well.
Run lvdisplay to get the LV Path for the logical volume that you want to mount.
Then, activate the volumes , there is a way to activate a specific one volume, but the following activates them all.
vgchange -ay
Then mount it
mount <lv-path/mnt
Following are a number of common PDF processing commands on a Linux box
convert image-1 image-2 ... images.pdf
ImageMagick, specifically version 6 (im6), is preventing the conversion of PDF files due to a security policy. To address this
root, edit /etc/ImageMagick-6/policy.xml<policy domain="coder" rights="none" pattern="PDF" /rights="none" to rights="read|write"dpkg -s docker-ce | grep Version apt-cache madison <package>Run the following command replacing the package in question
apt-get --with-new-pkgs upgrade <package-name>
Try the following, in order. Each is less risky than the next. Stop as soon as you have fixed the problem.
apt-get --with-new-pkgs upgrade <list of packages kept back>→ Continue reading “Debian Package Management Cheat Sheet” There are times when you need to cherry-pick a commit from another branch. Then there are times when you only need parts of that commit.
Following is how you can partly cherry-pick a commit to get only the changes that you need.
Get the patch for the entire commit. Include the -n for no commit so that it does not add it as a commit to your branch
git cherry-pick -n <commit>
Then unstage the the changes from the cherry-picked → Continue reading “How to partially cherry-pick a commit in git”
It is common to write go text/templates that range over a slice of objects to write out a list or array of items that are separated by some delimiter defined in the template.
In the case of a JSON array of objects, the cleanest output would be a , separating each object without a leading or trailing comma.
Because go template if statements are falsey in that a 0 value will evaluate to false you can write a template as → Continue reading “Go template that properly renders delimiters for a slice of structs”
The following is an example showing how to query multiple nested arrays in JSON data in a PostgreSQL database.
Given
CREATE TABLE sample_json (
id serial PRIMARY KEY,
name varchar(64),
json_data json
);
INSERT INTO sample_json (name, json_data)
VALUES
(
'NA',
'
{
"location": "US",
"topLevelArray": [
{
"id": 1,
"secondLevelArray": [
{
"key": "someKey",
"operator": "=",
"value": 10
},
{
"key": "foo",
"operator": ">=",
"value": 5
},
{
"key": "someOtherKey",
"operator": ">",
"value": 647
}
]
},
{
"id": → Continue reading “Query nested arrays in PostgreSQL JSON data” You may have code and configurations that are required to stay on premise. As a result, you will need to setup your own git server and create and manage repositories locally. Following is an overview of how to set that up.
We will leave aside server setup, configuration, and networking and assume that we have a machine on which we will host the repos, git-server, and machines that will clone, pull, and push updates, clients.
Software RAID has come a long way. Unless you have some very high-rate, high-volume, I/O workloads with SLAs that will otherwise cost you money, for the most part a software RAID will perform just fine. One of the primary benefits of using software RAID is the portability of your disks/data. If a box on which you have a software RAID dies somehow and at least some (depending on your RAID configuration) of drives survive, you can easily resurrect the RAID → Continue reading “Setting up software RAID on Debian with mdadm”