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 | |
| ## This assumes proper privileges by php to write to /dev/udp/* | |
| ipaddress="192.168.0.201"; | |
| portnum="50000"; | |
| allon="\x35\00\x55"; | |
| shell_exec(echo -n -e "$allon" > /dev/udp/"$ipaddress"/"$portnum"); | |
| ?> |
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
| #!/usr/bin/env bash | |
| playbook="./site.yml" | |
| hostsfile="./hosts" | |
| ## cd to directory of playbook | |
| cd ${0%/*} | |
| time ansible-playbook "$playbook" -i "${hostsfile}" "$@" |
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
| def make_rules(hosts, ports, proto): | |
| return [{"proto": proto, | |
| "from_port": port, | |
| "to_port": port, | |
| "cidr_ip": host} for host in hosts for port in map(int, ports.split(","))] | |
| class FilterModule(object): | |
| def filters(self): | |
| return {'make_rules': make_rules} |
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
| #!/usr/bin/env bash | |
| perl_version='5.25.6' | |
| perl_version='5.24.0' | |
| verify_pkg() { | |
| pkg="$1" | |
| [[ $(which "${pkg}") ]] || { | |
| echo "${pkg} not found. Exiting..." | |
| exit 1 |
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
| #!/usr/bin/env bash | |
| array=(zero one two three four five) | |
| echo "${array[@]:1:3}" | |
| ## one two three | |
| echo "${array[@]:3}" | |
| ## three four five |
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
| #!/usr/bin/env python | |
| class MyType(object): | |
| def __init__(self, value): | |
| self.value = value | |
| def __add__(self, other): #overload '+' | |
| if not isinstance(other, MyType): #only works on MyType types | |
| return NotImplemented | |
| return self.__class__(self.value + other.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
| #!/usr/bin/env bash | |
| #-------- | |
| # ALL dirs must end with a backslash | |
| #-------- | |
| now=$(date +%Y-%m-%d_%H:%M:%S_%N) | |
| src='/home/shaun/' | |
| dest_url='127.0.0.1' | |
| dest_dir='/home/shaun/rsync_backups/' |
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
| --- | |
| ##- Do this | |
| - name: Install foo package | |
| apt: | |
| name: foo | |
| state: present | |
| ##- not this | |
| - name: Install foo package | |
| apt: name=foo state=present |
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
| --- | |
| all: | |
| vars: | |
| k8s_pods: | |
| - name: kuard-5-6 | |
| #state: absent | |
| volumes: | |
| - name: "kuard-data" | |
| volume_type: 'nfs' | |
| server: "{{ hostvars['k8s-slave1']['ansible_eth1']['ipv4']['address'] }}" |
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
| :%s/\([a-z0-9_]\+\)=\(\({{ \)\=[a-z0-9._]\+\( }}\)\=\)/\r \1: "\2"/g |
OlderNewer