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
| /* [Usage Example] | |
| // Prepare your Redis environment | |
| Map<String,Object> configMap = new HashMap<>(); | |
| configMap.put("redisIp", "http://10.0.192.103"); | |
| configMap.put("redisPort", "6379"); | |
| configMap.put("semaphoreExpiredMilliSecTime",120000L); | |
| configMap.put("waitPermitMillisecTime",10L); | |
| configMap.put("permitExpiredMillisecTime",10000L); | |
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 python3 | |
| # | |
| # 作者:Coldwings | |
| # 链接:https://www.zhihu.com/question/54855335/answer/141414989 | |
| # 来源:知乎 | |
| # 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 | |
| # | |
| # | |
| class A: | |
| def __new__(cls, *argv, **kwargs): |
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 | |
| # | |
| # How to run: | |
| # 1. chmod +x safety_cleanup_boot_partition.sh | |
| # 2. sudo ./satefy_cleanup_boot_partition.sh | |
| # | |
| # | |
| # Find older kenerl images and purge them | |
| dpkg --list 'linux-image*' | awk '{ if ($1=="ii") print $2}' | grep -v `uname -r` | xargs sudo apt-get purge -y |
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 python2.7 | |
| import paramiko | |
| import os | |
| class MySFTPClient(paramiko.SFTPClient): | |
| def exists(self, path): | |
| """os.path.exists for paramiko's SCP object | |
| """ | |
| try: | |
| self.stat(path) |
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 i in $(sudo dpkg --get-selections | awk '/nova-/{print $1}'); do sudo service $i restart; 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
| #!/bin/bash | |
| ENDPOINT=http://localhost # URL end without slash | |
| REGION=regionOne | |
| # keystone | |
| echo "=== Install keystone endpoint ===" | |
| keystone endpoint-create \ | |
| --service-id $(keystone service-list | awk '{for(i=1;i<=NF;i++){if($i=="identity"){print $2}}}') \ | |
| --publicurl ${ENDPOINT}:5000/v2.0 \ |
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
| heat_template_version: 2014-10-16 | |
| description: A docker load-balancer server | |
| parameters: | |
| image: | |
| type: string | |
| description: Image used for servers | |
| default: tomcat | |
| flavor: | |
| type: string | |
| description: flavor used by the servers |
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/bash env | |
| tcpdump -i eth0 -v port bootps |
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 | |
| #ip_start=$(echo ${1} | sed 's/^.*\(.\{3\}\)$/\1/') | |
| #ip_end=$(echo ${2} | sed 's/^.*\(.\{3\}\)$/\1/') | |
| #set -x #debug mode | |
| log_file=~/arping.log | |
| function usage() { |
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
| del /S "C:\Program Files\Apache Software Foundation\Tomcat 6.0\logs\*" | |
| del /S "C:\Program Files\Apache Software Foundation\Tomcat 7.0\logs\*" |