原创 Elementary0.3.2/Ubuntu14.04安裝GooglePinYin輸入法

1、添加源 sudo add-apt-repository ppa:fcitx-team/nightly sudo apt-get update 2、安裝fcitx框架和谷歌拼音輸入法 sudo apt-get insta

原创 MySQL簡單使用

安裝 sudo apt-get install mysql-server mysql-client libmysqlclient-dev 登陸 mysql -u root -p 查看庫 show databases;

原创 python圖片旋轉

python圖片旋轉 少廢話,直接上代碼 #!/usr/bin/env python import os from optparse import OptionParser from sys import stdout #

原创 Apache Bench (ab)測試出現 Failed requests

出現 Failed requests 的原因主要有三種: Connect:連接失敗、連接中斷 Length:響應的內容長度不一致 Exception:未知錯誤 出現 Length 錯誤原因: 每一次 HTTP request 接

原创 Hyper-V+Ubuntu18.04的VHDX文件壓縮

If you configured your Hyper-V virtual machines with dynamically expanding virtual disks you will find that the VH

原创 SublimeText PackageControl 安裝插件失敗

報錯: There are no packages available for installation. 報錯原因: This error is happened with IPv6 problem. If your Inter

原创 opencv中IplImage讀取圖片像素問題

Opencv中width表示圖像每行的像素數目,而widthStep表示存儲一行像素(bgr/bgr/bgr/…)需要的字節數(width*channel)。widthStep會自動補全爲4的倍數,從而實現字節對齊。 所以訪問像素點時應

原创 YouCompleteMe添加C++11支持

#.vimrc:   let g:syntastic_cpp_compiler = 'g++'   let g:syntastic_cpp_compiler_options = '-std=c++11 -stdlib=libc++' #.

原创 vimrc

set encoding=utf-8 set termencoding=utf-8 set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936 set nocompatible

原创 Python 文件處理及共享

Python 文件處理及共享 #!/usr/bin/env python import socket import logging from threading import Thread import numpy.random as

原创 SSH 訪問內網

服務器A外網無法訪問,服務器B外網可以訪問…… 服務器A上:ssh -NfR 端口號P:0.0.0.0:22 B用戶名@B地址 服務器B上:ssh -p 端口號P A用戶名@localhost 服務器A外網無法訪問,服務器B外網可

原创 python腳本獲取可執行文件的依賴庫

#!/usr/bin/python import os import shutil import commands # 參數:可執行文件路徑, 依賴庫保存文件夾, 預設環境變量 def get_libs(exe, save_folde

原创 Ubuntu14.04 Shadowsocks 代理

安裝Shadowsocks sudo apt-get install python-dev python-pip sudo pip install shadowsocks 編寫config文件 # config.json {

原创 python腳本與mysql交互

import os import pexpect os.system('service mysql restart') try: print 'create database water ...' mysql2 = p