Skip to content

Instantly share code, notes, and snippets.

@c0nspiracy
c0nspiracy / keybase.md
Created April 15, 2015 09:39
Keybase Identity Proof

Keybase proof

I hereby claim:

  • I am c0nspiracy on github.
  • I am c0nspiracy (https://keybase.io/c0nspiracy) on keybase.
  • I have a public key whose fingerprint is 750B E7DF F828 BF5A 1520 AB87 8B71 1ED6 92E9 0E2A

To claim this, I am signing this object:

@c0nspiracy
c0nspiracy / crontab
Created January 26, 2014 15:18
crontab script for Synology Diskstation
#!/bin/sh
#
# Provides missing crontab editing
# Note: Synology crond requires arguments separated by a TAB character
# and the crontab user field only supports root. These requirements are
# enforced by this script.
#
# John Kelly, 2013-05-03
#
SCRIPTNAME=`basename $0`
@c0nspiracy
c0nspiracy / gist:4749522
Last active February 25, 2023 08:25
How to indent code in Vim

This answer summarises the other answers and comments of this question, and adds extra information based on the Vim documentation and the Vim wiki. For conciseness, this answer doesn't distinguish between Vi and Vim-specific commands.

In the commands below, "re-indent" means "indent lines according to your indentation settings." shiftwidth is the primary variable that controls indentation.

General Commands

>>   Indent line by shiftwidth spaces
<<   De-indent line by shiftwidth spaces
5>>  Indent 5 lines
5== Re-indent 5 lines
@c0nspiracy
c0nspiracy / extensions.sh
Created September 3, 2012 09:14
List all file extensions in the current directory and below
find . -type f | awk -F . '{print $NF}' | sort | uniq
@c0nspiracy
c0nspiracy / crondump.sh
Created September 3, 2012 09:12
Display a table of all cron jobs on the system
#!/bin/bash
# System-wide crontab file and cron job directory. Change these for your system.
CRONTAB='/etc/crontab'
CRONDIR='/etc/cron.d'
# Single tab character. Annoyingly necessary.
tab=$(echo -en "\t")
# Given a stream of crontab lines, exclude non-cron job lines, replace