博文

目前显示的是 十二月, 2016的博文

内网穿透

原版 ./sunny clientid 936abd06debec200 php版 php ./sunny.php --clientid=4ed377963456ee5a op版 opkg install coreutils-nohup nohup /ngrokc -SER[Shost:server.ngrok.cc,Sport:4443,Atoken:a045301f05a5b5f15402ea06fd0be0b8] -AddTun[Type:http,Lhost:127.0.0.1,Lport:80,Sdname:xuefliang] nohup /ngrokc -SER[Shost:server.ngrok.cc,Sport:4443,Atoken:a045301f05a5b5f15402ea06fd0be0b8] -AddTun[Type:tcp,Lhost:127.0.0.1,Lport:22,Rport:63541] python 版https://github.com/hauntek/python-ngrok/ 添入 host = 'server.ngrok.cc' # Ngrok服务器地址 port = 4443 # 端口 bufsize = 1024 # 吞吐量 Tunnels = list() # 全局渠道赋值 body = dict() body['protocol'] = 'http' body['hostname'] = '' body['subdomain'] = 'xuefengliang' body['rport'] = 0 body['lhost'] = '127.0.0.1' body['lport'] = 80 Tunnels.append(body) # 加入渠道队列 host和body['subdomain'] 然后运行 python3 python-ngrok.py 路由器开机启动,exit 0加入 nohup /ngrokc -SER[Shost:server.ng

AnyConnect was not able to establish connection to the specified secure gateway

图片
运行 ”services.msc“ 把图中的Internet Connection Sharing禁用就行了

ubuntu install lamp

1 sudo apt install wget screen unzip -y 2 wget -O lamp.zip https://github.com/teddysun/lamp/archive/master.zip unzip lamp.zip cd lamp-master/ chmod +x *.sh 3 screen -S lamp sudo ./lamp.sh

R 连接 mysql

方式一 library(RMySQL) con <- dbConnect(MySQL(),                  user='root',                  password='52332580',                  dbname='douban',                  host="127.0.0.1") dbListTables(con) # 设置编码格式 dbSendQuery(con, "SET NAMES utf8") # 查询数据 query <-  "SELECT * FROM movie" # 提取数据 data <-  dbGetQuery(con, query) # 关闭连接 dbDisconnect(con) 方式二 library(tidyverse) my_db <- src_mysql(dbname="douban",host = "127.0.0.1",port = 3306,user = "root",password = "52332580") my_tbl <- tbl(my_db,"movie") my_tbl%>%select(title,url) 乱码解决方式如下:  1、sudo vim /etc/mysql/my.cnf 添加:  [client] default-character-set=utf8 2、sudo service mysqld restart

python安装mysqldb模块

sudo apt install libmysqlclient-dev sudo pip install mysql-python

python 统计西游记字数

import json fr = open ( "/home/xuefliang/PycharmProjects/Test/xyj.txt" , "r" ) characters = [] stat = {} for line in fr: line = line.split() if len (line) == 0 : continue # print type(line) temp = json.dumps(line, encoding = "UTF-8" , ensure_ascii = False ) result = [t for t in temp][ 2 :- 2 ] for x in xrange ( 0 , len (result)): if not result[x] in characters: characters.append(result[x]) if not stat.has_key(result[x]): stat[result[x]]= 0 stat[result[x]]+= 1 fr.close()

python中包含UTF-8编码中文的列表或字典的输出

num=[123] b=repr(num) c=[] for x in xrange(1,len(b)-1):     c.append(b[x]) s = u'字符串' L= [c for c in s] import json char=[u'梁雪枫'] temp=json.dumps(char, encoding="UTF-8", ensure_ascii=False) result=[t for t in temp][2:-2]

linux mint ibus 拼音输入法

图片
Linux Mint 加入 IBus libpinyin輸入法 安裝好 Linux Mint 時, 要在 Linux Mint 加入拼音輸入法, 參考步驟如下 : 1) 點擊 選單 > 偏好設定 > 輸入法 : 2) Linux Mint 有提供多種輸入法, 我們選擇安裝 IBus, 所以, 點擊 " 為 IBus 加入支援 " : 3) 之後, 會出現如下畫面, 再同樣位置, 點擊 " 安裝選擇性組件 " : sudo apt install ibus-libpinyin 4) 選擇性組件安裝完畢後, 在輸入法選項中, 選擇 " IBus " : 5) 接下來的步驟, 就是要 在 IBus 裡面加入注音輸入法 , 點擊 選單 > 偏好設定 > iBus 偏好設定 : (p.s. 若安裝好 IBus, 在偏好設定中卻找不到 iBus 偏好設定, 則建議重新啟動 Linux) 6) IBus 因為剛安裝完成, 尚未正式執行, 這時會出現如下畫面, 點擊 " Yes " 啟動 IBus : 7) 開啟 IBus Preferences 畫面後, 切換到 " Input Method ", 然後點擊 " Add ", 選擇 " 漢語 " :

Ubuntu下用ProxyChains穿墙安装Dropbox

1 sudo proxychains apt-get install nautilus-dropbox 2 proxychains dropbox start -i &

ubuntu 16 install R

1. Add R repository First, we’ve got to add a line to our /etc/apt/sources.list file. This can be accomplished with the following. Note the “xenial” in the line, indicating Ubuntu 16.04. If you have a different version, just change that. sudo echo "deb http://cran.rstudio.com/bin/linux/ubuntu xenial/" | sudo tee -a /etc/apt/sources.list 2. Add R to Ubuntu Keyring First: gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9 Then: gpg -a --export E084DAB9 | sudo apt-key add - 3. Install R-Base Most Linux users should be familiar with the old… sudo apt-get update sudo apt-get install r-base r-base-dev 4. sudo apt-get install libfuse-dev libcurl4-openssl-dev libxml++2.6-dev libssl-dev openjdk-8-* libglu1-mesa-dev libgeos-dev libgdal1-dev libproj-dev libfreetype6-dev libgmp-dev libmpfr-dev

error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

sudo apt install python - dev

spyder a python console failed to start

pythonpath manager 中添加 /usr/local/bin  #ipython 路经 /usr/bin  #python 路经