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
| /** | |
| * Problem: | |
| * I have some action occurring on several parallel nodes. The action may have a diffrent result on each node non-deterministically. | |
| * I need to act from the master depending on the result at each node. | |
| * | |
| * For a contrived example, we record the name of each node used to act on the parallel actions specified in this pipeline. The | |
| * names are collected in a global string and a global `Map<String,String>` object for use by the master. | |
| * | |
| */ | |
| value = ':' |
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
| for NODE in $(docker node ls --format '{{.Hostname}}'); do | |
| IP_ADDR="$(docker node inspect --format '{{.Status.Addr}}' "${NODE}")"; | |
| echo -e "${NODE} - $(docker node inspect --format '{{.Status.Addr}}' "${NODE}")"; | |
| # Presumes your manager node can SSH into all worker nodes | |
| ssh ${IP_ADDR} docker container prune -f | |
| 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
| for NODE in $(docker node ls --format '{{.Hostname}}'); do | |
| echo -e "${NODE} - $(docker node inspect --format '{{.Status.Addr}}' "${NODE}")"; | |
| 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
| if [ -d $HOME/bin ]; then export PATH=$HOME/bin:$PATH ; fi | |
| # interactive only below this point | |
| if [ -t 1 ]; then | |
| export SOURCE_IP=`echo $SSH_CONNECTION | awk '{print $1}'` | |
| export CURRENT_IP=`echo $SSH_CONNECTION | awk '{print $3}'` | |
| if [[ ! -z "${CURRENT_IP}" ]]; then | |
| export PS1="${CURRENT_IP}:\w $ " | |
| fi | |
| echo "" | |
| fi |
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 | |
| SRC=$1 | |
| DST=$2 | |
| if [[ -z ${SRC} ]]; then echo "No source dir"; exit 1; fi | |
| if [[ -z ${DST} ]]; then echo "No destination dir"; exit 1; fi | |
| for d in $(ls $SRC); do | |
| if [ -d "$SRC/$d" ]; then | |
| CMD="rsync -r $SRC/$d/ $DST/$SRC/$d" |
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. Lift Weights | |
| 2. Sleep Well | |
| 3. Intermittent Fasting? Dietary Ketosis? | |
| 4. Cholesterol / Zinc / Magnesium / Vitamin D3 | |
| 5. Lower Estrogen: Weight Loss, No BPA | |
| 6. Reduce Stress | |
| 7. Increase Androgen Receptors: L-Carnitine & L-Tartrate / Reduce over stimulation |
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 pyVmomi import vim | |
| spec = vim.vm.device.VirtualDiskSpec() | |
| spec.operation = vim.vm.device.VirtualDeviceSpec.Operation.add | |
| spec.fileOperation = vim.vm.device.VirtualDeviceSpec.FileOperation.create | |
| spec.device = vim.vm.device.VirtualDisk( | |
| capacityInBytes=capacity_bytes, | |
| capacityInKB = capacity_kb, | |
| connectable = vim.vm.device.VirtualDevice.ConnectInfo( | |
| startConnected = True, |
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 clone git@github.com:[your fork of the upstream repo] | |
| cd [repo name] | |
| git remote add upstream https://github.com/[upstream repo] | |
| git fetch --all | |
| git pull upstream master | |
| git push origin master | |
| git checkout -b issue12345 | |
| # ... edit files ... | |
| git commit -a -m 'fixed issue12345' | |
| git push -u origin issue12345 |
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
| # How to create an RPM repository | |
| # This is for Redhat 64 bit versions of Linux. You can create your own RPM repository # to host your custom RPM packages. | |
| # | |
| # See "How to create an RPM from source with spec file" for more information. | |
| # https://gist.github.com/1376973 | |
| # Step: 1 | |
| # Install createrepo |
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 gvim /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf | |
| host phodev { | |
| hardware ethernet 00:0c:29:ab:9a:11; | |
| fixed-address 192.168.218.10; | |
| } |