近期開發(fā)小技巧
設(shè)置Fedora禁止自動休眠
對 /etc/systemd/logind.conf 文件進(jìn)行配置
去掉下面亮相的#號注釋或添加如下兩行代碼?
HandleLidSwitch=ignore?
LidSwitchIgnoreInhibited=yes
Fedora設(shè)置SSH服務(wù)開機(jī)自啟
systemctl enable mysqld.service
遠(yuǎn)程拷貝
scp local-file remote-name@remote-ip:file
如果是文件夾,需要添加-r參數(shù):
scp -r local-file remote-name@remote-ip:file
運(yùn)行上述命令之后會提示出入密碼。默認(rèn)路徑在遠(yuǎn)程主機(jī)/home/下面。
git下載遠(yuǎn)程指定分支
git clone -b remote-name git-address
git上傳指定分支
git push -u origin xxx
運(yùn)行文件
-
運(yùn)行shell腳本
source filename -
運(yùn)行一般二進(jìn)制文件
./filename -
常見錯誤一:
不是可執(zhí)行程序:注意添加執(zhí)行權(quán)限 -
常見錯誤二:
不是可以執(zhí)行二進(jìn)制文件:注意32位和68位區(qū)別
git自動登陸用戶名密碼
在home路徑下有一文件:.gitconfig,
[user]
name = wule
email = wule@antiy.com
追加如下配置即可:
[credential]
helper=store
之后再輸一次即可保存,.git-credentials文件即是保存的用戶密碼
git異常提示
-
錯誤信息:
git異常提示?
-
解決辦法:
git clone username@git.com/xxx/xxx
ubuntu設(shè)置root密碼
通常情況使用sudo su輸出用戶密碼即可進(jìn)入root模式,有時(shí)會使用su進(jìn)入root模式,使用su必須使用root密碼才可進(jìn)入。
設(shè)置root密碼命令:passwd root
