Skip to content

Instantly share code, notes, and snippets.

View wilkice's full-sized avatar
😁
Focusing

darcy wilkice

😁
Focusing
  • Earth
  • 22:56 (UTC +08:00)
View GitHub Profile
@wilkice
wilkice / gist:ff99c92017aa72e598f75309d366a10a
Created November 15, 2018 07:16 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@wilkice
wilkice / layers.txt
Created May 16, 2019 07:02 — forked from fabito/layers.txt
YOLO v3 Layers
layer filters size input output
0 conv 32 3 x 3 / 1 416 x 416 x 3 -> 416 x 416 x 32
1 conv 64 3 x 3 / 2 416 x 416 x 32 -> 208 x 208 x 64
2 conv 32 1 x 1 / 1 208 x 208 x 64 -> 208 x 208 x 32
3 conv 64 3 x 3 / 1 208 x 208 x 32 -> 208 x 208 x 64
4 Shortcut Layer: 1
5 conv 128 3 x 3 / 2 208 x 208 x 64 -> 104 x 104 x 128
6 conv 64 1 x 1 / 1 104 x 104 x 128 -> 104 x 104 x 64
7 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128
8 Shortcut Layer: 5
import pymysql
connection = pymysql.connect(host='host ip',
user='root',
password='password',
db='test',
cursorclass=pymysql.cursors.DictCursor
)
with connection:
cursor = connection.cursor()
*******************
udp client
*******************
import socket
import time
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
while True:
client.sendto(b'kkkkk', ("127.0.0.1", 6754))
@wilkice
wilkice / exit.py
Created July 3, 2019 12:40
python exit program
import sys
print(23)
sys.exit() # exit success, default value 0
sys.exit(1) # exit with status code 1, failure
sys.exit("exit now") # exit and print this string, status code 1, means failure
@wilkice
wilkice / linux_frequently_used_commands.md
Last active December 27, 2019 09:48
linux frequently used commands

show system info
lsb_release -a

show the size of folder

du -sh <folder>

show file encoding

file

@wilkice
wilkice / simple_test.py
Created August 26, 2019 12:35
requests sample and proxy settings
import requests
proxy = '127.0.0.1:1087'
url = ''
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3879.0 Safari/537.36 Edg/78.0.249.1',
}
proxies = {
@wilkice
wilkice / mysql.sql
Last active September 5, 2019 09:15
mysql daily use command
export table
shell>
mysqldump -u yjb -p database tb1 tb2 > didi.sql
import table
shell>
mysql -u yjb -p db < didi.sql
grant privileges
@wilkice
wilkice / scrape_attention.md
Last active September 2, 2019 08:51
Anything need to pay attention when doing web scraping.

About Database

MySQL

  • if using pymysql to connect to db, when tring to get a large data from database, use pymysql.cursors.SSCursor or pymysql.cursors.SSDictCursor.[1] But it will still meet timeout error, so if get large results from database, I will use the default cursor type and use fetchall to get all data so that we won't have any errors.

Scrapy

we can set custom settings for every spider, for more info,pls visit https://docs.scrapy.org/en/latest/topics/spiders.html

class HuodongjiaSpider(scrapy.Spider):
    name = 'huodongjia_future'
 custom_settings = {

Ansible 使用步骤

需要安装模块: ansible sshpass

1. 激活虚拟环境

conda activate ansible

2. 新建文件如 host