Skip to content

Instantly share code, notes, and snippets.

View craig-m's full-sized avatar
💾

C craig-m

💾
View GitHub Profile
@craig-m
craig-m / mocp_raspi_fix.md
Created July 7, 2020 10:35
Raspbian mocp fix

Using 'Music on Console' on Raspbian, with sound over HDMI.

pi@raspberrypi:~ $ sudo apt-get install mocp

Before:

@craig-m
craig-m / .tmux.conf
Created June 30, 2020 08:34
.tmux.conf file
set -g default-terminal "screen-256color"
set -g mouse on
set -g base-index 1
@craig-m
craig-m / .vimrc
Last active June 30, 2020 08:31
A .vimrc I cobbled together sometime back.
" vim config
:set smartindent
:syntax on
:set nobackup " no backup files
:set backupdir=~/tmp " backup files here to be sure
:set dir=~/tmp " save vim temp files here
@craig-m
craig-m / readme.md
Last active October 28, 2021 02:45
Lazy automation with Invoke, Ansible and Ansible-runner

Lazy automation

A solution to automate regular, routine, somewhat boring tasks.

Disclaimer: I am not much of a Python programmer by any means, but I have used Ansible for a number of years and using Invoke, and now runner too, has made my ansible workflow better. These are some jumbled notes to share some ideas :)

Tools

The programs I am using:

@craig-m
craig-m / gist:5390a5accec5d62df9d4735551c92b89
Created January 7, 2020 10:28
upgrade all OpenWRT packages
opkg list-upgradable | awk -F ' - ' '{print $1}' | xargs opkg upgrade
@craig-m
craig-m / rpi-led-notes.md
Created December 17, 2019 21:42 — forked from taktran/rpi-led-notes.md
Controlling Raspberry Pi 2 LEDs

Commands for controlling the Raspberry Pi 2 LEDs.

See rpi-leds for a node module that does this.

Power (PWR) LED

  • OK (ACT) LED = led0
  • Power (PWR) LED = led1

Allow access

@craig-m
craig-m / USBGuard-setup.sh
Last active June 30, 2020 08:32
Install USBGuard to whitelist USB Devices
#!/bin/bash
# Install USBGuard to whitelist USB Devices on this host
# https://usbguard.github.io/
sudo apt install usbguard -y
usbguard generate-policy > rules.conf
# < edit rules >
@craig-m
craig-m / drop_ suid_bin_backdoor.sh
Last active June 30, 2020 08:33
create a setuid privilege escalation backdoor bin
#!/bin/bash
# create a privilege escalation backdoor bin
#
# pi@psi:~ $ /usr/local/bin/beroot │·············
# # whoami │·············
# root
# #