Skip to content

Instantly share code, notes, and snippets.

View MikeDacre's full-sized avatar

Mike Dacre MikeDacre

View GitHub Profile
@MikeDacre
MikeDacre / flashcache
Created February 20, 2013 20:55
systemd script for flashcache - non-root disk Install to /usr/lib/systemd/system/flashcache.service. Activate with `systemctl enable flashcache` You need to update the shell script to reflect your own caches.
#!/bin/bash
HOMEMOUNT=$(mount | grep home | sed 's/ .*//' | sed 's#.*/##' )
if [[ ! "$(eval lsmod | grep "^flashcache")" ]]; then
modprobe flashcache
fi
if [[ ! "$HOMEMOUNT" == "flashcache" ]]; then
umount /home
@MikeDacre
MikeDacre / change_indent_length.py
Created December 11, 2012 19:01
Change number of spaces used for indentation in a file, only change spaces at start of file. Made for python, will work with any file.
#!/bin/env python3
#===============================================================================
#
# FILE: change_indent_length.py
#
# USAGE: cange_indent_length.py [-h] file_name old_tab_length new_tab_length
#
# DESCRIPTION: Change indent length, only change those at start of line
#
# AUTHOR: Michael D Dacre, [email protected]