Skip to content

Instantly share code, notes, and snippets.

View djw4's full-sized avatar

Daniel djw4

  • Melbourne, Australia
View GitHub Profile
@triangletodd
triangletodd / README.md
Last active July 2, 2024 11:01
k3s in LXC on Proxmox

On the host

Ensure these modules are loaded

cat /proc/sys/net/bridge/bridge-nf-call-iptables

Disable swap

sysctl vm.swappiness=0
swapoff -a
@tdmalone
tdmalone / static-site-watch.sh
Last active June 17, 2021 08:03 — forked from senko/onchange.sh
Watch specified directory recursively for file changes, and sync it to S3 when anything is created, modified, moved or deleted. Designed for use with a static site generator.
#!/usr/bin/env bash
#
# Watch specified directory recursively for file changes, and sync it to S3 when anything is
# created, modified, moved or deleted. Designed for use with a static site generator.
#
# Originally based on a script by Senko Rasic <senko.rasic@dobarkod.hr>
# Modified by Tim Malone <tdmalone@gmail.com>
# Ideas included from Lambros Petrou <lambrospetrou@gmail.com>
# Released to public domain.
# See https://gist.github.com/senko/1154509
@Luzifer
Luzifer / README.md
Last active May 29, 2024 08:02
Running docker-compose as a systemd service

Running docker-compose as a systemd service

Files

File Purpose
/etc/compose/docker-compose.yml Compose file describing what to deploy
/etc/systemd/system/docker-compose-reload.service Executing unit to trigger reload on docker-compose.service
/etc/systemd/system/docker-compose-reload.timer Timer unit to plan the reloads
/etc/systemd/system/docker-compose.service Service unit to start and manage docker compose
@mosquito
mosquito / README.md
Last active June 17, 2024 20:26
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@iAugur
iAugur / ansible-add-string-to-line.yml
Last active May 14, 2024 12:37
Ansible: Add a String to an existing line in a file
# Adapted from solution provided by http://stackoverflow.com/users/57719/chin-huang http://stackoverflow.com/a/31465939/348868
# Scenario: You want to add a group to the list of the AllowGroups in ssh_config
# before:
# AllowGroups Group1
# After:
# AllowGroups Group1 Group2
- name: Add Group to AllowGroups
replace:
backup: yes
@lktslionel
lktslionel / git-clone-identity-key.sh
Created December 14, 2016 09:43
Git clone with a specific identity key
ssh-agent bash -c 'ssh-add -D && ssh-add <path/to/your/ssh/key/file> && git clone git@github.com:<username>/<repo>.git'
@barrywoolgar
barrywoolgar / hb_all_books_dl.js
Created September 2, 2016 11:06 — forked from graymouser/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript.
This will download all the books in all the formats available.
*/
$('a').each(function(i){
if (['MOBI', 'PDF', 'EPUB'].indexOf($.trim($(this).text())) >= 0) {
$('body').append('<iframe id="dl_iframe_'+i+'" style="display:none;">');
document.getElementById('dl_iframe_'+i).src = $(this).data('web');
}
@Girgitt
Girgitt / sftpserver_main.py
Created July 13, 2016 20:34
multithreaded sftp server in python based on https://github.com/rspivak/sftpserver
import time
import socket
import optparse
import sys
import textwrap
import paramiko
from sftpserver.stub_sftp import StubServer, StubSFTPServer
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@olih
olih / jq-cheetsheet.md
Last active July 2, 2024 12:10
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq