Skip to content

Instantly share code, notes, and snippets.

View lihongjie0209's full-sized avatar

李宏杰 lihongjie0209

  • 海南海口
View GitHub Profile
@lihongjie0209
lihongjie0209 / auto_commit.py
Created April 2, 2017 03:22
auto commit screen shot to github and copy the the picture link to clipboard.
"""
本脚本主要用于自动上传截图至github, 主要逻辑如下:
1. 每隔两秒扫描截图文件夹, 得到截图文件总数
2. 与之前的截图总数对比, 如果有新的图片, 那么自动上传至github
3. 复制图片地址到剪贴板
"""
import logging
from pathlib import Path
import requests
from urllib.parse import urlparse, urlunparse
@lihongjie0209
lihongjie0209 / jetty_start.sh
Created July 14, 2017 03:11
jetty 启动脚本 启动日志以及访问记录
# 杀掉占用8080端口的进程
fuser 8080/tcp -k
# 启动jetty
java -jar start.jar --module=requestlog,logging &
@lihongjie0209
lihongjie0209 / vscode_installer.sh
Created July 26, 2017 13:04
vscode 自动安装脚本
# VSCode 自动安装脚本, 适用于CentOS
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
yum check-update
sudo yum install code
@lihongjie0209
lihongjie0209 / template.sh
Created August 1, 2017 02:04
bash copyright template
#!/bin/bash
#title :
#description :
#author :
#date :
#usage :
#notes :
#==============================================================================
@lihongjie0209
lihongjie0209 / epel_CentOS_6.sh
Created October 9, 2017 03:20
centos 6 安装epel源
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rp
yum install epel-release-latest-6.noarch.rpm
yum --disablerepo=epel -y update ca-certificates
In [57]: from http.cookies import SimpleCookie
In [58]: s = SimpleCookie('''bid=hZdgjLJMNv4; _vwo_uuid_v2=AD40AA237919D79C67460DEFD37AFAA4|65f61f85190c51b2
...: cfa95d3910cc2914; gr_user_id=2d7956ee-7cd2-4fad-8a7d-d0b2265ceeba; ll="118316"; _pk_ref.100001.4cf6
...: =%5B%22%22%2C%22%22%2C1489750475%2C%22https%3A%2F%2Fwww.google.com.hk%2F%22%5D; ap=1; _pk_id.100001
...: .4cf6=270eb4959a2a2414.1489750475.1.1489750559.1489750475.; _pk_ses.100001.4cf6=*; __utma=30149280.
...: 1851478845.1488968861.1489658025.1489750475.5; __utmb=30149280.0.10.1489750475; __utmc=30149280; __
...: utmz=30149280.1489750475.5.5.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided);
...: __utma=223695111.721177542.1489750475.1489750475.1489750475.1; __utmb=223695111.0.10.1489750475; _
...: _utmc=223695111; __utmz=223695111.1489750475.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmc
yum install -y zip unzip wget epel-release
curl -s "https://get.sdkman.io" | bash && source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java 8.0.161-oracle
/**
* 百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和WGS84坐标系之间的转换的工具
*
* 参考 https://github.com/wandergis/coordtransform 实现的Java版本
* @author geosmart
*/
public class CoordinateTransformUtil {
static double x_pi = 3.14159265358979324 * 3000.0 / 180.0;
// π
static double pi = 3.1415926535897932384626;
public enum PollutantCodeEnum {
PM10("001"),
SO2("002"),
NO2("005"),
CO("006"),
O3("007"),
PM25("022"),
Unknown("");
from androidhelper import Android
from time import sleep
import json
import urllib2
d = Android()
url = "youserver/sms/notify"
while(True):
messages = d.smsGetMessages(False)
for i in messages.result: