Skip to content

Instantly share code, notes, and snippets.

@phunehehe
phunehehe / check_urls
Last active December 23, 2018 00:54
Script to check multiple URLs in Nagios, see http://phunehehe.net/check-multiple-urls-nagios/
#!/bin/bash
# Split URLs by comma
urls=${1//,/ }
for url in $urls
do
hostname="${url%%/*}"
if [[ "$url" = */* ]]
then
@phunehehe
phunehehe / philesight-ubuntu.md
Last active August 18, 2020 06:23
Philesight on Ubuntu

Install dependencies

sudo apt-get install libdb4.2-ruby1.8 libcairo-ruby1.8

Install Philesight

git clone https://github.com/phunehehe/philesight.git
@phunehehe
phunehehe / organize.sh
Created August 21, 2011 14:59
Organize files by file extension
#!/bin/sh
# Organize files by file extension
# Written in answer to http://unix.stackexchange.com/q/19110/250
# Configuration (feel free to add your types and change the path)
DOCUMENTS='
pdf
doc
'
@phunehehe
phunehehe / remove-gpg-user.sh
Last active March 31, 2022 09:02 — forked from glogiotatidis/remove-gpg-user.sh
Git-crypt remove user.
#!/usr/bin/env bash
#
# Script to remove GPG key from git-crypt
#
# It will re-initialize git-crypt for the repository and re-add all keys except
# the one requested for removal.
#
# Note: You still need to change all your secrets to fully protect yourself.
# Removing a user will prevent them from reading future changes but they will
# still have a copy of the data up to the point of their removal.
@phunehehe
phunehehe / slack-timesheet-bookmarklet.md
Last active March 1, 2024 19:45
Slack Timesheet Bookmarlet

Create a browser bookmark with the following code as the URL, name it Slack Timesheet or something

javascript:(async function() {
  allMessages = [];
  while (true) {
    buttons = document.getElementsByClassName('c-search__expand');
    buttons = Array.from(buttons);
    for (b of buttons) { b.click(); }