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/sh | |
| PASSWORD="COYS" | |
| DATE=`date +'%Y%m%d-%H%M%S'` | |
| OUTPUT="decryption-result-$DATE.txt" | |
| mkdir "plaintext" | |
| touch $OUTPUT | |
| for i in 100 10240 1000000 100000000 |
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 inverseMod(a, m): | |
| for i in range(1,m): | |
| if ( m*i + 1) % a == 0: | |
| return ( m*i + 1) // a | |
| return None | |
| def gcd(a, b): | |
| """Calculate the Greatest Common Divisor of a and b. | |
| Unless b==0, the result will have the same sign as b (so that when | |
| b is divided by it, the result comes out positive). |
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 comparehex(algorithm, hexstring1, hexstring2): | |
| if algorithm == "md5": | |
| num_of_bits = 128 | |
| elif algorithm == "sha1": | |
| num_of_bits = 168 | |
| elif algorithm == "sha256": | |
| num_of_bits = 256 | |
| print "Algorithm: ", algorithm | |
| binstring1 = bin(int(hexstring1, 16))[2:].zfill(num_of_bits) |
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
| #cloud-config | |
| users: | |
| - name: core | |
| ssh-authorized-keys: | |
| - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCbl2K9rz8aHoDks1+rjqN9aefeHe7ePiLJsTSgP4empJInzf6/nXd1FD5vC7TJAJ6UwkhqxEQiSe/ziglZQTKyqM5RTrjsfAWCBRdTOLcEDel59gEKIMJ9eV6PfLmGApxiER1Hqv8WUHv+6QdEICyaszo+nXYHQHwFap5jSl6JUKFhGv8StDpH8/7LsVQFJKZTFvKoCREyUZ3G56Tq2Cre+kUnoytpX9FlOI/9KvBkC8kUwrRY5Bd4vZY6SJ210Bhi7J0tM3wchB0W08R+cCmYWJrxQpEeYtXVWCeQXENyiDmTBOa1C/mE2jvOXOUpz6v7jL+vhJMSPtKpFu3wvOfd ball@ultraball | |
| groups: | |
| - sudo | |
| shell: /bin/bash |
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
| mkdir tmp | |
| openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout tmp/nginx.key -out tmp/nginx.crt -subj "/CN=nginxsvc/O=nginxsvc" | |
| echo "apiVersion: v1 | |
| kind: Secret | |
| metadata: | |
| name: nginxsecret | |
| type: Opaque | |
| data: | |
| nginx.crt: `base64 -w 0 tmp/nginx.crt` |
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
| Vagrant.configure("2") do |config| | |
| config.vm.define "node-1" do |node| | |
| node.vm.box = "ubuntu/trusty64" | |
| node.vm.hostname = "node-1" | |
| node.vm.network :private_network, ip: "192.168.56.101" | |
| node.vm.provider :virtualbox do |v| | |
| v.customize ["modifyvm", :id, "--memory", 1024] | |
| v.customize ["modifyvm", :id, "--name", "node-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
| sudo apt-get update | |
| sudo apt-get install -y apt-transport-https ca-certificates git | |
| sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
| echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list | |
| sudo apt-get update | |
| sudo apt-get install -y docker-engine | |
| #sudo systemctl start docker.service | |
| sudo service docker restart | |
| sudo usermod -aG docker $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
| input { | |
| gelf {} | |
| } | |
| output { | |
| elasticsearch { | |
| hosts => ["elasticsearch"] | |
| workers=> 10 | |
| } | |
| stdout { | |
| } |
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 xml.dom import minidom | |
| from signal import signal, SIGPIPE, SIG_DFL | |
| from sys import argv | |
| script, filename = argv | |
| signal(SIGPIPE,SIG_DFL) | |
| edge = [] | |
| xmldoc = minidom.parse(filename) | |
| itemlist = xmldoc.getElementsByTagName('node') | |
| print(len(itemlist)) |
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
| #cloud-config | |
| hostname: master01 | |
| coreos: | |
| etcd2: | |
| discovery: https://discovery.etcd.io/<token-id> | |
| listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001 | |
| advertise-client-urls: http://172.17.181.247:2379 | |
| listen-peer-urls: http://172.17.181.247:2380,http://172.17.181.247:7001 | |
| initial-advertise-peer-urls: http://172.17.181.247:2380 | |
| data-dir: /var/lib/etcd2 |
OlderNewer