Skip to content

Instantly share code, notes, and snippets.

# Git basics
## List Git branches
alias b="git branch --list; git remote show origin"
alias d='git diff '
alias g='git status '
alias ga='git add --all '
alias gc='git commit '
alias gco='git checkout '
## Git amend last commit message
alias gcatext='git commit --amend '
#!/usr/bin/env bash
alias unrar="unrar e -r *.rar"
# Find string within files
alias fs="/usr/bin/find . -type f -print|xargs grep -n "
# Find file by name
alias ff="/usr/bin/find . -name "
# RPi firmware details
alias fw='/opt/vc/bin/vcgencmd version'
alias bbfw='/usr/bin/vcgencmd version'
# Kodi (on a BusyBox-based OS, such as LibreELEC)
alias kls="cat /storage/.kodi/temp/kodi.log | grep " # Kodi log search
alias klw="tail -f /storage/.kodi/temp/kodi.log " # Kodi log watch
alias klt="tail -200 /storage/.kodi/temp/kodi.log | more " # Kodi log tail
@inspector71
inspector71 / remote.xml
Last active March 5, 2023 12:21
Kodi LG
<keymap>
<global>
<remote>
<skipplus>ContextMenu</skipplus>
</remote>
</global>
</keymap>
# Thanks to http://ezprompt.net/
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo "[${BRANCH}${STAT}]"
else
echo ""
@inspector71
inspector71 / userChrome.css
Last active February 5, 2019 07:27
Firefox 65 on Windows 8.1: menu; navigation; tabs; content
/*
>>>> NOTE: buggy when dragging / re-ordering tabs.
With thanks to everyone on /r/FirefoxCSS, I have this:
https://i.imgur.com/YE3s6gm.png
Firefox 65 on Windows 8.1, from the top:
@inspector71
inspector71 / remote.xml
Created January 25, 2019 05:08
Kodi Bravia
<!-- Sony Bravia KDL-32W5500 (remote: RM-GD007) -->
<keymap>
<global>
<remote>
<red>ContextMenu</red>
<yellow>ReloadSkin()</yellow>
<blue>reloadkeymaps</blue>
</remote>
@inspector71
inspector71 / routing.bash
Created November 14, 2018 00:36
routing
# Accept all loopback traffic localhost or 127.0.0.1
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# Accept all local traffic from 192.168.1.1-192.168.1.255
iptables -A INPUT -s 192.168.1.0/24 -d 192.168.1.0/24 -j ACCEPT
@inspector71
inspector71 / raspbian-lite-syncthing
Last active October 20, 2018 10:29
Install and autostart syncthing on Raspbian 9 (stretch)
# As root
apt install syncthing
nano /etc/systemd/syncthing.service
# Paste contents of
# https://raw.githubusercontent.com/syncthing/syncthing/master/etc/linux-systemd/system/syncthing%40.service
Ctrl + o
Crtl + x
# As "pi" user
sudo systemctl enable syncthing@pi.service
@inspector71
inspector71 / Git branch bash autocomplete *with aliases*
Created September 5, 2018 03:39 — forked from JuggoPop/Git branch bash autocomplete *with aliases*
Git branch bash autocomplete *with aliases* (add to .bash_profile)
# To Setup:
# 1) Save the .git-completion.bash file found here:
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
# 2) Add the following lines to your .bash_profile, be sure to reload (for example: source ~/.bash_profile) for the changes to take effect:
# Git branch bash completion
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
# Add git completion to aliases