Skip to content

111 Recipes

How to merge two Git repositories

Published ·In Miscellaneous

Copied from an anwser on Stack Overflow

To merge project-1 into project-2:

$ cd path/to/project-2
$ git remote add project-1 /path/to/project-1
$ git fetch project-1 --tags
$ git merge --allow-unrelated-histories project-1/master
$ git remote remove project-1

How to target only HTML elements that have no CSS classes

Published ·UPD ·In Recipes

HTML elements without a class attribute or with an empty class attribute can be selected in CSS by using the negation pseudo-class and the attribute selector.

For example, to select paragraphs without classes:

p[class=""] {
  color: red;

The first selector in the group above selects all paragraphs without a class attribute. The second selects all paragraphs with an empty class attribute. Paragraphs with one or more classes are not affected and can be styled independently.


WordPress Plugins

Published ·UPD ·In Resources

A list of WordPress plugins that I use often. The list is a work in progress.

Slugs for the ones available at the WordPress official repo:

admin-post-navigation classic-editor disable-comments disable-embeds disable-emojis omni-contact-form query-monitor relevanssi term-management-tools two-factor user-switching

How to delete (empty) the content of a file in Linux

Published ·UPD ·In Recipes
$ truncate -s 0 filename

What this command does: Truncates filename to a size of zero.


How to auto-renew Let’s Encrypt certificates in Debian 10

Published ·UPD ·In Documentation

If Certbot is installed in Debian, renewal of certificates should be already automated and there is nothing else to do:

The Debian Certbot package installs a systemd timer which runs every 12 hours, calling a Certbot service. The Certbot service then executes the Certbot command for renewing expiring certificates.

To make sure the certbot timer is running, check the list of active timers:

$ systemctl list-timers

Or look at the status of the Certbot timer itself:

$ systemctl status certbot.timer

To see what exactly the Certbot service does:

$ less /usr/lib/systemd/system/certbot.service

More: Certbot – User Guide