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
| # add this to /etc/bashrc or /etc/profile | |
| #------------------------------------------ | |
| CPUTIME=$(ps -eo pcpu | awk 'NR>1' | awk '{tot=tot+$1} END {print tot}') | |
| CPUCORES=$(cat /proc/cpuinfo | grep -c processor) | |
| UP=$(echo `uptime` | awk '{ print $3 " " $4 }') | |
| echo " | |
| System Status | |
| Updated: `date` |
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
| source /Library/Developer/CommandLineTools/usr/share/git-core/git-prompt.sh | |
| export TERM="xterm-color" | |
| PS1="\`if [ \$? = 0 ]; then echo '\[\033[01;32m\]✓ \[\033[00m\]'; else echo '\[\033[01;31m\]✖ \[\033[00m\]'; fi\`\u@\h: \[\033[01;32m\]\w\[\033[01;34m\]\$(__git_ps1)\[\033[00m\]\$ " |
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
| #!/bin/bash | |
| SUMMARY=$1 | |
| DESC=$2 | |
| JIRA_URL="http://localhost/rest/api/2/issue/" | |
| JIRA_PROJ="Projectkey" | |
| JIRA_ISSUE_TYPE="Bug" | |
| JIRA_USER="username" | |
| JIRA_PASS="password" |
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
| sudo tcpdump -A -s 10240 'tcp port 8080 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | egrep --line-buffered "^........(GET |HTTP\/|POST |HEAD )|^[A-Za-z0-9-]+: " | sed -r 's/^........(GET |HTTP\/|POST |HEAD )/\n\1/g' |
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
| # F5 | |
| ssh ${LB-HOST} tmsh modify ltm node ${SERVICE_NAME} state user-up | |
| ssh ${LB-HOST} tmsh modify ltm node ${SERVICE_NAME} state user-down | |
| # Netscaler | |
| expect nsauth.exp ${USER} ${PASS} ${LB-HOST} "enable service ${SERVICE_NAME}" | |
| expect nsauth.exp ${USER} ${PASS} ${LB-HOST} "disable service ${SERVICE_NAME}" |
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
| git filter-branch --commit-filter ' | |
| if [ "$GIT_AUTHOR_EMAIL" = "[email protected]" ]; | |
| then | |
| GIT_AUTHOR_NAME="New Name"; | |
| GIT_AUTHOR_EMAIL="[email protected]"; | |
| git commit-tree "$@"; | |
| else | |
| git commit-tree "$@"; | |
| fi' HEAD |
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
| GIT_CURL_VERBOSE=1 GIT_TRACE=1 git pull origin 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
| <VirtualHost *:80> | |
| ServerName *.*.*.local.dev | |
| SetEnv APPLICATION_ENV "development" | |
| VirtualDocumentRoot /var/www/some_path/%1/%2/public/%3 | |
| <Directory "/var/www/developers_repo_path/*/*"> | |
| Options FollowSymLinks MultiViews | |
| AllowOverride All | |
| Order allow,deny |
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
| strace -vvvfFtT -s 65536 $(for pid in $(ps -C httpd -o pid=); do echo -n "-p $pid "; done) | |
| strace -c $(for pid in $(ps -C httpd -o pid=); do echo -n "-p $pid "; 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
| netstat -tuna | awk '$5 ~ /^[0-9]/ { print $5 }' | sed -e '/:[0-9]*/s/:[0-9]*//' | sort | uniq -c | sort -rn | while read line; do COUNT=$(echo $line | awk '{ print $1 }'); IP=$(echo $line | awk '{ print $2 }'); HNAME=$(dig +short -x ${IP}); if [ -z "$HNAME" ]; then HNAME=${IP}; fi; echo ${COUNT} ${HNAME}; done |
NewerOlder