Skip to content

Instantly share code, notes, and snippets.

View plembo's full-sized avatar

Phil Lembo plembo

View GitHub Profile
@plembo
plembo / glib-gio-error-gnome-settings-schema.md
Created March 3, 2019 00:54
GLib-GIO-ERROR for Gnome settings schema

GLib-GIO-ERROR for Gnome settings schema

(process:2937): GLib-GIO-ERROR **: 19:33:19.399: Settings schema 'org.gnome.calendar' is not installed

I've been seeing these kinds of errors more frequently lately, running Ubuntu 18.04 LTS.

Can't tell the root cause, but was able to fix the problem by reinstalling the app and desktop schema packages, and then rebuilding the schemas. So, for gnome-calendar:

@plembo
plembo / linux-pyperclip-copy.md
Last active April 15, 2024 18:23
Linux workaround for pyperclip.copy

Linux workaround for pyperclip.copy

Al Sweigart's pyperclip library for Python attempts to provide cross-platform methods for interacting with the clipboard on a computer desktop. I and others have found that the .copy method does not work with our Linux desktops (mine is currently Ubuntu 18.04 LTS with the default Gnome Shell).

A workaround was identified gkotian in an issue opened on the project's Github repo.

Here's the snippet provided by gkotian, which I used in a project from Al's Automate the Boring Stuff with Python book.:

@plembo
plembo / AdobeReader9onUbuntuBionic.md
Last active March 19, 2019 14:03
Adobe Reader 9 on Ubuntu 18.04 LTS

Adobe Reader 9 on Ubuntu 18.04 LTS

At this point it's clear that Adobe's refusal to continuing delivering its latest Acrobat Reader software for Linux is just down to spite.

Unfortunately there are still examples of PDF files out there created with Adobe's proprietary tools, particularlly fill-in-the-bank forms, that you can only work with using Adobe's Reader.

Reader 9 can still be made to run on Ubunut 18.04 LTS, if you can get a copy of the last .deb generated for it in 2013.

AdbeRdr9.5.5-1_i386linux_enu.deb

Here's the ftp site where you'll find this file, as well as the rpm, bar.bz2 and bin packages (the last two should work on generic Linux -- but it's up to you to follow the dependency train to get it up and running):

@plembo
plembo / setuid-root-on-ubuntu.md
Created March 24, 2019 06:38
Ubuntu files setuid root

What files on Ubuntu are setuid root?

Specifically, what files on Ubuntu 18.04 LTS under /usr/bin are setuid root?

(from my reference instance)

me@mine:/usr/bin$ ls -l | grep "^-rws"
-rwsr-xr-x 1 root root    22528 Mar  9  2017 arping
-rwsr-xr-x 1 root root 76496 Jan 25 2018 chfn
@plembo
plembo / bulkrenamefilesbash.md
Created March 30, 2019 15:52
Bulk rename files with bash

Bulk rename files in bash

Needed to rename a bunch of files and didn't want to write a program. Bash one-liner below did the job.

I had a VMware guest I wanted to clone. Copied the whole guest directory to another but then had to rename all the files within. Here's my command syntax for that:

ls linuxc* | awk '{print("mv "$1" "$1)}' | sed 's/linuxc/linuxd/2' | /bin/sh
@plembo
plembo / combinegitrepos.md
Last active March 31, 2019 18:15
Combine git repositories

Combine multiple git repositories

Wanted to consolidate multiple git repos into one, and preserve history from each.

  1. Create folder to hold repos.
$ cd ~/
$ mkdir src
@plembo
plembo / systemd-failed.md
Created April 4, 2019 13:40
Systemd units failed to start

Systemd units failed to start

From time to time I'll get a message (or messages) to the effect that a particular unit failed to start. Most of the time this is the result of some preordained Ubuntu configuration being out of sync. This gist will contain a running list of those as they come up.

To see a list of failed units:

$ sudo systemctl list-units --state=failed
@plembo
plembo / mongodfailrebootspecificip.md
Last active June 5, 2019 19:50
Mongod fails on reboot with specific IP

Mongod fails on reboot with specific IP

See note below on upstream change over a year ago that fixes the problem described here. Until the current release (4.0) server package is fixed the below change will need to be re-applied after each update of the server package.

The mongod service fails to restart after reboot when configured to listen on a specific IP. This only happens on my PCs that run NetworkManager. Servers using the traditional ifupdown/networking stack do not exhibit it.

My /etc/mongod.conf:

# network interfaces
net:
@plembo
plembo / add-search-domain-nm-ubuntu.md
Last active November 18, 2024 08:51
Add search domain under Ubuntu 18.04 LTS and later NetworkManager

Add a search domain under NetworkManager on Ubuntu Desktop 18.04 LTS and later (ipv4)

In older versions of the NetworkManager gui there was a field for the search domain to be written into /etc/resolv.conf, but it was dropped by the time Ubuntu 18.04 LTS shipped. You can add it by editing the system-connections file directly, but running the appropriate nmcli commands is the right way to do it. Note that Ubuntu Server 18.04, which use netplan and systemd-networkd by default, is completely different. Ubuntu 20.04 involves even more variation (see comments below). It's enough to drive someone to Debian proper...

Basic wired networking

First, get the name of the interface you want to set a search domain on:

$ nmcli con show
@plembo
plembo / decouplechromegnome.md
Last active April 7, 2019 22:12
Decouple Chrome from Gnome keystore

Decouple Chrome from the Gnome Shell keystore

A recurring problem with a Gnome desktop machine that is set to automatic login, like an HTPC, is Chrome's out-of-the-box dependence on the desktop environment's keystore. There are a few workarounds.

One is to simply set the Gnome Shell keystore password to blank. Yeah. Not a great idea.

The other is to invoke Chrome with a flag that has it use its own built-in keystore.