Skip to content

Instantly share code, notes, and snippets.

Avatar

Miopas Miopas

View GitHub Profile
@Miopas
Miopas / neo4j.sh
Created Feb 25, 2019
command for neo4j
View neo4j.sh
./cypher-shell -a bolt://localhost:1688 -u neo4j -p work "match(n)-[r]->(m) return n, r, m limit 10;" >/tmp/a.txt
@Miopas
Miopas / git.sh
Created Feb 25, 2019
git command
View git.sh
# store account info
git config --global credential.helper store
@Miopas
Miopas / mvn.sh
Last active Feb 13, 2019
mvn command
View mvn.sh
# run specific test case
mvn -Dtest=TestCircle test
# mvn spring boot
mvn clean install && cd ./xx-web && mvn spring-boot:run
# run with specific setting file
mvn clean intall --settings mysetting.xml
@Miopas
Miopas / hadoop.sh
Created Feb 13, 2019
hadoop commands
View hadoop.sh
#查看队列任务
hadoop queue -info [username] -showJobs
@Miopas
Miopas / print_chi_str.py
Created Jan 23, 2019
python2 print Chinese string
View print_chi_str.py
x = '中文测试'
print(x.decode("string_escape"))
View python3_clear_symbol.py
#coding=utf8
import string
import sys
import re
def conv_wide(char):
#全角转半角
code = ord(char)
if char == '\u3000': #space
code = 32
@Miopas
Miopas / mvn_sbt.sh
Last active Nov 12, 2018
mvn/sbt runmain
View mvn_sbt.sh
# mvn run main
# 网上的例子给的是:mvn exec:java -D"exec.mainClass"="com.example.Main",但是我这边是去掉 Main 才能跑通
mvn exec:java -D"exec.mainClass"="com.example"
# sbt run main (background)
setsid nohup sbt -mem 2048 "runMain example.YourClassName ${dataSet} ${normOutput}" > norm.log &
@Miopas
Miopas / loop.sh
Last active Jun 30, 2020
shell for loop
View loop.sh
total=10
startFrom=0
for ((i=${startFrom}; i<${startFrom}+$total; i++)); do
echo starting $i of $total ...
done
@Miopas
Miopas / dict_sort.py
Last active Feb 7, 2020
python sort dict
View dict_sort.py
import pprint
class data:
def __init__(self, name, value):
self.name = name
self.value = value
a = data('a', 2)
b = data('b', 3)
c = data('c', 1)
mydict = {'keyOfA':a, 'keyOfB':b, 'keyOfC':c}
@Miopas
Miopas / sed.sh
Created Jul 31, 2018
shell 加工数据的简易脚本
View sed.sh
# 删除 tmp 文件第一行
sed -i '1d' tmp
# 给 tmp 文件增加一列 '1' 的标签,分隔符为“\t”
cat tmp | awk 'BEGIN{OFS="\t"} {print $0,"1"}'
You can’t perform that action at this time.