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 | |
| # Just because I'm tired of copy/paste from evernote. | |
| export MARATHON_URL=${MARATHON_URL:-'127.0.0.1:8080'} | |
| export CONSUL_URL=${CONSUL_URL:-'127.0.0.1:8500'} | |
| export MESOS_URL=${MESOS_URL:-'127.0.0.1:5050'} | |
| function mesosHealth() { | |
| curl -v -x '' "${MESOS_URL}"/master/health |
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
| # From /dev/null to file | |
| gdb -p processpid | |
| (gdb) call creat("/home/me/myprog.stdout",0600) | |
| $1 = 7 | |
| (gdb) call dup2(7,1) | |
| $2 = 1 | |
| (gdb) call creat("/home/me/myprog.stderr",0600) | |
| $3 = 8 | |
| (gdb) call dup2(8,2) |
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
| # Removing all containers | |
| docker rm `docker ps --no-trunc -aq` |
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
| # Mac restart all network interfaces | |
| for i in `ifconfig -l `; do sudo ifconfig $i down && sudo ifconfig $i up; done | |
| #Routing table. | |
| netstat -rn | |
| route -n | |
| ip route list | |
| #Checking ports. | |
| netstat –lp --inet |
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
| # Users list. | |
| cat /etc/passwd | |
| # Groups list. | |
| cat /etc/group | |
| # List of groups for a given user. | |
| id -nG vagrant | |
| # Creating a new user. |
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
| # 1. To free pagecache, dentries and inodes in cache memory | |
| sync; echo 3 > /proc/sys/vm/drop_caches | |
| # 2. To free dentries and inodes use following command | |
| sync; echo 2 > /proc/sys/vm/drop_caches | |
| # 3. To free pagecache only use following command | |
| sync; echo 1 > /proc/sys/vm/drop_caches | |
| swapoff |
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 | |
| _help() { | |
| cat <<EOHELP | |
| USAGE: $0 <src folder> <dest folder>[...] | |
| Create symlinks to .file-name for every file into a given folder. | |
| OPTIONS: | |
| -h, --help Display this message and exit. | |
| EOHELP |
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 remote add upstream git://github.com/your-repo | |
| git checkout master | |
| git fetch upstream | |
| git merge upstream/master | |
| git checkout BRANCH_NAME | |
| git rebase 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
| #!/bin/bash | |
| fdisk -l | |
| df -h | |
| du -sh ./* | |
| mkfs.ext3 | |
| pvscan | |
| pvdisplay |
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 | |
| _help() { | |
| cat <<EOHELP | |
| USAGE: $0 <command> <folder> <repo> <branch>[...] | |
| Run actions for keeping a git repo up to date with the last changes in a given Jenkins folder. | |
| COMMANDS: | |
| sync syncronize the jenkins file with a given repo. |
NewerOlder