This file contains hidden or 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
| set -u # check whether you have initialised all your variables | |
| set -e # exit on fail | |
| bash -n # syntax checks |
This file contains hidden or 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
| yum install yum-downloadonly | |
| yum update [PACKAGE] -y --downloadonly --downloaddir=[DIR] |
This file contains hidden or 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
| # Path to your oh-my-zsh configuration. | |
| ZSH=$HOME/.oh-my-zsh | |
| # Set name of the theme to load. | |
| # Look in ~/.oh-my-zsh/themes/ | |
| # Optionally, if you set this to "random", it'll load a random theme each | |
| # time that oh-my-zsh is loaded. | |
| ZSH_THEME="kolo" | |
| # Example aliases |
This file contains hidden or 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
| my_ac_adapt=`ioreg -w0 -l | grep ExternalConnected | awk '{print $5}'` | |
| if [ "$my_ac_adapt" != "Yes" ] | |
| then | |
| cur_power=`ioreg -w0 -l | grep CurrentCapacity | awk '{print $5}'` | |
| max_power=`ioreg -w0 -l | grep MaxCapacity | awk '{print $5}'` | |
| bat_percent=`echo "scale=2;$cur_power / $max_power" | bc` | |
| bat_percent=`echo "$bat_percent * 100" | bc | sed 's/.00//'` | |
| cyc_count=`ioreg -w0 -l | grep "Cycle Count" | awk 'BEGIN { FS = "=" } ; {print $8}' | awk 'BEGIN { FS = "}" } ; {print $1}'` | |
| #echo "Power : Battery ($bat_percent%)" | |
| echo "Cycles : $cyc_count" |
This file contains hidden or 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
| myCPU=`top -l 1 | awk '/CPU usage/ {print $3}' | sed s/%//` | |
| myCPU=`echo "tmp=$myCPU; tmp /= 1; tmp" | bc` | |
| typeset -i b=9 | |
| echo "CPU Usage \c" | |
| while [ $b -lt $myCPU ] | |
| do | |
| echo "\033[1;37m▇\033[0m\c" | |
| b=`expr $b + 10` | |
| done |
This file contains hidden or 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
| kill `pidof httpd` |
This file contains hidden or 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
| # unmerged branches | |
| git branch -a --merged master |
This file contains hidden or 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
| mv /tmp /tmp.old && ln -s /home/tmp /tmp | |
| chmod +t /home/tmp | |
| chmod a+w /home/tmp |
This file contains hidden or 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
| eval `ssh-agent -s` | |
| ssh-add ~/.ssh/*_rsa |
This file contains hidden or 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
| $ (root) useradd -m -s /bin/bash myuser | |
| $ (root) passwd myuser |
OlderNewer