`
crabdave
  • 浏览: 1280778 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
进入Docker容器的shell脚本    使用root用户安装util-linux yum -y install util-linux   编写脚本 vi docker-enter.sh    #!/bin/bash CNAME=$1 CPID=$(docker inspect --format "{{.State.Pid}}" $CNAME) if [ "$#" -gt 1 ]; then     nsenter --target $CPID --mount --uts --ipc --net --pid -- " ...
Idea 配置避免建立索引的目录    .idea/{项目名称}.iml   <?xml version="1.0" encoding="UTF-8"?> <module type="WEB_MODULE" version="4">   <component name="NewModuleRootManager">     <content url="file://$MODULE_DIR$">       < ...
Linux Tomcat启动时卡在“INFO: Deploying web application directory ......”   参考: http://blog.csdn.net/njchenyi/article/details/46641141   修改jdk1.x.x_xx/jre/lib/security/Java.security文件:   securerandom.source=file:/dev/./urandom
Linux 非root用户安装nginx   wget http://nginx.org/download/nginx-1.9.3.tar.gz tar -zxvf nginx-1.9.3.tar.gz cd nginx-1.9.3   ./configure --prefix=/你的目录/nginx \ --sbin-path=/你的目录//nginx/nginx \ --conf-path=/你的目录//nginx/nginx.conf \ --pid-path=/你的目录//nginx/nginx.pid \ --with-http_ssl_module      ...
MongoDB的备份和恢复   进入mongodb bin目录   导出 ./mongodump -d database   导入 ./mongorestore -d test -c user /tmp/testdb/   相关参数 --host localhost --port 27017 --username quicktest --password quicktest --collection trans.sp --db quicktest     参考: http://blog.csdn.net/fdipzone/article/details/51549 ...
Element UI 在打开编辑页面时select选择框不能正常显示的问题   从Grid列表打开编辑页面,中间的选择框(字段type)在选择后vue里type正常变化,但select不能正常显示 该行记录里type字段的初始值为null 或者 '', type有值时,没有问题   //显示编辑界面 handleEdit: function (index, row) { this.editFormVisible = true; //this.editForm = Object.assign({}, row); this.editForm.id = row.id; ...
Java 生成范围内的随机数   public class RandomTest { public static void main(String[] args) { int max=20; int min=10; Random random = new Random(); int s = random.nextInt(max)%(max-min+1) + min; System.out.println(s); } }     参考: http://www.cnblo ...

Docker-compose安装

Docker-compose安装   下载地址(使用最新的版本): https://github.com/docker/compose/releases/     安装会非常慢,耐心等待吧 $ curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose $ chmod +x /usr/local/bin/docker-compose     投机的办法: ...
ifconfig: 未找到命令   #yum search ifconfig 已加载插件:fastestmirror Loading mirror speeds from cached hostfile  * base: mirror.confluxtech.com  * epel: mirrors.kernel.org  * extras: mirror.confluxtech.com  * updates: mirror.confluxtech.com ============================================================ ...
Nginx 405 not allowed解决办法          Apache、IIS、Nginx等绝大多数web服务器,都不允许静态文件响应POST请求,否则会返回“HTTP/1.1 405 Method not allowed”错误。   server { listen 80; server_name 域名; location /{ root /www/文件目录; index index.html index.htm index.php; error_page 405 =200 http: ...
Shell判断上次命令执行失败时退出   if [ $? != 0 ]; then     echo "err"     exit 0 fi   返回错误使用exit 1   参考: https://zhidao.baidu.com/question/584426878.html
Sonatype Nexus 定期清理Snapshots节约磁盘空间   Scheduled Tasks -> Add ->  Respository/Group 选择 Snapshots(Repo) 进行相关配置   参考: http://blog.sonatype.com/2009/09/nexus-scheduled-tasks/ Remove Snapshots From Repository  
Dockerfile Tomcat 前台运行           如果使用我们常用的startup.sh作为容器启动脚本,容器会自动关闭,此时Tomcat在后台运行,没有在前台运行的线程   Dockerfile 文件最后加上 EXPOSE 8080 CMD ["catalina.sh", "run"]
shell替换xml中指定的属性值   sed -i 's;<id>.*<\/id>;<id>新内容<\/id>;g'  your.xml
Nginx负载均衡配置文件样例     upstream backend-others { server 10.x.x.x max_fails=0 fail_timeout=10s; server 10.x.x.x:81 max_fails=0 fail_timeout=10s; keepalive 20000; } location / { #防止502以及Timeout的发生 pr ...
Global site tag (gtag.js) - Google Analytics