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
| class TreeNode: | |
| def __init__(self, data, left=None, right=None): | |
| self.data=data | |
| self.left=left | |
| self.right=right | |
| def get_paths(node,sum): | |
| def test(): | |
| n1=TreeNode(-2, TreeNode(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
| ## Packer | |
| export PACKER_CONFIG=$HOME/.packerconfig | |
| export PACKER_OUTPUT=~/Repositories/T-Mobile/Packer/packer/output/ ## or your clonedir | |
| export PACKER_USERNAME="$(whoami)@gsm1900.org" | |
| export PACKER_PASSWORD='your_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
| #!/bin/bash | |
| ## Destroys all Virtualbox VMs | |
| # Drop running pids | |
| while read -r pid; do | |
| kill -9 ${pid} | |
| done < <(pgrep -i vboxheadless) | |
| # Destroy all machine | |
| while read -r name; do |
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 | |
| begin=$(date +"%s") | |
| ovftool \ ## init ovftool | |
| --powerOffSource \ ## shut down source machine prior to transfer | |
| --powerOn \ ## after transfer boot device | |
| --name='VMTransferName' \ ## rename target to something | |
| --vmFolder='Templates' \ ## folder to place vm into | |
| --datastore=${VC_DATASTORE} \ ## datastore to utilize | |
| --network=${VC_NETWORK} \ ## network to attach to |
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
| <?php | |
| $codes = [ | |
| 1 => 'CURL_UNSUPPORTED_PROTOCOL', | |
| 2 => 'CURL_FAILED_INIT', | |
| 3 => 'CURL_URL_MALFORMED', | |
| 4 => 'CURL_URL_MALFORMED_USER', | |
| 5 => 'CURL_COULD_NOT_RESOLVE_PROXY', | |
| 6 => 'CURL_COULD_NOT_RESOLVE_HOST', | |
| 7 => 'CURL_COULD_NOT_CONNECT', |
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
| <?php | |
| define('APP_DIR', dirname(__DIR__)); // autloads in non-sample script.... | |
| $hosts = array_filter(explode("\n", file_get_contents(APP_DIR . '/data/sites.txt'))); | |
| /** | |
| * Processes in Parallel. | |
| * | |
| * Run a function (with no return result) on each item in an array in parallel. |
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 | |
| echo -e "[main] | |
| certname = $(hostname).unix.gsm1900.org | |
| server = puppet37.px.unix.gsm1900.org | |
| ca_server = admpupt112.unix.gsm1900.org | |
| vardir = /var/opt/lib/pe-puppet | |
| logdir = /var/log/pe-puppet | |
| rundir = /var/run/pe-puppet | |
| modulepath = /etc/puppetlabs/puppet/modules:/opt/puppet/share/puppet/modules |
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/ksh | |
| function aixversion { | |
| OSLEVEL=$(oslevel -s) | |
| AIXVERSION=$(echo "scale=1; $(echo $OSLEVEL | cut -d'-' -f1)/1000" | bc) | |
| AIXTL=$(echo $OSLEVEL | cut -d'-' -f2 | bc) | |
| AIXSP=$(echo $OSLEVEL | cut -d'-' -f3 | bc) | |
| ## Outputs: AIX 6.1 - Technology Level 8 - Service Pack 3 | |
| echo "AIX ${AIXVERSION} - Technology Level ${AIXTL} - Service Pack ${AIXSP}" | |
| } |
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
| Boot OS X 10.10 Yosemite | |
| Install rEFInd with --esp flag: | |
| ./install.sh --esp | |
| mkdir /Volumes/esp | |
| sudo mount -t msdos /dev/disk0s1 /Volumes/esp | |
| Then rename the "refind" folder to "boot" and the "refind_x64.efi" to "bootx64.efi". | |
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
| function Accepts () | |
| { | |
| osascript <<EOF | |
| tell application "System Events" | |
| repeat while exists (processes where name is "SecurityAgent") | |
| tell process "SecurityAgent" to click button "Allow" of window 1 | |
| delay 0.2 | |
| end repeat | |
| end tell | |
| EOF |