鍍金池/ 問答/ Linux問答
傻叼 回答

看來只能重新編譯libcurl庫了,因為pycurl依賴的libcurl版本太低,不然就安裝低版本的pycurl也可以。

六扇門 回答

可能你就是被上天選中的男人吧,這一生都只能用 Ubuntu 一定能成為一個優(yōu)秀的程序員。

陪我終 回答
.row
  p 財經(jīng)新聞:
    .buttonsRight
      .item(v-for="(item,index) in taxData.caijing"
            :class="taxDataForm.caijing.includes(item)?'active':''"
            @click="handclick('caijing',item)") {{item}}
.row
  p 熱點聚焦:
    .buttonsRight
      .item(v-for="(item,index) in taxData.redian"
            :class="taxDataForm.redian.includes(item)?'active':''"
            @click="handclick('redian',item)") {{item}}
.row
  p 行業(yè)資訊:
    .buttonsRight
      .item(v-for="(item,index) in taxData.hangye"
            :class="taxDataForm.redian.includes(item)?'active':''"
            @click="handclick('hangye',item)") {{item}}
     
            
methods:{
    handclick(str,item){
        let    arr;
        if(this.taxDataForm[str]){
            arr = this.taxDataForm[str]
        }else{return}
        arr.includes(item)?this.taxDataForm[str]=arr.filter(a=>a!==item):arr.push(item)
    }
}
替身 回答

githubpages刪除之前創(chuàng)建的網(wǎng)頁

夢一場 回答

${$3:0:10}語法截取前十位試試呢

蝶戀花 回答

域名指定DNS解析了嘛

  1. 檢查node_modules 是否有更新,
  2. 把node_modules 刪了,并清除緩存:npm cache clean。
  3. 如果不是的話就可能網(wǎng)絡代理或者環(huán)境問題
北城荒 回答
Db::table('think_user')->where('status', 1)->whereOr('status', 2)->select()
玄鳥 回答

試試 echo ${x}_1

-是操作符,而_是作為token的一部分,可以做為變量名的。
詞法分析里把x_1看了一個詞。

故人嘆 回答
本系列文章所講解內(nèi)容,依賴于https://github.com/icarusion/... 這套架構
情皺 回答

其實這類問題,git文檔上已經(jīng)寫了,只是你可能沒看文檔,或者忽略了。

.gitignore 官方文檔

Example to exclude everything except a specific directory foo/bar (note the /* - without the slash, the wildcard would also exclude everything within foo/bar):
$ cat .gitignore
    # exclude everything except directory foo/bar
    /*
    !/foo
    /foo/*
    !/foo/bar

知道了這個回到你的問題

node_modules/
// 排除這個文件夾。
!node_modules/@wang

但可能你已經(jīng)之前就把node_modules整體忽略了,導致現(xiàn)在加入排除文件,沒有效果。

這時再看下文檔。說可以參考:

SEE ALSO
git rm 官方文檔

看下來就可以發(fā)現(xiàn):

// -r 在給出前導目錄名時允許遞歸刪除。
// --cached 從緩存中刪除
git rm -r --cached node_modules/@wang
git status
// 查看狀態(tài)

這時你就會發(fā)現(xiàn) node_modules/@wang這個文件夾可以提交了。

如果覺得英文文檔有障礙,可以下載翻譯插件等工具,或者搜索查看中文文檔。

或者也可以通過搜索(不能科學上網(wǎng)的情況下,推薦必應搜索),搜索git排除被忽略文件夾下的某個文件夾 等關鍵詞。

遲月 回答

來個簡單的利用gitlab 的webhook實現(xiàn)代碼在服務器部署。

  1. 首先需要先裝一個gitlab
  2. 在gitlab 配置好你項目的倉庫之后,配置一個簡單的鉤子域名,如:test.com/hook.php(用PHP舉個栗子), test.com 這臺服務器必須是你要上傳代碼的服務器(不是也可以,實現(xiàn)方式有很多)

圖片描述

  1. 上傳服務器ssh 公鑰id_rsa.pub 到你gitlab 的deploy keys
  2. 接下來在test.com 這臺服務器上配置hook.php的web訪問目錄,確保能正常運行test.com/hook.php:

代碼可以如下:

<?php
//git webhook 自動部署腳本
////項目存放物理路徑
$path = "/data/githook/project/"; 
//日志目錄
$log_path = "/data/logs/git_log/";
$log_file = 'git-webhook.'.date('Y-m-d').'.log';
$requestBody = file_get_contents("php://input");
if (empty($requestBody)) {
die('send fail');
}
$content = json_decode($requestBody, true);
//若是主分支且提交數(shù)大于0, 那master分支舉例
if ($content['ref']=='refs/heads/master' && $content['total_commits_count']>0) {
$res = shell_exec("cd {$path} && git reset --hard origin/master && git pull -f origin master 2>&1");
$res_log = '-------------------------'.PHP_EOL;
$res_log .= $content['user_name'] . ' 在' . date('Y-m-d H:i:s') . '向' . $content['repository']['name'] . '項目的' . $content['ref'] . '分支push了' . $content['total_commits_count'] . '個commit:' . PHP_EOL;
$res_log .= $res.PHP_EOL;
file_put_contents($log_path.$log_file, $res_log, FILE_APPEND);//追加寫入
echo 'send suc';
}else{
echo 'send failed';
}
die();

如果覺得太復雜,或者我寫得不好。GitLab Runner 或許更適合你。 瀏覽問題的時候無意中看到了就寫了下?

淚染裳 回答

你需要用root或sudo執(zhí)行

PORT_NUMBER=80
lsof -n -i tcp:${PORT_NUMBER} | awk 'NR!=1 {print $2}' |uniq | xargs kill

EDITED

找到一個更簡單的辦法, 跟本不需要循環(huán)

fuser -k 80/tcp

see https://stackoverflow.com/a/1...

女流氓 回答
server {
    listen 80; 
    server_name a.cn;
    
    if ($query_string ~* "id=(\d+)") {
       set $id $1; 
       rewrite ^(.*)$ /article/$id.html? permanent;  
    }   
}
憶當年 回答

可能是你開了調(diào)試的原因才導致加載了2次,就像FireFox開啟firebug的時候會加載2次驗證碼一樣

巫婆 回答

had the same problem today. I believe the issue is the instructions you listed are out of date for Python installs, as they are now enabled with pip install.

Delete the xgboost directory that your above install attempt created, and then execute:

pip install xgboost
It should all work with one command. See also the Python Specific XGBoost Install Instructions.

青裙 回答

curl走代理即可。
一般的代理服務器是fidder或者charles

curl_setopt($ch, CURLOPT_PROXY, "127.0.0.1"); //代理服務器地址   
curl_setopt($ch, CURLOPT_PROXYPORT,8888); //代理服務器端口
萢萢糖 回答

1、密碼錯誤,如果是本地連接
2、遠程鏈接的話是你遠端服務器沒有開啟3306這個端口的遠程鏈接權限,你在防火墻里面加上這個開放端口的命令就可以了

涼心人 回答

修改文件請使用sed -i,你用tac管道丟給sed,明顯只是在標準輸出中改了文件而已,當然沒保存了