Skip to content

Instantly share code, notes, and snippets.

@imthenachoman
imthenachoman / README.rst
Last active July 26, 2023 05:47 — forked from dupuy/README.rst
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as

@imthenachoman
imthenachoman / README.md
Last active August 20, 2023 20:48
Bash script to open files with `kate` from the CLI and ask for `sudo` password if the current user does not have edit access to the file.

Overview

For whatever reason, openSUSE disables the polkit for Kate that will make it so Kate will prompt for a password when you try to edit root owned files.

The only way I could figure out how to get Kate to open these files is using the command VISUAL="kate -b" sudoedit <file>.

So I wrote a little helper script (to put be put in .bashrc) that opens kate for any file.

  • If the current user has write access to the file/folder, it'll open kate as the current user
  • If the current user does not have write access to the file/folder, it'll use sudoedit to open the file.
@imthenachoman
imthenachoman / 00 README.md
Last active February 20, 2024 11:04
Debian snapper apt script to include full apt command including arguments as snapshot description

This gist includes an enhancement to Debian's snapper package.

The current (as of 2023-07-23) snapper package includes an apt configuration that will automatically take snapper snapshots when you use apt to install/remove/etc. It will add use "apt" as the description of the pre/post snapshot.

With the below changes to the /etc/apt/apt.conf.d/80snapper file and associated dpkg-pre-post-snapper.sh file, snapper will include the full apt command, including the arguments, in the snapshot description.

For example:

$ sudo apt install funky
@imthenachoman
imthenachoman / Developing a GAS Powered Google Workspace Add-on And Launching It To The Marketplace.md
Last active April 28, 2024 20:29
Developing a GAS Powered Google Workspace Add-on And Launching It To The Marketplace