Skip to content

Instantly share code, notes, and snippets.

View alswl's full-sized avatar

Jingchao Di alswl

View GitHub Profile
@alswl
alswl / bin scripts for Python(uWSGI)
Last active May 27, 2019 09:15
bin scripts for Python(uWSGI)
bin scripts for Python(uWSGI)
@alswl
alswl / index.html
Last active February 10, 2019 03:48
dijingchao.com/index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv=Content-Type content="text/html;charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>一个编程笔记</title>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<style>
/* Sticky footer styles
@alswl
alswl / basic-auth.xml
Created December 25, 2018 13:33
spring basic auth for HTTP bean configuration
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd">
<bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
<constructor-arg ref="httpClientFactory" />
<property name="messageConverters">
DROP TABLE IF EXISTS dept;
DROP TABLE IF EXISTS salgrade;
DROP TABLE IF EXISTS emp;
CREATE TABLE salgrade(
grade int(4) not null primary key,
losal decimal(10,2),
hisal decimal(10,2));
CREATE TABLE dept(
@alswl
alswl / arch-docker-fox.md
Created September 3, 2018 11:01
arch-docker-fox.md

Build Foxone in Docker

Docker start in macOS:

docker-machine start default
eval $(docker-machine env default)
@alswl
alswl / .gitignore
Last active July 3, 2018 08:06
gitignore
We couldn’t find that file to show.
@alswl
alswl / gist:b9b805b45fad6429d6c731a0bc769b28
Last active June 4, 2018 15:12
crontabe for update ip
1/5 * * * * DEVICE="wlan0"; SUB_DOMAIN="eth0-pi"; BASE_DOMAIN="example.com"; DOMAIN="$SUB_DOMAIN.$BASE_DOMAIN"; DOMAIN_ID="11111111"; RECORD_ID="22222222"; TOKEN="33333,44444444444444444444444444444444"; IP=`ip addr | grep $DEVICE: -A 2 | grep inet | awk '{print $2}' | awk -F '/' '{print $1}'`; C_IP=`dig $DOMAIN | grep "^$DOMAIN" | awk '{print $5}'`; [ "$IP" = "$C_IP" ] && exit 0; [ -z $IP ] && exit 0; curl https://dnsapi.cn/Record.Modify -d "domain_id=$DOMAIN_ID&record_id=$RECORD_ID&sub_domain=$SUB_DOMAIN&record_type=A&record_line=默认&value=$IP&login_token=$TOKEN&format=json"
digraph G {
compound = true;
fontsize = 14;
margin = "0,0";
ranksep = 0.2;
nodesep = 0.5;
penwidth = 0.5;
colorscheme = spectral7;
XML_URL=`c Casks/cctalk.rb G appcast | awk -F "'" '{print $2}'`
XML_SHA256=`curl -s $XML_URL | gsha256sum`
PUBDATE=`curl -s $XML_URL | xmlstarlet sel -t -v '//pubDate' | awk '{print $1}'`
VERSION=`curl -s $XML_URL | xmlstarlet sel -t -v '//title' | awk '{print $2}'`
BUILD=`curl -s $XML_URL | xmlstarlet sel -t -v '//sparkle:version'`
VERSION_ALL="$VERSION-$BUILD,$PUBDATE"
sed -i "s/version .*/version '$VERSION_ALL'/" Casks/cctalk.rb
sed -i "s/sha256 .*/sha256 ''/" Casks/cctalk.rb
#!/bin/bash
cd `dirname $0`
BIN_DIR=`pwd`
cd ..
DEPLOY_DIR=`pwd`
CONF_DIR=$DEPLOY_DIR/conf
SERVER_NAME=`sed '/dubbo.application.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
LOGS_FILE=`sed '/dubbo.log4j.file/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`