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
--- | |
- name: mkdir | |
hosts: node_exporters | |
tasks: | |
- name: set ubuntu user name | |
set_fact: sys_user=ubuntu | |
when: ansible_distribution == 'Ubuntu' | |
- name: set centos user name | |
set_fact: sys_user=centos |
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 | |
set -e | |
# 基础 | |
# export JAVA_HOME=/work/programs/jdk/jdk1.8.0_181 | |
# export PATH=PATH=$PATH:$JAVA_HOME/bin | |
# export CLASSPATH=$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar | |
DATE=$(date +%Y%m%d%H%M) | |
# 基础路径 |
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
let sessionId; | |
async function waitOnSign() { | |
return new Promise(resolve => { | |
let chk = setInterval(() => { | |
if (sessionId) { | |
clearInterval(chk) | |
resolve(sessionId) | |
} | |
}, 100); | |
}); |
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
version: '3.3' | |
services: | |
db: | |
image: mysql:5.7 | |
restart: always | |
environment: | |
MYSQL_DATABASE: 'planet' | |
# So you don't have to use root, but you can if you like |
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
#include <ansi.h> | |
# https://www.zuggsoft.com/zmud/mxp.htm | |
#define MXP_OPEN_TAG CSI"0z" | |
#define MXP_SEC_TAG CSI"1z" | |
#define MXP_LOCK_TAG CSI"2z" | |
#define MXP_RESET_TAG CSI"3z" | |
#define MXP_LSEC_TAG CSI"6z" |
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
// ==UserScript== | |
// @id com.iitcplugins.autorefresh | |
// @name IITC plugin: Auto-refresh Map | |
// @category Misc | |
// @version 1.3.2.1 | |
// @namespace https://iitcplugins.com/ | |
// @description Automatically refreshes map data every 60 seconds. To change time, modify the window.plugin.autoRefresh.timeout in milliseconds you wish to use. (20000 is 20 seconds) | |
// @include https://*.ingress.com/intel* | |
// @include http://*.ingress.com/intel* | |
// @match https://*.ingress.com/intel* |
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
int sort(mapping a, mapping b) | |
{ | |
return a["value"] - b["value"]; | |
} | |
int main(object me, string arg) | |
{ | |
mapping m = (["a": 2, "b": 3, "c": 1]); | |
mapping *a, *b; | |
mixed *mk; |
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 | |
MYSQL_HOST=127.0.0.1 | |
MYSQL_USER=root | |
MYSQL_PASS='123456' | |
MYSQL_CONN="-h${MYSQL_HOST} -u${MYSQL_USER} -p${MYSQL_PASS}" | |
# | |
# Collect all database names except for | |
# mysql, information_schema, and performance_schema | |
# |
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/sh | |
# Credits to: | |
# - http://vstone.eu/reducing-vagrant-box-size/ | |
# - https://github.com/mitchellh/vagrant/issues/343 | |
# - https://gist.github.com/adrienbrault/3775253 | |
## for vagrant related tasks, uncomment vagrant comments | |
# vagrant: Unmount project |