总有那么些蛋疼的机房,为了所谓的这安全,将NTP 服务器一刀切了。这时候时间同步就是一个问题,不过我们还可以使用
rdate
来解决。
yum -y install rdate
rdate -s time.nist.gov
cat > /etc/cron.daily/rdate << "EOF"
#!/bin/sh
rdate -s time.nist.gov
{ | |
"env": { | |
"browser": true, | |
"es6": true, | |
"node": true | |
}, | |
"extends": ["airbnb"], | |
"globals": { | |
"document": false, | |
"escape": false, |
#!/bin/bash | |
set -o errexit | |
clear | |
# Set versions. Check http://openresty.org for latest version and bundled version of nginx. | |
OPENRESTY_VERSION=1.9.3.1 | |
NGINX_VERSION=1.9.3 | |
OPENSSL_VERSION=1.0.2d | |
NPS_VERSION=1.9.32.10 |
import boto3 | |
import time | |
import re | |
client = boto3.client('athena') | |
# run athen query | |
response = client.start_query_execution( | |
QueryString=athena_query, | |
QueryExecutionContext={'Database': ATHENA_DATABASE_NAME}, |
总有那么些蛋疼的机房,为了所谓的这安全,将NTP 服务器一刀切了。这时候时间同步就是一个问题,不过我们还可以使用
rdate
来解决。
yum -y install rdate
rdate -s time.nist.gov
cat > /etc/cron.daily/rdate << "EOF"
#!/bin/sh
rdate -s time.nist.gov
curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" http://inserturl.here |
# Ubuntu instructions | |
# Get the pre-reqs for this (Ubuntu) | |
sudo apt-get install git-core build-essential zlib1g-dev libpcre3 libpcre3-dev redis-server libssl-dev libgeoip-dev libgoogle-perftools-dev geoip-database lua5.1 liblua5.1-0 liblua5.1-0-dev lua-iconv-dev libghc-iconv-dev luarocks libpcre3-dev libghc-zlib-bindings-dev | |
# For Centos: | |
sudo yum install wget | |
wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6 | |
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm |
#!/bin/bash | |
# file: ttfb.sh | |
# curl command to check the time to first byte | |
# ** usage ** | |
# 1. ./ttfb.sh "https://google.com" | |
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com" | |
curl -o /dev/null \ | |
-H 'Cache-Control: no-cache' \ | |
-s \ |
FROM ruby:2.3.1 | |
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs | |
RUN apt-get install -y imagemagick | |
RUN mkdir /usr/local/rails-app | |
WORKDIR /usr/local/rails-app | |
ADD Gemfile Gemfile | |
ADD Gemfile.lock Gemfile.lock | |
RUN bundle install |
import re | |
import time | |
mkcookie = lambda coo: ";".join(["%s=%s" % (k,v) for k,v in coo.iteritems()]) | |
def autodetect(resp, ct, ht, cookie, headers, url): | |
__func = None | |
while 'set-cookie' in resp: | |
coostr = resp['set-cookie'] | |
_session = re.findall('yunsuo_session_verify=(\w+)', coostr) |
.modal.fade.modal-fade | |
.modal-dialog | |
.modal-content | |
.modal-header | |
%button.close{type:'button', data:{dismiss:'modal'}} | |
%span{aria:{hidden:'true'}} | |
%i.fa.fa-close | |
%span.sr-only Close | |
%h4.modal-title | |
.modal-body |