原创 Android調用相機和相冊

調用相機 Intent camera = new Intent();//實例化一個意圖實例 camera.setAction(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForRe

原创 npm 安裝electron 出現權限問題

Workaround: start installer normally with npm install electron, installation fails with EPERM error, but creates node_m

原创 logstash 自動同步mysql到elasticsearch

logstash 自動同步mysql到elasticsearch bin/logstash –f config/jdbc.conf --config.reload.automatic

原创 mysql 全文索引使用NGRAM分詞器

alter table ·t_data· add fulltext index title_fulltext(title, content,tag) WITH PARSER NGRAM;  

原创 python3 使用records 時沒有MySQLdb

使用records時提示   ModuleNotFoundError: No module named 'MySQLdb' 原因是缺少 mysqlclient pip3 install mysqlclient 提示缺少 mysql_con

原创 electron 自定義 標題欄,最小化按鈕等,拖動代碼

要讓沒有默認標題欄的窗口進行拖動,只需使用一段簡單的css即可: -webkit-app-region:drag

原创 uwsgi 守護運行

uwsgi -d --ini uwsgi.ini  

原创 [轉] 使用nginx抵抗cc攻擊

在接入層Nginx限制每個IP的併發請求數爲10,每秒鐘最大請求數爲10。需要支持白名單IP,在白名單範圍內的,不需要限速。 IP:由於Nginx隱藏在阿里雲各種網絡設備的後端,所以使用remoteaddr是取不到客戶的真實IP的。一個思

原创 zend studio 安裝 emmet aptana3地址

emmet http://emmet.io/eclipse/updates/site.xml aptana3 http://download.aptana.com/studio3/plugin/install

原创 mysql分區

CREATE TABLE IF NOT EXISTS `wj_forum` ( `fid` bigint(20) NOT NULL AUTO_INCREMENT, `ftitle` varchar(255) NOT NUL

原创 awk 命令的使用

linux awk的使用方法 awk默認的分隔符是\n或是tab鍵,如果想使用其它的分隔符需使用-F參數 例:cat /etc/passwd | awk -F ‘:’ ‘{print $1}’ ,這個例子使用的是’:’作爲

原创 git 顯示某版本查個文件

git show 55bfd4054d2df22f45817897e75a55b4744eff74 protected\views\shop\view.php 點贊 收藏 分享 文章舉報

原创 mysql-server-5.7安裝後初始化密碼

use mysql; update user set authentication_string=PASSWORD("newpassword") where User='root';  update user set plugi

原创 ubuntu安裝python3.7時 No module named '_ctypes' 和 無法使用ssl

No module named '_ctypes' apt install libffi-dev   無法使用ssl 原因是openssl的模塊版本太低,解決方法是安裝libssl apt install libssl-dev  

原创 yii2 代碼測試

創建測試文件 ./vendor/bin/codecept g:test unit Topic #創建一個名爲TopicTest的單元測試類 ./vendor/bin/codecept g:cest functional Topi