Skip to content

Instantly share code, notes, and snippets.

💭
Go away

Dave Reisner falconindy

💭
Go away
Block or report user

Report or block falconindy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@falconindy
falconindy / up.sh
Last active Sep 19, 2018
A shell function to cd to files/directories in your parent
View up.sh
up() {
local cdinto=0 x= traverse= curpath=
[[ $1 ]] || { cd ..; return; } # default to 1 level
[[ $1 = -d ]] && { cdinto=1; shift; }
for x; do
if [[ $x == +([[:digit:]]) ]]; then
(( x == 0 )) && return # noop
View find-https.bash
#
# Example usage:
# $ git clone --depth=1 git://git.archlinux.org/svntogit/packages.git
# $ ( cd packages >/dev/null && find-https ) >unused-https.txt
#
has_https_available() {
local https_url url_eff
https_url=https${1#http}
@falconindy
falconindy / journalprintf.py
Last active Aug 29, 2015
Journal printer with custom formatting
View journalprintf.py
#!/usr/bin/env python
'''
A journal reader which offers custom message formatting on output.
Example:
./journalprintf \
'{__REALTIME_TIMESTAMP} {_HOSTNAME} {_SYSTEMD_UNIT} {_COMM}[{_PID}]: {MESSAGE}' \
_SYSTEMD_UNIT=dnsmasq.service \
View keybase.md

Keybase proof

I hereby claim:

  • I am falconindy on github.
  • I am dreisner (https://keybase.io/dreisner) on keybase.
  • I have a public key whose fingerprint is 487E ACC0 8557 AD08 2088 DABA 1EB2 638F F56C 0C53

To claim this, I am signing this object:

@falconindy
falconindy / latest.py
Created Aug 17, 2014
Operate on the newest or oldest files in a directory tree
View latest.py
#!/usr/bin/env python
import argparse, os, glob, sys, operator, fnmatch
def stderr(*args):
print(*args, file=sys.stderr, end='')
def filter_files(files, filterpat, root=""):
entries = {}
View findpacnews.sh
#!/bin/bash
check_backup() {
[[ -f $1 ]] && echo "$1"
}
awk '/^%BACKUP%$/ {
while (getline) {
if (/^$/) { nextfile }
print $1
You can’t perform that action at this time.