Skip to content

Instantly share code, notes, and snippets.

View qqpann's full-sized avatar
🍊

Qiushi Pan qqpann

🍊
View GitHub Profile
@qqpann
qqpann / nginx-tuning.md
Created January 30, 2019 16:42 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@qqpann
qqpann / get_tweet_replies.py
Last active December 7, 2020 15:45
[Get Tweet Replies] Get Tweet Replies with Twitter API #twitter #python #tweepy
# Author: Qiushi Pan (@qqhann)
# This is a code snippet with sample usage, to get replies to a specific tweet.
# =====
import tweepy
import time
import os
from collections import defaultdict
from dotenv import load_dotenv, find_dotenv
env = load_dotenv(find_dotenv(), override=True)
@qqpann
qqpann / in.py
Created January 14, 2019 23:23
筑波 データマイニング
import numpy as np
import pandas as pd
import sqlite3
from collections import defaultdict
conn = sqlite3.connect('data/twitter_users.sqlite')
df = pd.read_sql('select id, follower_screen_name from twitter_followers', conn)
@qqpann
qqpann / vim.md
Created December 11, 2018 19:37
[Vimでファイルを閲覧モードで開く] #vim
@qqpann
qqpann / file0.vim
Last active December 18, 2018 11:38
Vimで行末のスペースだけ可視化する ref: https://qiita.com/qqhann/items/293be9d891b7e672f3b8
" Overriding theme settings
" 行末の空白を表示する
set list
set listchars=trail:·
highlight ExtraWhitespace ctermfg=darkgreen guifg=darkgreen
" 半角,タブ
" match ExtraWhitespace /\s\+$/
" 半角スペースのみ
match ExtraWhitespace / \+$/
@qqpann
qqpann / index.md
Created November 28, 2018 09:52
[Conda env Quick reference] #conda #python
conda env list
conda info -e
conda create -n py35 python=3.5 ipython
@qqpann
qqpann / index.md
Last active December 21, 2018 05:10
[Set Locale] #linux #locale
locale
sudo update-locale LC_ALL=en_US.UTF-8

.bashrcで設定する場合

export LC_ALL="ja_JP.UTF-8"
@qqpann
qqpann / index.md
Last active December 21, 2018 20:37
[Linux show OS version & status] #linux
uname -a
cat /etc/<distroname>-release
@qqpann
qqpann / index.md
Created November 25, 2018 18:32
[Vim search and replace] #vim
:%s/foo/bar/g
@qqpann
qqpann / sample.py
Created November 9, 2018 04:30
[Executable file] make a file executable. python for example. #env #python #cli
#! /usr/bin/env python