Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: tpo/little_shell_scripts
base: 11b916d39c
...
head fork: tpo/little_shell_scripts
compare: 5e3c125db1
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
2  Makefile
@@ -5,6 +5,6 @@ create_readme:
@echo >> README.md
@echo "Here's the --help for each shell script:" >> README.md
@echo >> README.md
- @bash -c 'for i in `ls|grep -v README|grep -v Makefile`; do echo "### $$i"; echo; $$i --help; done >> README.md; true'
+ @bash -c 'for i in `ls|grep -v README|grep -v Makefile`; do echo "### $$i"; echo; ./$$i --help; done >> README.md; true'
.PHONY: create_readme
View
48 README.md
@@ -2,6 +2,54 @@
Here's the --help for each shell script:
+### bash_aliases
+
+These bash_aliases need to be called from ~/.bashrc or similar like this:
+
+ . /path/to/this/bash_aliases
+
+They provide to following commands:
+
+They provide to following commands:
+
+ df - execute "df -h"
+ du - execute "du -h"
+ bc - allow for calculations with decimal places by default in bc
+ psa - show all processes but not kernel threads
+ hg - grep shell history
+ hl - page shell history
+ pg - grep processes
+
+Shortcuts to put firefox or thunderbird to rest.
+Requires firefox-sleep/wake and thunderbird-sleep/wake
+
+ ffs, ffw, ths, thw
+
+git shortcuts
+
+ g - status
+ gd - diff
+ ga - add
+ gc - commit
+ gca - commit -a
+ gcam - commit -a -m
+ gci - commit --interactive
+
+chmod shortcuts
+
+ +x file
+ +r file
+ +w file
+ a+x file
+ a+r file
+ a+w file
+
+change directory
+
+ cdreal file - chdir to wherever the file is located
+ cdwhich file - chdir to wherever the executable is located
+ mcd file - make directory and cd into it
+
### brightness
usage: brightness [--show|percent]
View
102 bash_aliases
@@ -0,0 +1,102 @@
+#!/bin/bash
+
+help() {
+ echo 'These bash_aliases need to be called from ~/.bashrc or similar like this:'
+ echo
+ echo ' . /path/to/this/bash_aliases'
+ echo
+ echo 'They provide to following commands:'
+ echo
+ echo 'They provide to following commands:'
+ echo
+ echo ' df - execute "df -h"'
+ echo ' du - execute "du -h"'
+ echo ' bc - allow for calculations with decimal places by default in bc'
+ echo ' psa - show all processes but not kernel threads'
+ echo ' hg - grep shell history'
+ echo ' hl - page shell history'
+ echo ' pg - grep processes'
+ echo
+ echo 'Shortcuts to put firefox or thunderbird to rest.'
+ echo 'Requires firefox-sleep/wake and thunderbird-sleep/wake'
+ echo
+ echo ' ffs, ffw, ths, thw'
+ echo
+ echo 'git shortcuts'
+ echo
+ echo ' g - status'
+ echo ' gd - diff'
+ echo ' ga - add'
+ echo ' gc - commit'
+ echo ' gca - commit -a'
+ echo ' gcam - commit -a -m'
+ echo ' gci - commit --interactive'
+ echo
+ echo 'chmod shortcuts'
+ echo
+ echo ' +x file'
+ echo ' +r file'
+ echo ' +w file'
+ echo ' a+x file'
+ echo ' a+r file'
+ echo ' a+w file'
+ echo
+ echo 'change directory'
+ echo
+ echo ' cdreal file - chdir to wherever the file is located'
+ echo ' cdwhich file - chdir to wherever the executable is located'
+ echo ' mcd file - make directory and cd into it'
+ echo
+ exit
+}
+
+if [ "$1" == "--help" ]; then
+ help
+fi
+
+alias df="df -h"
+alias du="du -h"
+# bc: scale=20
+alias bc="bc -l"
+
+# firefox/thunderbird
+alias ffs=firefox-sleep
+alias ffw=firefox-wake
+alias ths=thunderbird-sleep
+alias thw=thunderbird-wake
+
+# do not show kernel threads:
+# omit lines with "0:00 [kworker/6:0]" or similar
+alias psa="ps auxw|grep -v -P '\d:\d\d \['"
+
+hg() { history | grep "$1"; }
+hl() { history | less +G; }
+pg() { ps auxw | grep "$1"; }
+mcd() { mkdir "$1"; cd "$1"; }
+
+# chmod
+alias +x='chmod +x'
+alias +r='chmod +r'
+alias +w='chmod +w'
+alias a+x='chmod a+x'
+alias a+r='chmod a+r'
+alias a+w='chmod a+w'
+
+cdreal() {
+ if [ ! "$1" ]; then
+ dst=.
+ else
+ dst="$1"
+ fi
+ dst=`realpath "$dst"`
+ if [ ! -d "$1" ]; then
+ dst=`dirname "$dst"`
+ fi
+ cd "$dst"
+}
+
+cdwhich() {
+ cd $( dirname $( which $1 ))
+}
+
+
View
4 firefox-sleep
@@ -14,8 +14,10 @@ help() {
[ "$1" == "--help" ] && help
-# Debian has firefox-bin Ubuntu firefox
+# Debian has firefox-bin and iceweasel
+# Ubuntu has firefox
# Debian has fullpath with arguments
+pkill -STOP -f "(^|/)+iceweasel( |$)+"
pkill -STOP -f "(^|/)+firefox(-bin)*( |$)+"
pkill -STOP -f "x-www-browser"
pkill -STOP -f "(^|/)+plugin-container( |$)+"
View
1  firefox-wake
@@ -14,6 +14,7 @@ help() {
[ "$1" == "--help" ] && help
+pkill -CONT -f "(^|/)+iceweasel( |$)+"
pkill -CONT -f "(^|/)+firefox(-bin)*( |$)+"
pkill -CONT -f "x-www-browser"
pkill -CONT -f "(^|/)+plugin-container( |$)+"

No commit comments for this range

Something went wrong with that request. Please try again.