Skip to content

Instantly share code, notes, and snippets.

@digitaltrails
digitaltrails / notify-desktop
Last active March 22, 2024 09:19
notify-desktop - linux find and notify desktop session
#!/bin/bash
# Provides a way for a root process to perform a notify send for each
# of the local desktop users on this machine.
#
# Intended for use by cron and timer jobs. Arguments are passed straight
# to notify send. Falls back to using wall. Care must be taken to
# avoid using this script in any potential fast loops.
#
# X11 users should already have a dbus address socket at /run/user/<userid>/bus
# and this script should work without requiring any initialisation. Should
@thomsh
thomsh / unbound-setup-root.sh
Last active April 16, 2023 21:11
unbound install named.cache / root.hints [unchecked]
#!/bin/bash
# [unchecked] !
set -euxo pipefail
gpg --recv-keys 0x937BB869E3A238C5 --keyserver keys.gnupg.net || gpg --recv-keys 0x937BB869E3A238C5 --keyserver pgp.mit.edu
gpg --with-fingerprint -k 0x937BB869E3A238C5 |grep -B 1 'F0CB 1A32 6BDF 3F3E FA3A 01FA 937B B869 E3A2 38C5'
wget https://www.internic.net/domain/named.cache.sig -O /tmp/named.cache.sig
wget https://www.internic.net/domain/named.cache -O /tmp/named.cache
cd /tmp/ && gpg --with-fingerprint --verify named.cache.sig
install -m 0644 /tmp/named.cache /var/lib/unbound/root.hints
echo installed
@saschadoemer
saschadoemer / gpg-no-tty.sh
Last active September 21, 2023 13:44
Simple workaround for "no-tty" GPG signing - Part I
# file /home/user/gpg-no-tty.sh
#!/bin/bash
/usr/bin/gpg --batch --no-tty "$@"
@fmakowski
fmakowski / README.md
Created November 24, 2017 10:59 — forked from BrianHicks/README.md
Graph taskwarrior tasks with graphviz

Graph taskwarrior tasks with graphviz

Dependencies

Running

graphdeps produces "deps.png" in the working directory. Just graphdeps will graph all tasks. You can change the default behavior by specifying a more specific query.

@simonmichael
simonmichael / .bashrc.task
Last active January 18, 2022 17:55
taskwarrior config 2016/01
# Simon's taskwarrior aliases
########################################
# general commands
alias t="task"
alias ta="task add"
alias td="task done"
alias t-="task delete"
alias tm="task modify"
@wbsch
wbsch / on-modify.blocks_attr.py
Last active February 21, 2024 19:03
Taskwarrior hook script that adds a "blocks:" pseudo-attribute for adding/modifying tasks.
#!/usr/bin/env python
#
# Adds the ability to add / modify tasks using a "blocks:" attribute,
# the opposite of "depends:".
#
# This script acts as an on-modify, on-add and on-launch hook at the same time.
#
### SETUP
# Save this file as
# ~/.task/hooks/on-modify.blocks_attr.py
@BrianHicks
BrianHicks / README.md
Created May 22, 2012 15:39
Graph taskwarrior tasks with graphviz

Graph taskwarrior tasks with graphviz

Dependencies

Running

graphdeps produces "deps.png" in the working directory. Just graphdeps will graph all tasks. You can change the default behavior by specifying a more specific query.

@minrk
minrk / checkipnb.py
Last active April 9, 2022 16:51
run and validate a notebook
#!/usr/bin/env python
"""
simple example script for running notebooks and reporting exceptions.
Usage: `checkipnb.py foo.ipynb [bar.ipynb [...]]`
Each cell is submitted to the kernel, and checked for errors.
"""
import os,sys,time
@yura
yura / pdf2jpg.sh
Created November 10, 2010 15:18
script to PDF to JPG using pdftk and imagemagick
#!/bin/bash
# Script to convert PDF file to JPG images
#
# Dependencies:
# * pdftk
# * imagemagick
PDF=$1