This file contains 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 | |
# install CUDA Toolkit v8.0 | |
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network)) | |
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb" | |
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG} | |
sudo dpkg -i ${CUDA_REPO_PKG} | |
sudo apt-get update | |
sudo apt-get install cuda |
This file contains 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 | |
if [ $# -lt 2 ]; then | |
echo "usage:$0 dev output_dir [iodepth]" | |
echo "example 1: Testing the whole block device. Attention: That will destory the filesystem on the target block device" | |
echo "./run_fio.sh /dev/sdb fio_test" | |
echo "" | |
echo "example 2: Testing a file, but not destory filesystem. Suppose the target device mount on /data" | |
echo "fallocate -l 1G /data/test.dat" | |
echo "./run_fio.sh /data/test.dat fio_test" |
This file contains 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 SimpleXMLRPCServer import SimpleXMLRPCServer | |
def add(x, y): | |
return x + y | |
if __name__ == '__main__': | |
s = SimpleXMLRPCServer(('127.0.0.1', 8080)) | |
s.register_function(add) | |
s.serve_forever() | |
s是一个绑定了本地8080端口的服务器对象,register_function()方法将函数add注册到s中。serve_forever()启动服务器。 |
This file contains 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 SimpleXMLRPCServer import SimpleXMLRPCServer | |
def add(x, y): | |
return x + y | |
if __name__ == '__main__': | |
s = SimpleXMLRPCServer(('127.0.0.1', 8080)) | |
s.register_function(add) | |
s.serve_forever() | |
s是一个绑定了本地8080端口的服务器对象,register_function()方法将函数add注册到s中。serve_forever()启动服务器。 |
This file contains 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
批量推送ssh密钥,设置免密登录 | |
ansible test -m authorized_key -a "user=pe key='{{ lookup('file', '/home/pe/.ssh/id_rsa.pub') }}' path=/home/pe/.ssh/authorized_keys manage_dir=no" | |
ansible test -m authorized_key -a "user=root key='{{ lookup('file', '/root/.ssh/id_rsa.pub') }}' path=/home/pe/.ssh/authorized_keys manage_dir=no" | |
生成CMDB页面 | |
ansible -i ip_list_file "172.*" -m setup --tree out/ -k -a ""filter=ansible_local"" | |
ansible-cmdb -i ip_list_file "*" out/ >/export/yulei/software/redis-monitor/src/www/cmdb.html | |
lineinfile 模块: | |
vars: |