View aliases.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 " |
View colour-prompt.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 "" |
View gitmerge.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Git merge new / updated code into current branch, from another branch, keeping remote / central repo in mind | |
git checkout <hostOrReceivingBranch> # 1. If not already there, load the branch you'll merge code into | |
git pull origin <hostOrReceivingBranch> # 2. Update, get (pull) other people's changes to a remote or central (origin) branch | |
git merge <newOrUpdatedCodeBranch> # 3. Merge the code from your new / updated branch into the branch currently loaded | |
git push origin <hostOrReceivingBranch> # 4. Push your changes back to a remote / central (origin) branch for everyone to see |
View Git branch bash autocomplete *with aliases*
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
View raspbian-lite-syncthing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
View routing.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
View remote.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<keymap> | |
<global> | |
<remote> | |
<skipplus>ContextMenu</skipplus> | |
</remote> | |
</global> | |
</keymap> |
View remote.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Sony Bravia KDL-32W5500 (remote: RM-GD007) --> | |
<keymap> | |
<global> | |
<remote> | |
<red>ContextMenu</red> | |
<yellow>ReloadSkin()</yellow> | |
<blue>reloadkeymaps</blue> | |
</remote> |
View userChrome.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
>>>> 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: |
View aliases-git.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 ' | |
## Git amend last commit message | |
alias gcatext='git commit --amend ' | |
## Git add a file to the last commit |
OlderNewer