常用的方便指令

LLSS發表於2019-12-19

artisan 命令

  • php artisan make:controller admin\TestController //新建控制器
  • php artisan make:model Models/Test //新建模型
  • php artisan make:model models\schools -m //生成模型和遷移檔案
  • php artisan migrate //生成資料庫
  • php artisan migrate --path=\Database\migration\01 //指定資料夾 生成遷移
  • php artisan make:seeder SchoolTableSeeder //建立seeder
  • php artisan db:seed --class=SchoolTableSeeder //執行seeder

    composer命令

  • Composer 全量映象設定:composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
  • 取消配置:composer config -g --unset repos.packagist
  • 僅修改當前工程配置,僅當前工程可使用該映象地址:composer config repo.packagist composer https://mirrors.aliyun.com/composer/
  • 取消配置:composer config --unset repos.packagist

    laravel-admin 命令

命令 作用
php artisan admin:make ArticleController --model=App\Models\Article 生成admin資源控制器
Text Text
Text Text

npm or yarm

npm 命令 yarn 命令 作用
npm install yarn install 安裝依賴 一般為package.json檔案的內容
npm install taco --save yarn add taco 安裝某個依賴,並且預設儲存到 package
npm uninstall taco --save yarn remove taco 移除某個依賴專案
npm install taco --save--dev yarn add taco --dev 安裝某個開發時依賴專案
npm update taco --save yarn upgrade taco 更新某個依賴專案
npm install taco --global yarn global add taco 安裝某個全域性依賴專案
cnpm install 安裝淘寶映象
npm update 更新所有依賴
npm run watch-poll 執行並熱更新

通常使用npm 安裝時容易被阻止,因為要翻牆;所以經常要使用到 yarm

node_modules\node-sass: Command failed.錯誤解決

//注意先刪除原來的安裝
用admin許可權執行:
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global

yarn config set registry https://registry.npm.taobao.org --global
yarn config set disturl https://npm.taobao.org/dist --global

最後執行: yarn install

git 常用命令

命令 作用
git clone 克隆
git pull 拉取最新
git add 新增到本地倉庫
git commit 提交
git push 上傳到伺服器

Wireshark常用過濾使用方法

過濾源ip、目的ip
在wireshark的過濾規則框Filter中輸入過濾條件。如查詢目的地址為192.168.101.8的包,ip.dst==192.168.101.8;查詢源地址為ip.src==1.1.1.1
埠過濾。
如過濾80埠,在Filter中輸入,tcp.port==80,這條規則是把源埠和目的埠為80的都過濾出來。使用tcp.dstport==80只過濾目的埠為80的,tcp.srcport==80只過濾源埠為80的包
協議過濾
比較簡單,直接在Filter框中直接輸入協議名即可,如過濾HTTP的協議
http模式過濾。
如過濾get包,http.request.method=="GET",過濾post包,http.request.method=="POST"

可以使用6種比較運算子:

英文寫法: C語言寫法: 含義:
eq == 等於
ne != 不等於
gt > 大於
lt < 小於
ge >= 大於等於
le <= 小於等於

Logical expressions(邏輯運算子):

英文寫法: C語言寫法: 含義:
and && 邏輯與
or 邏輯或
xor ^^ 邏輯異或
not ! 邏輯非

常用的方便指令

atom for php

Crtl+Shift+M    開啟Markdown實時預覽
Command+Shift+P    開啟命令視窗,可以執行各種選單功能
Command + T    快速多檔案切換
Command + F    檔案內查詢和替換
Command + Shift + F    多檔案查詢和替換
Command + [    對選中內容向左縮排
Command + ]    對選中內容向右縮排
Command + .   顯示或隱藏目錄樹
Crtl + m    相應括號之間,html tag之間等跳轉
Crtl + Alt + B    格式化程式碼(需要安裝atom-beautify)
Crtl + ·    調起CLI命令列介面(需要安裝terminal-panel)

實用外掛
PHP-integator php編輯全家桶
php-cs-fixer php語法檢查
minimap是一個預覽全部程式碼的一個外掛,同時能方便的移動到指定的檔案位置。
goto-definition 滑鼠游標放置在要跳轉的類下,按下快捷鍵ctrl-alt-enter即可使用
autocomplete-php:php程式碼提示補全
pigments是專案檔案中,樣式顯色顯示的的外掛。

相關文章