Skip to content

Instantly share code, notes, and snippets.

View licsber's full-sized avatar
👀
Study every second

Jiale Liu licsber

👀
Study every second
View GitHub Profile
@licsber
licsber / imshow.py
Created February 6, 2020 09:44
在notebook中展示图片
import cv2
import matplotlib.pyplot as plt
def imshow(img):
if (len(img.shape) == 2) :
plt.imshow(img)
plt.show()
return
b,g,r = cv2.split(img)
img_rgb = cv2.merge([r,g,b])
@licsber
licsber / bilibili.html
Created February 6, 2020 10:52
在网页上嵌入B站视频 哔哩哔哩 bilibili
<p><iframe src="//player.bilibili.com/player.html?aid=84267566&amp;cid=145147963&amp;page=1" frameborder="no" scrolling="no" width="95%" height="600"></iframe></p>
@licsber
licsber / cdn.conf
Created February 16, 2020 07:23
全站静态资源加速
server {
server_name cdn.licsber.site;
charset utf-8;
location / {
root /opt/lampp/htdocs/kod/data/Group/public/home/share;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
@licsber
licsber / httpd.conf
Last active February 16, 2020 14:32
Apache设置禁止从外网访问
DocumentRoot "/opt/lampp/htdocs"
<Directory "/opt/lampp/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
@licsber
licsber / swap.sh
Created February 16, 2020 15:13
创建swap空间
dd if=/dev/zero of=/root/swapfile bs=1M count=1024
mkswap /root/swapfile
swapon /root/swapfile
@licsber
licsber / notebook.conf
Created February 18, 2020 06:58
用nginx反代notebook
server {
server_name notebook.licsber.site;
location / {
proxy_pass http://127.0.0.1:8888/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
@licsber
licsber / git_rollback.sh
Created February 20, 2020 04:33
当你失误了一次git push
git reset --hard HEAD^
git push origin master -f
@licsber
licsber / timemachine.sh
Created February 25, 2020 12:19
清除时间机器的本地备份
tmutil listlocalsnapshotdates / |grep 20|while read f; do tmutil deletelocalsnapshots $f; done
@licsber
licsber / calculate_file_and_dir_count.py
Created April 29, 2020 02:54
计算文件夹中的文件数和目录数 用于坚果云同步
import os
dirs = []
files = []
def walk(file):
if os.path.isdir(file):
dirs.append(file)
for f in os.listdir(file):
walk(file + '/' + f)
@licsber
licsber / 删除git历史中误提交的文件或者大文件.sh
Created May 8, 2020 08:06
删除git历史中误提交的文件或者大文件
git filter-branch -f --prune-empty --index-filter "git rm -rf --cached --ignore-unmatch filename" --tag-name-filter cat -- --all