Skip to content

Instantly share code, notes, and snippets.

@bjoseru
bjoseru / list_repos.py
Last active July 31, 2021 04:56
Print a list of all git repositories found below your home directory along with their remotes
#!/usr/bin/env python3
# coding: utf-8
# written for Python 3.9.4
# Copyright (C) 2021 by Björn Rüffer
#
"Print a list of all git repositories found below your home directory along with their remotes."
import glob
import itertools
import pathlib
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bjoseru
bjoseru / bib.lco
Last active August 29, 2015 14:10
A minimal working example of an alphabetically sorted bibliography (compatible with bibtex) that stops working once the babel package is included.
\ProvidesFile{bib.lco}
%
% Provide a bibliography for letters that is numbered alphabetically.
% This file is in the public domain and it can be included in letters
% written in the scrlttr2-class by stating it as an option. See
% `letter class options` in the KOMA guide.
%
% Some of the following is taken from
% http://tex.stackexchange.com/questions/18033/using-bibtex-with-letter-class
% but see also
@bjoseru
bjoseru / ACLs
Last active August 29, 2015 14:03
Error log for serverfault question "gcloud auth activate-service-account"
$gsutil acl get gs://mybucket
[
{
"entity": "project-owners-1234567890",
"projectTeam": {
"projectNumber": "1234567890",
"team": "owners"
},
"role": "OWNER"
},
@bjoseru
bjoseru / fileit.sh
Created July 23, 2012 13:52
take given files and archive them in a pre-specified folder under descriptive names
#!/bin/bash
# Copyright (C) 2012 by Bjoern Rueffer
# take given files and put them into ~/Documents20xx under a
# descriptive name
date=`date +%m-%d`
destdir=~/Documents`date +%Y`
prefix=""
if [ ! \( -d "$destdir" \) ]; then
@bjoseru
bjoseru / burst.sh
Created July 2, 2012 11:25
Single-command shell script to split a PDF into single pages (based on PDFTK)
#!/bin/bash
# (c) Bjoern Rueffer 2012
function usagetext()
{
cat<<EOF
Usage: $0 [-d] filename.pdf
Will burst a file into single pages, numbered as filename_##.pdf. If -d
is specified, filename.pdf will be deleted afterwards.
@bjoseru
bjoseru / org-find-dangling-clock.el
Created October 29, 2011 08:49
find a dangling clock in org-mode
(defun org-find-dangling-clock ()
"Find a dangling clock entry in an org-mode buffer"
(interactive)
(re-search-forward "CLOCK: \\[[^]]*\\] *$")
)
@bjoseru
bjoseru / commitid
Created October 17, 2011 15:00
git commid id watermarking script
#!/bin/bash
# Time-stamp: <2013-03-01 18:33:01 rueffer>
# Copyright (C) 2011-2013 by Bjoern Rueffer
function usage {
cat <<EOF
Usage: `basename $0` [-p] <files>
`basename $0` --clean