Skip to content

Instantly share code, notes, and snippets.

View mstuttgart's full-sized avatar
🏠
Working from home

Michell Stuttgart mstuttgart

🏠
Working from home
View GitHub Profile
@mstuttgart
mstuttgart / RenewExpiredGPGkey.md
Created January 8, 2025 21:21 — forked from TheSherlockHomie/RenewExpiredGPGkey.md
Updating expired GPG keys and backing them up 🔑🔐💻

Updating expired GPG keys and their backup 🔑🔐💻

I use a GPG key to sign my git commits.

An error like this one might be a sign of an expired GPG key.

error: gpg failed to sign the data fatal: failed to write commit object
@mstuttgart
mstuttgart / xfce-i3-guide.md
Created November 1, 2024 09:04 — forked from fathulfahmy/xfce-i3-guide.md
A guide on how to setup XFCE with i3wm

How to XFCE with i3WM

Download

  1. Download XFCE Distribution
  2. Download i3 only (i3 status i3 lock dmenu is not needed)

⚠️ Do not installed preconfigured or distributed i3wm to avoid conflicts with XFCE settings
e.g.
do sudo dnf install i3 --setopt=install_weak_deps=False
dont "i3 desktop" or @i3-desktop-environment

@mstuttgart
mstuttgart / README.md
Created June 6, 2024 14:47 — forked from darrenpmeyer/README.md
Automatically start a single instance of ssh-agent for all terminal sessions to share (bash)

Installation

  1. mkdir -p ~/.config && touch ~/.config/ssh-agent.pid
  2. Paste the contents of ssh-agent-manage.sh into your .bashrc or .bash_profile or similar
  3. killall -9 ssh-agent
  4. Start a new terminal session (note: old sessions will not see ssh-agent, only new ones)

Details

This snippet, when included in .bashrc, will ensure that your session has a working ssh-agent with all your ssh keys loaded into it. It does this without creating separate ssh-agent processes by:

@mstuttgart
mstuttgart / Makefile
Created May 23, 2024 18:38 — forked from MarkWarneke/Makefile
Makefile for python code
# Makefile for python code
#
# > make help
#
# The following commands can be used.
#
# init: sets up environment and installs requirements
# install: Installs development requirments
# format: Formats the code with autopep8
# lint: Runs flake8 on src, exit if critical rules are broken
@mstuttgart
mstuttgart / minimal_ansible_playbook.py
Created May 23, 2024 12:13 — forked from nod/minimal_ansible_playbook.py
Minimal code to run an Ansible Playbook from within python and get stats back on success or fail
from ansible import playbook, callbacks
# uncomment the following to enable silent running on the playbook call
# this monkey-patches the display method on the callbacks module
# callbacks.display = lambda *a,**ka: None
# the meat of the meal. run a playbook on a path with a hosts file and ssh key
def run_playbook(playbook_path, hosts_path, key_file):
stats = callbacks.AggregateStats()
playbook_cb = callbacks.PlaybookCallbacks(verbose=0)
@mstuttgart
mstuttgart / bootstrap-db.py
Created March 26, 2024 14:50 — forked from sebalix/bootstrap-db.py
Bootstraping Odoo database (8.0)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to bootstrap an Odoo database (8.0)."""
import odoorpc
# Odoo connection
SUPER_PWD = 'admin'
HOST = 'localhost'
PORT = 8069
DB = 'my_db'
@mstuttgart
mstuttgart / task.yml
Created April 13, 2023 18:24 — forked from maxim/task.yml
Adding github to known_hosts with ansible
- name: ensure github.com is a known host
lineinfile:
dest: /root/.ssh/known_hosts
create: yes
state: present
line: "{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}"
regexp: "^github\\.com"
@mstuttgart
mstuttgart / logitech-mx-master-3-extras-for-linux-with-logiops.md
Last active June 3, 2023 18:36 — forked from johnathanmay/logitech-mx-master-3-extras-for-linux-with-logiops.md
[Configurando mouse Logitech MX Master 3] Como Configur botões de atalho no Linux. #linux #hardware

Logitech MX Master 3 Extras for Linux With logiops

The Logitech Options program isn't available for Linux, but a nice hacker on GitHub (PixlOne) created an open source project that lets you obtain some of that functionality. It's called logiops. It works in conjunction with the Solaar project as well, which I find especially handy since that shows your available battery life in the system tray and lets you pair/unpair devices with the Logitech Unifying Receiver.

Here are some additional pages with info that I used to generate this documentation:

@mstuttgart
mstuttgart / git-tag-delete-local-and-remote.sh
Last active February 6, 2023 17:44 — forked from mobilemind/git-tag-delete-local-and-remote.sh
[How to delete a git tag] How to delete a git tag locally and remote #git
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName