Skip to content

Instantly share code, notes, and snippets.

View plembo's full-sized avatar

Phil Lembo plembo

View GitHub Profile
@plembo
plembo / ConvPEMtoPKCS12.md
Last active April 15, 2023 08:52
Convert PEM Certificates to PKCS12

Convert PEM Certificates to PKCS12

Microsoft systems and the products of some Microsoft-dominated vendors (like HP and Brother) will not accept separate SSL keys and certficates. Instead, these need to be bundled together in PKCS12 format.

Converting PEM certificates to PKCS12 format is easily done with the openssl utility:

openssl pkcs12 -export -out _.example.com.pfx -inkey _.example.com.key -in _.example.com.crt

The name of the output file is specified after "-out". The original certificate key in PEM format is after "-inkey",

@plembo
plembo / InternalCurrentDomain.md
Last active July 6, 2018 16:33
Internal Current Domain Record

Current Domain Record on internal DNS

Many simple Internet-facing web sites consist of a single host whose current domain (referred to as "@", or "$ORIGIN, in the zone file) is assigned the one A record for the domain, with subdomains like "www" assigned related CNAME records. For example, in the case of the "example.com" domain the DNS records might look like this:

@      IN     A      1h      35.207.55.147
www IN CNAME 1h .example.com.
@plembo
plembo / userbenv.md
Last active July 7, 2018 18:56
Use rbenv for ruby

Use rbenv for ruby

While there are packages for ruby and many of its gems in the major Linux distro repositories, as with nodejs may developers will find that a local install of the language that runs out of their home directory will be the easiest to manage, especially if they have to work with multiple versions.

The two different (and incompatible with each other) version managers for ruby are rvm and rbenv. A short article promoting rbenv over rvm by the rbenv developers can be found here. The other side is represented in the majority of comments on this discussion thread. I have run rvm in the past and found it fairly easy to set up and use in a Linux environment.

@plembo
plembo / MindMappingOnLinux.md
Last active July 9, 2021 00:59
Mind Mapping on Linux

Mind Mapping on Linux

At one time there were at least 3 programs available for doing Mind Mapping on Linux: FreeMind, XMind and FreePlane. FreeMind is the grandaddy of mind mapping software. It's written in Java but is open source and still being developed. FreePlan is a fork of FreeMind that adds some nice features and is at any given time a bit ahead of FreeMind in its development cycle. XMind is also a Java desktop application that started out as an open source project, but whose latest version (XMind Zen) is now closed source with access via a monthly ($4.58) subscription.

In trying out all three recently I discovered the FreeMind is no longer available in the Ubuntu 18.04 repository, and that the version (1.6.13-1) of FreePlan in the repo freezes on use.

@plembo
plembo / myvimrc.md
Last active April 10, 2025 14:16
My vimrc

Going beyond the defaults with vim

I really didn't care about formatting until I started learning to program in python.

Now I have to.

Here are some notes on going beyond the defaults with the vim editor.

I generally use a .vimrc dotfile for both CLI and GUI versions of vim. Some people like to use .gvimrc for directives that only apply to the GUI.

@plembo
plembo / dpkg-xyz-broken.md
Last active July 18, 2018 13:32
dpkg: XYZ is broken or not fully installed

Got into a fight with Ubuntu's "Software Updater" yesterday.

After doing a "sudo apt update && sudo apt upgrade" got a string of error messages regarding a metric ton of system packages like this:

gconf2 is broken or not fully installed

This appeared to be the result of apt losing its mind. On Red Hat derived systems the solution would be to rebuild the yum (or dnf) database and clear all caches.

@plembo
plembo / mirror_host.md
Last active March 5, 2019 19:37
Using rsync to mirror host folders

Using rsync to mirror host folders

If you don't need versioning or encryption here's a simple script that uses rsync to mirror select folders on a Linux host to a remote backup server.

#!/usr/bin/env bash
# Script to mirror host folders to backup

SHOST=$(`hostname|cut -f1 -d.`)
THOST='mybackuphost.example.com'
@plembo
plembo / ServiioOnLinux.md
Last active August 4, 2018 16:25
Serviio Setup on Linux

Setting up Serviio on Linux

Serviio is a cross-platform media server written in Java.

Binaries are available for many platforms, including Linux.

Follow the Getting Started guide to get things set up and configured.

The following describes my own practical application of the instructions given in the above guide. The installation was done on Ubuntu Server 16.04 LTS.

@plembo
plembo / PsensorSchemaFail.md
Last active August 5, 2018 21:12
Missing glib schema causing psensor crash

Missing glib schema causing psensor crash

After installing psensor on my Lenovo T430 laptop running Ubuntu 18.04, I got this error when trying to run it:

GLib-GIO-ERROR **: 16:41:25.686: Settings schema 'psensor' is not installed

The fix for this was to regenerate the glib 2.0 schemas by running the following command as root:

glib-compile-schemas /usr/share/glib-2.0/schemas
@plembo
plembo / RPIwithQEMU.md
Last active April 4, 2025 19:39
Emulating a Raspberry Pi with QEMU

Emulating a Raspberry Pi with QEMU

Goal: Emulate a Raspberry Pi with QEMU in order to run the Raspbian O/S (based on Debian Linux).

The current setup is not ideal. For one thing, the maximum RAM allowed using the "versatile-pb" firmware is 256 Mb. In addition, only the most basic peripherals, a keyboard and mouse, are supported.

A number of articles have been written on this topic. Most are outdated, and the few recent ones are missing key information.