記事本不認(rèn)\n
只認(rèn)\r\n
,要嘛你換編輯器查看,要嘛你改程序把換行都換成\r\n
,和bat沒(méi)關(guān)系
等等,以上這些情況都可能造成無(wú)法登錄
使用下面的post-update文件:
將您的.git
目錄復(fù)制到 web 服務(wù)器上
在本地副本中, 修改.git/config
文件并將 web 服務(wù)器添加為遠(yuǎn)程:
[remote "production"]
url = username@webserver:/var/www/html/.git
在服務(wù)器上, 用下面的文件替換.git/hooks/post-update
添加對(duì)文件的執(zhí)行訪問(wèn)權(quán)限 (再次, 在服務(wù)器上):
chmod +x .git/hooks/post-update
現(xiàn)在, 只需在本地推送到您的 web 服務(wù)器, 它應(yīng)該自動(dòng)更新工作副本:
git push production
#!/bin/sh
#
# This hook does two things:
#
# 1. update the "info" files that allow the list of references to be
# queries over dumb transports such as http
#
# 2. if this repository looks like it is a non-bare repository, and
# the checked-out branch is pushed to, then update the working copy.
# This makes "push" function somewhat similarly to darcs and bzr.
#
# To enable this hook, make this file executable by "chmod +x post-update".
git-update-server-info
is_bare=$(git-config --get --bool core.bare)
if [ -z "$is_bare" ]
then
# for compatibility's sake, guess
git_dir_full=$(cd $GIT_DIR; pwd)
case $git_dir_full in */.git) is_bare=false;; *) is_bare=true;; esac
fi
update_wc() {
ref=$1
echo "Push to checked out branch $ref" >&2
if [ ! -f $GIT_DIR/logs/HEAD ]
then
echo "E:push to non-bare repository requires a HEAD reflog" >&2
exit 1
fi
if (cd $GIT_WORK_TREE; git-diff-files -q --exit-code >/dev/null)
then
wc_dirty=0
else
echo "W:unstaged changes found in working copy" >&2
wc_dirty=1
desc="working copy"
fi
if git diff-index --cached HEAD@{1} >/dev/null
then
index_dirty=0
else
echo "W:uncommitted, staged changes found" >&2
index_dirty=1
if [ -n "$desc" ]
then
desc="$desc and index"
else
desc="index"
fi
fi
if [ "$wc_dirty" -ne 0 -o "$index_dirty" -ne 0 ]
then
new=$(git rev-parse HEAD)
echo "W:stashing dirty $desc - see git-stash(1)" >&2
( trap 'echo trapped $$; git symbolic-ref HEAD "'"$ref"'"' 2 3 13 15 ERR EXIT
git-update-ref --no-deref HEAD HEAD@{1}
cd $GIT_WORK_TREE
git stash save "dirty $desc before update to $new";
git-symbolic-ref HEAD "$ref"
)
fi
# eye candy - show the WC updates :)
echo "Updating working copy" >&2
(cd $GIT_WORK_TREE
git-diff-index -R --name-status HEAD >&2
git-reset --hard HEAD)
}
if [ "$is_bare" = "false" ]
then
active_branch=`git-symbolic-ref HEAD`
export GIT_DIR=$(cd $GIT_DIR; pwd)
GIT_WORK_TREE=${GIT_WORK_TREE-..}
for ref
do
if [ "$ref" = "$active_branch" ]
then
update_wc $ref
fi
done
fi
git ls-files -z | rsync --files-from - --copy-links -av0 . user@server.com:/var/www/project
linux
服務(wù)器的mysql
如果在服務(wù)器可以連接通常,并確保你的3306
端口已經(jīng)對(duì)外開(kāi)放的情況下,需要給數(shù)據(jù)庫(kù)的user
表添加一個(gè)遠(yuǎn)程連接的用戶,其Host
字段必須為%
。這里給你一個(gè)操作的文章CentOS 下 mysql 數(shù)據(jù)庫(kù)無(wú)法訪問(wèn)的處理方式
文章的后半部分介紹了如何添加遠(yuǎn)程連接的方法,希望對(duì)你有所幫助!
swap使用的計(jì)算是以free為準(zhǔn)的,不是available,假設(shè)swappiness=m
則
free -m (total) / 100 = A
1-10*94/100=-8.4
按說(shuō)你的swap如果足夠大的話會(huì)有8.4G 被使用。
是不是你服務(wù)器不穩(wěn)定,剛好趕上蜘蛛抓取到維護(hù)頁(yè)面。
delete dom.style.color
應(yīng)該可以吧。
典型的 Ruby 項(xiàng)目根目錄下都會(huì)有 Gemfile
文件,這個(gè)項(xiàng)目沒(méi)有,另外檢查了下這個(gè)項(xiàng)目里的 ruby 文件,返現(xiàn)只有兩個(gè)腳本,從文件名猜測(cè)只是輔助性的腳本文件,并非重要文件,所以據(jù)此推斷這不是一個(gè)以 Ruby 為主的項(xiàng)目。
我覺(jué)得可以利用git hook機(jī)制,先推到origin/master,然后cherry pick 到 Central/master。然后把這幾步驟寫(xiě)成一個(gè)shell腳本,簡(jiǎn)單明了
平均一下,每秒寫(xiě)入約22M(80 * 1000 / 3600),IO不算高。
單盤(pán)普通的SAS盤(pán),每秒順序?qū)懽钌僖灿?00多M,服務(wù)器上的硬盤(pán)陣列,RAID 5最少也是3塊盤(pán),普通的服務(wù)器就可以滿足要求。
var script = "";
script += "var a = 0;\n";
script += "debugger;";
script += "a++;";
script += "console.log(a)";
var blob = new Blob([script] , {
type: 'text/javascript'
});
var src = URL.createObjectURL(blob);
var w = new Worker(src);
加 n debugger 斷點(diǎn)調(diào)試可以不??
或者寫(xiě) 一個(gè) 函數(shù) 在 blob 內(nèi)部 一下 debugger
@fengdui 有一句評(píng)論說(shuō)得好,Redis操作要搬出去。
方法一:
// 把10個(gè)元素return出去讓外面的調(diào)用者去調(diào)Redis,別占用同步塊的時(shí)間
public synchronized List<Object> countPv(...) {
...
}
方法二:開(kāi)個(gè)線程池去異步發(fā)Redis,但是機(jī)器重啟會(huì)丟失來(lái)不及發(fā)送的數(shù)據(jù)
if (pvList.size() > 10) {
//前10個(gè)打包成任務(wù)扔給線程池
senderExecutor.execute(new SendTask(new ArrayList<>(pvList.subList(0,10)))); //當(dāng)場(chǎng)復(fù)制了subList
pvList.subList(0,10).clear(); //這行要移到這里,這可能就是你丟數(shù)據(jù)的原因
}
$ git clone https://github.com/simuhui/li...
$ cd library
$ composer install
$ php init
上面就是步驟啊
首先下載下來(lái),如果不用命令的話,可以下載壓縮包
解壓
進(jìn)入libary
$ composer install
$ php init
都是選中的,你的name又是相同的,所以只能是最后一個(gè)選中了;
你需要把索引傳進(jìn)去,對(duì)指定的項(xiàng)設(shè)置選中,其他項(xiàng)取消選中
不是pm2 start pm2.json么?
啟動(dòng)腳本呢
找個(gè)地方把.git目錄copy回來(lái),然后就行了。
最近的服務(wù)器呢?
這是偽命題吧,難道不是選最快的?自己寫(xiě)個(gè)簡(jiǎn)單的速度測(cè)試邏輯就可以了。
def get_host_ip():
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s:
s.connect(('8.8.8.8', 80))
return s.getsockname()[0]
import requests
ip = requests.get('http://ip.cip.cc/').text
今天我也遇到了這個(gè)問(wèn)題,我是判斷數(shù)組的長(zhǎng)度是否大于0,因?yàn)関ue和layui的渲染速度不一樣
或許是你版本太老了,現(xiàn)在都6.多了
北大青鳥(niǎo)APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
北大青鳥(niǎo)中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過(guò)二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開(kāi)發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_(kāi)發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開(kāi)發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開(kāi)發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開(kāi)發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問(wèn),美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。