Skip to content

Instantly share code, notes, and snippets.

View edwardtheharris's full-sized avatar
:shipit:
; – Hide and seek champion since 1971

Xander Harris edwardtheharris

:shipit:
; – Hide and seek champion since 1971
View GitHub Profile
@edwardtheharris
edwardtheharris / cadvisor.sh
Last active March 20, 2025 14:21
cadvisor docker run script
VERSION=v0.49.1 # use the latest release version from https://github.com/google/cadvisor/releases
sudo docker run \
--volume=/:/rootfs:ro \
--volume=/var/run:/var/run:ro \
--volume=/sys:/sys:ro \
--volume=/var/lib/docker/:/var/lib/docker:ro \
--volume=/dev/disk/:/dev/disk:ro \
--publish=8080:8080 \
--detach=true \
--name=cadvisor \
@edwardtheharris
edwardtheharris / firmware-install.sh
Last active March 17, 2025 05:03
ArchLinux install missing firmware
#!/bin/bash
# You will need to use `yay` or some other Pacman tool with access to the AUR.
yay -Syyu aic94xx-firmware ast-firmware linux-firmware-qlogic upd72020x-fw wd719x-firmware
# Extra packages for a more complete system when following the install guide.
# https://wiki.archlinux.org/title/Installation_guide
pacstrap -K /mnt base base-devel linux linux-headers linux-firmware git \
@edwardtheharris
edwardtheharris / samba-tool-completion.md
Last active February 18, 2024 18:07
samba-tool.bash.completion

Bash Completion for samba-tool

I noticed that this was missing or difficult to find on the internet, so I had my friendly local AI write one up for me.

It's incomplete at the moment, but I will be updating it with more commands and options as I continue to use samba-tool.

Anyway, hopefully this is helpful to someone.

@edwardtheharris
edwardtheharris / git-prepare-commit-msg.py
Last active May 8, 2024 16:21
A selection of git commit message preparation scripts
#!/usr/bin/env python3
"""
A small Python script to produce commit messages.
.. rubric:: Prepare Commit Message
This hook is invoked by `git-commit[1] <https://git-scm.com/docs/git-commit>`_
right after preparing the default log message, and before the editor is started.
It takes one to three parameters. The first is the name of the file that
@hgomez
hgomez / jenkins-plugins-batch-install.md
Last active January 26, 2025 14:45
Mass install/update of Jenkins Plugins

Scripted Jenkins Plugins install

Jenkins has a very rich catalog of plugins and it's quite easy to install and update them via UI. BTW, when you want to add tons of plugin via UI, it's a fairly long and boring procedure.

Hopefully, mass installation (or update) could be easy using a simple bash script (curl/python required) :

Create a file containing plugins to be installed (or updated), ie iplugins :

@plepe
plepe / gist:52ecc9f18efb32c68d18
Last active April 3, 2025 19:15
MDADM and LVM cheat sheet

mdadm

Glossary:

  • md: multiple devices
command description
cat /proc/mdstat show status of all raids
mdadm --detail /dev/md0 detailed status of raid md0
@zsup
zsup / ddd.md
Last active April 2, 2025 23:33
Documentation-Driven Development (DDD)

Documentation-Driven Development

The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.

  • Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
  • Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
  • Once documentation has been written, development should commence, and test-driven development is preferred.
  • Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
  • When a feature is being modified, it should be modified documentation-first.
  • When documentation is modified, so should be the tests.
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 1, 2025 01:48
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@ozh
ozh / gist:4154909
Created November 27, 2012 15:41
Git trick: have a branch mirror another one

Git post-commit hook to keep master and gh-pages branch in sync :

In your Git repository create a file .git/hooks/post-commit and fill it with this:

#!/bin/sh
git checkout gh-pages
git rebase master
git checkout master