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
package com.example; | |
import org.elasticsearch.action.search.SearchRequest; | |
import org.elasticsearch.action.search.SearchResponse; | |
import org.elasticsearch.client.RequestOptions; | |
import org.elasticsearch.client.RestClient; | |
import org.elasticsearch.client.RestClientBuilder; | |
import org.elasticsearch.client.RestHighLevelClient; | |
import java.util.ArrayList; |
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
# -*- coding: utf-8 -*- | |
from multiprocessing import Process | |
index1 = set() | |
index2 = set() | |
print "reading index1" | |
with open("index1.txt") as f: | |
for line in f: |
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
from openpyxl import load_workbook | |
from datetime import datetime, date, time | |
import json | |
wb = load_workbook('/mnt/d/clockin.xlsx') | |
for ws in wb: | |
#ws = wb["3月"] | |
data = {} | |
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
def isprime(n): | |
if n < 2: | |
return False | |
for i in range(2, n): | |
if n % i == 0: | |
return False | |
return True | |
nums = input("input: ") |
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
s=1 | |
while (( $s >= 1 )) | |
do | |
ping -c 1 $1 >/dev/null 2>&1 | |
s=$? | |
sleep 1; | |
done; | |
echo $1 >> ping.log |
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
# -*- coding: utf-8 -*- | |
import json | |
import requests | |
import datetime | |
import subprocess | |
import xml.etree.ElementTree as ET | |
from keystoneauth1.identity import v3 | |
from keystoneauth1 import session as keystone_session |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.283.1.min.js"></script> | |
<script> | |
var s3 = new AWS.S3({ | |
endpoint: "https://console.tfcloud.com:13808", | |
accessKeyId: "accesskeyid", | |
secretAccessKey: "secretaccesskey", |
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 python | |
import pika | |
import time | |
channel = None | |
def on_connected(connection): | |
connection.channel(on_channel_open) | |
def on_channel_open(new_channel): |
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 | |
PORT=22 | |
USER='root' | |
if [ $# = 1 ]; then | |
case $1 in | |
"sss") | |
IP="54.238.233.187" | |
USER="ubuntu" |
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
FROM python:2 | |
WORKDIR /usr/src/app | |
COPY requirements.txt ./ | |
RUN pip install --no-cache-dir -r requirements.txt | |
COPY . . | |
CMD [ "uwsgi", "--http", ":8001", "--wsgi-file", "deploy_blog.py" ] |
NewerOlder