Skip to content

Instantly share code, notes, and snippets.

View mnuessler's full-sized avatar
💻
Open to freelance work

Matthias Nüßler mnuessler

💻
Open to freelance work
View GitHub Profile
@mnuessler
mnuessler / dependency-report.gradle
Created July 2, 2021 12:17 — forked from nikialeksey/dependency-report.gradle
Gradle: multi-project dependency graph (supports depth > 2, supports gradle 4.4+)
// Inspired by https://gist.github.com/tzachz/419478fc8b009e953f5e5dc39f3f3a2a
// Task creates a .dot file with all inter-module dependencies
// Supports any depth of nested modules
task moduleDependencyReport {
doLast {
def file = new File("project-dependencies.dot")
file.delete()
file << "strict digraph {\n"
file << "splines=ortho\n"
@mnuessler
mnuessler / org.nuessler.mail.work.plist
Created April 26, 2019 11:14
Launchd config for offlineimap
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.nuessler.mail.work</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/offlineimap</string>
<string>-o</string>
@mnuessler
mnuessler / StackDriverRewritePolicy.java
Created February 22, 2019 08:47
A log4j2 rewrite policy that maps the log level to StackDriver severity and stores the value inside the context.
package com.github.mnuessler.log4j;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.Core;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.appender.rewrite.RewritePolicy;
import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.config.plugins.PluginFactory;
import org.apache.logging.log4j.core.impl.ContextDataFactory;
import org.apache.logging.log4j.core.impl.Log4jLogEvent;
@mnuessler
mnuessler / unix-timestamp-to-date.el
Last active February 27, 2021 19:12
Emacs Lisp interactive function that prompts for a unix epoch time stamp and converts it into a human readable date.
(defun unix-timestamp-to-date ()
"Prompts for a unix epoch time stamp and converts it to a human-readable date"
(interactive)
(let* ((time-zone "UTC")
(time-unix (seconds-to-time (read-number "Unix epoch time stamp: ")))
(time-str (format-time-string "<%Y-%m-%d %a %H:%M:%S>" time-unix time-zone)))
(message "Date: %s (%s)" time-str time-zone)))
@mnuessler
mnuessler / MERGE_COMMIT_TEMPLATE.md
Created November 9, 2018 10:43
A merge commit template for use with the browser extension 'refined-bitbucket'. https://github.com/refined-bitbucket/refined-bitbucket

Merge "{title}" (#{id})

{description}

{approvedByList}

@mnuessler
mnuessler / screen.md
Created October 9, 2018 08:55 — forked from fredrick/screen.md
GNU Screen Cheat Sheet

#GNU Screen Cheat Sheet

##Basics

  • ctrl a c -> cre­ate new win­dow
  • ctrl a A -> set win­dow name
  • ctrl a w -> show all win­dow
  • ctrl a 1|2|3|… -> switch to win­dow n
  • ctrl a " -> choose win­dow
  • ctrl a ctrl a -> switch between win­dow
  • ctrl a d -> detach win­dow
@mnuessler
mnuessler / twoline_prompt.sh
Created October 7, 2017 12:29 — forked from mkottman/twoline_prompt.sh
A two-line colored Bash prompt (PS1) with Git branch and a line decoration which adjusts automatically to the width of the terminal. Recognizes SVN, Git and Fossil version control systems and shows the current branch/revision.
# A two-line colored Bash prompt (PS1) with Git branch and a line decoration
# which adjusts automatically to the width of the terminal.
# Recognizes and shows Git, SVN and Fossil branch/revision.
# Screenshot: http://img194.imageshack.us/img194/2154/twolineprompt.png
# Michal Kottman, 2012
RESET="\[\033[0m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"
@mnuessler
mnuessler / log4j.properties
Last active June 29, 2016 07:12
Logging configuration for Gerrit that writes everything nach stdout.
log4j.rootLogger=INFO, stdout
log4j.logger.sshd_log=INFO, sshd_log
log4j.logger.httpd_log=INFO, httpd_log
log4j.logger.gc_log=INFO, gc_log
log4j.logger.replication_log=INFO, replication_log
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.apConversionPattern=[%d] %-5p %c %x: %m%n
@mnuessler
mnuessler / locales.sh
Created June 21, 2016 13:02
Fixes warning "Setting locale failed." on Debian
# Fix this warning on Debian/Ubuntu:
# perl: warning: Setting locale failed.
# perl: warning: Please check that your locale settings:
# LANGUAGE = (unset),
# LC_ALL = (unset),
# LANG = "en_US.utf8"
# are supported and installed on your system.
# perl: warning: Falling back to the standard locale ("C").
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
@mnuessler
mnuessler / fingerprints.sh
Created March 10, 2016 11:56
Host SSH key fingerprints for all key ciphers
#!/bin/bash
# Not my own creation, copied from:
# http://superuser.com/questions/929566/sha256-ssh-fingerprint-given-by-the-client-but-only-md5-fingerprint-known-for-se
# standard sshd config path
SSHD_CONFIG=/etc/ssh/sshd_config
# helper functions
function tablize {