Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Forward GnuPG agent from macOS to Linux

On the remote machine

Run gpg once as your to create the directory structure

gpg --list-keys

For headless systemd based hosts

@samveen
samveen / remote.conf
Created February 15, 2024 03:53
Remote logging configuration for rsyslog v8 on Debian Bookworm (Use case: Pi as log host for router). Place in /etc/rsyslog.d/
# Remote logging config for rsyslog
# Load modules (UDP,TCP)
module(load="imudp")
module(load="imtcp")
# Configuration for the modules
input(type="imudp" port="514" ruleset="writeRemoteData")
input(type="imtcp" port="514" ruleset="writeRemoteData")
@samveen
samveen / pi-dist-upgrade.sh
Last active March 12, 2024 14:57 — forked from jauderho/gist:6b7d42030e264a135450ecc0ba521bd8
HOWTO: Upgrade Raspberry Pi OS from bullseye to bookworm
### WARNING: READ CAREFULLY BEFORE ATTEMPTING ###
#
# Credit to anfractuosity and fgimenezm for figuring out additional details for kernels
#
# Make sure everything is up-to-date
sudo apt update && sudo apt -y dist-upgrade && sudo apt -y autoremove && sudo apt -y clean
# Reboot once to ensure the running state uses the latest of everything.
sudo reboot
@samveen
samveen / django@.service
Created June 13, 2023 11:25 — forked from afk-mario/django@.service
Django + Gunicorn + VirtualEnv + Systemd
[Unit]
Description=Gunicorn for project %I
After=network.target
After=syslog.target
[Service]
EnvironmentFile=/etc/conf.d/django_%i
ExecStart=/usr/bin/start_gunicorn
Restart=always
SyslogIdentifier=gunicorn%I
@samveen
samveen / uping.py
Last active March 2, 2023 07:38 — forked from mdrisser/uping.py
µPing: Ping library for MicroPython
# µPing (MicroPing) for MicroPython
# copyright (c) 2018 Shawwwn <shawwwn1@gmail.com>
# License: MIT
# Internet Checksum Algorithm
# Author: Olav Morken
# https://github.com/olavmrk/python-ping/blob/master/ping.py
# Fork of original code: Added average response time and fixed issue with urandom.randint() not working
# Author: Mike Risser
@samveen
samveen / raspi-debian-bullseye-install-NetworkManager.sh
Last active January 17, 2023 15:01
Script to install NetworkManager on Raspberry Pi OS - Bullseye
#!/bin/bash
# Install Network Manager on headless RPi0 W
# Source: https://gist.github.com/jlelli/018c8375ecd4b2d5fdf1eadf034318e6
## Usage:
# curl $GIST_RAW_URL | bash -x
# Update system
sudo apt update
@samveen
samveen / Hybridized-Palm-3245ww---Colemak-Mod-DH-Ansi-Edition---Right-Hand.kbd.json
Last active December 22, 2022 17:43
Hybridized Palm 3245ww - Colemak Mod-DH Ansi Edition - Right Hand
[
{
"backcolor": "#414141",
"name": "Hybridized Palm 3245ww - Colemak Mod-DH Ansi Edition - Right Hand",
"author": "Samveen",
"label": "Colemak-DH (Mod-DH)",
"moreInfoUrl": "https://colemakmods.github.io/mod-dh/",
"moreInfoText": "Colemak Mod-DH",
"fingerStart": {
"1": 29,
@samveen
samveen / Hybridized-Palm-3245ww---Colemak-Mod-DH-Ansi-Edition---Left-Hand.kbd.json
Last active December 22, 2022 16:45
Hybridized Palm 3245ww - Colemak Mod-DH Ansi Edition - Left Hand
[
{
"backcolor": "#414141",
"name": "Hybridized Palm 3245ww - Colemak Mod-DH Ansi Edition - Left Hand",
"author": "Samveen",
"label": "Colemak-DH (Mod-DH)",
"moreInfoUrl": "https://colemakmods.github.io/mod-dh/",
"moreInfoText": "Colemak Mod-DH",
"fingerStart": {
"1": 29,
@samveen
samveen / Hybridized-Palm-3245ww---Colemak-Mod-DH-Ansi-Edition.kbd.json
Last active December 22, 2022 16:23
Hybridized Palm 3245ww - Colemak Mod-DH Ansi Edition
[
{
"backcolor": "#414141",
"name": "Hybridized Palm 3245ww - Colemak Mod-DH Ansi Edition",
"author": "Samveen",
"label": "Colemak-DH (Mod-DH)",
"moreInfoUrl": "https://colemakmods.github.io/mod-dh/",
"moreInfoText": "Colemak Mod-DH",
"fingerStart": {
"1": 29,
#!/bin/bash
# Origingal source:
# https://github.com/ventor-tech/odoo-install-script/blob/main/logrotate.sh
# RUN AS ROOT
OE_LOG_PATH="/var/log/odoo/log"
cat <<EOF > /etc/logrotate.d/odoo
#Path odoo logs
${OE_LOG_PATH}/*.log {