Bash script to:
- Iterate all commits made within a Git repository.
- List every object at each commit.
| #!/bin/bash | |
| # dedupe_list() is a helper function to dedupe a list of items separated by a given separator | |
| # eg dedupe_list ":" "a:b:a:c" will return "a:b:c", or dedupe_list ":" "$PATH" will return a deduped $PATH | |
| # the seperator you pass is used to split the existing list, and reinserted in the same order | |
| dedupe_list() { | |
| local separator="$1" | |
| # Use awk to preserve order while deduping | |
| echo "$2" | tr "$separator" '\n' | awk '!seen[$0]++ && NF' | tr '\n' "$separator" | |
| } |
| #!/usr/bin/env bash | |
| # example of using fontforge from the CLI to merge fonts into a single TTC file | |
| # also removes extra spaces from metadata and can remove a specific string from metadata | |
| fontforge -lang=py -c "$(cat <<EOF | |
| from os import remove | |
| import sys | |
| import glob |
| awk -v RS='' -v FS='\n' -v OFS='\n' 'BEGIN {} | |
| BEGINFILE {print "---"; print FILENAME ":"} | |
| { | |
| for (i=1; i<=NF; i++) { | |
| gsub(/^[ \t]+|[ \t]+$/, "", ) | |
| if ( ~ /^define (command|contact|contactgroup|host|hostgroup|service|servicegroup|timeperiod)/) { | |
| split(, a, /[ {]/) | |
| define = 1 | |
| in_section = a[2] |
| // Run code in Browser Console after enabling chrome debugging -- | |
| // about:config => devtools.chrome.enabled => true | |
| // https://developer.mozilla.org/docs/Tools/Browser_Console | |
| try { | |
| var tabPromise = SyncedTabs._internal.getTabClients(); | |
| tabPromise.then((arrDevices) => { | |
| if (arrDevices && arrDevices.length > 0){ | |
| // Generate a string with the format of a bookmark export file | |
| var d, e, out = '<!DOCTYPE NETSCAPE-Bookmark-file-1>\n<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">\n<TITLE>Bookmarks</TITLE>\n<H1>Bookmarks Menu</H1>\n<DL><p>\n'; | |
| const escapeHtmlEntities = function(aText){return (aText || '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''')}; |
| #!/bin/bash | |
| # store the current dir | |
| CUR_DIR=$(pwd) | |
| # Let the person running the script know what's going on. | |
| echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n" | |
| # Find all git repositories and update it to the master latest revision | |
| for i in $(find . -name ".git" | cut -c 3-); do |
| #!/usr/bin/env bash | |
| # Script create report for installed packages | |
| #TODO check bash version, probably need >4 | |
| DEBUG=0 | |
| function my_debug() { | |
| local debug_prefix="DEBUG:\t" | |
| if [ $DEBUG -gt 0 ]; then |
| #!/usr/bin/env bash | |
| APT_PKGS="" | |
| function install { | |
| FILE="$2" | |
| URL="$1/$FILE" | |
| wget $URL -O $FILE | |
| sudo gdebi $FILE | |
| rm $FILE |
| /* Found here https://bbs.archlinux.org/viewtopic.php?pid=1551884#p1551884 | |
| By user Trilby | |
| Compile with `gcc -o track track.c -lX11`, and consider putting into .xinitrc | |
| like `track >> window.log` | |
| */ | |
| #include <stdio.h> | |
| #include <time.h> | |
| #include <X11/Xlib.h> | |
I hereby claim:
To claim this, I am signing this object: