.
├── main.go
└── templates
├── confirmation.html
└── index.html
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
| import java.io.BufferedReader; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.InputStreamReader; | |
| public class Main { | |
| /** | |
| * 步骤: | |
| * 1. File 创建文件句柄 |
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
| # Version 0.0.1 | |
| FROM ubuntu:14.04 | |
| MAINTAINER Beginman "[email protected]" | |
| ARG CHAINA_APT_SOURCE | |
| RUN /bin/bash -c "if [[ ${CHAINA_APT_SOURCE} == ON ]];then sed -i 's#http://archive.ubuntu.com#http://mirrors.163.com#g' /etc/apt/sources.list; fi" | |
| RUN apt-get update | |
| RUN apt-get install -y lua5.1 | |
| RUN apt-get install -y liblua5.1-dev | |
| RUN apt-get install -y git | |
| RUN apt-get install -y nginx |
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
| function password_encode(password) | |
| local bcrypt = require 'bcrypt' | |
| return bcrypt.digest(password, 12) | |
| end | |
| function check_password(password, encoded_password) | |
| local bcrypt = require 'bcrypt' | |
| return bcrypt.verify(password, encoded_password) | |
| end |
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 main | |
| import ( | |
| "fmt" | |
| "time" | |
| "os" | |
| "os/signal" | |
| "syscall" | |
| ) |
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 main | |
| import ( | |
| "log" | |
| "time" | |
| "github.com/PuerkitoBio/goquery" | |
| "github.com/briandowns/spinner" | |
| ) |
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 main | |
| import ( | |
| "io" | |
| "fmt" | |
| ) | |
| type Data struct { | |
| stream string |
在linux中,- 如果单独使用 - 符号,不加任何该加的文件名称时,代表"标准输入"的意思
如下小技巧,nc命令来传输目录下多个文件
# host A, on receiver, go to destination directory and execute:
$ nc -l $port | tar xf -
# host B,on sender
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
| // group by traceId, event fields and get the max item. | |
| void testIt() { | |
| List<Event> events = new ArrayList<>(); | |
| events.add(new Event("AAA", "ROOM_START", 1000L, 10)); | |
| events.add(new Event("AAA", "ROOM_START", 1000L, 10)); | |
| events.add(new Event("BBB", "ROOM_START", 1002L, 15)); | |
| events.add(new Event("BBB", "ROOM_START", 1001L, 10)); | |
| // method1 | |
| Map<String, Map<String, List<Event>>> collect = events.stream() |
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
| import os | |
| import subprocess | |
| import multiprocessing | |
| from colorama import Fore, Back, Style | |
| def download_url(url): | |
| flag = f'PID: {os.getpid()} --> 下载: {url}' |