[TOC]
## 環境變量
1. 查看環境變量`env`、`printenv`
2. 查看其他進程的環境變量`cat /proc/$PID/environ | tr '\0' '\n'`
3. 設置環境變量`vim ~/.bash_profile`,`source ~/.bash_profile`
## 定時同步看云文檔到github
1. 同步腳本
```
#########################################################################
# File Name: syncGit.sh
# Description: syncGit.sh
# Author: ty
# Created Time: 2019-06-29 10:15:01
# 先判斷倉庫文件夾是否存在
# 不存在
# 1. 克隆看云倉庫
# 2. 進入目錄
# 3. 添加github倉庫
# 4. 推送到github
# 存在
# 1. 進入目錄
# 2. pull然后push
#########################################################################
#!/bin/bash
cd /root/syncGit
if [ ! -d "tyss" ]; then
git clone git@git.kancloud.cn:shus521/tyss.git
cd tyss
git remote add hub git@github.com:shus521/myNote.git
else
cd tyss
git pull origin master
fi
echo "`date +%Y-%m-%d,%H:%m:%s`"
git push hub master
```
2. 添加定時任務`/etc/crontab`每半個小時同步一次
```
*/30 * * * * root /root/syncGit/syncGit.sh >> /root/syncGit/sync.log
```
或者敲入命令`crontab -e`進行編輯
## 目錄和文件操作
查找目錄:`find /(查找范圍) -name '查找關鍵字' -type d`
查找文件:`find /(查找范圍) -name 查找關鍵字`
## gdb使用
### 定義
GDB是基于UNIX/Linux下的,基于命令行的調試工具,當程序發生coredump,可以通過GDB從core文件中復現場景,定位問題。
### 安裝
1. 檢查是否安裝`rpm -qa | grep gdb`
2. 安裝文檔系統`yum install ncurses-devel`
3. 安裝gdb
```
wget http://ftp.gnu.org/gnu/gdb/gdb-8.3.tar.gz
tar -zxvf gdb-8.3.tar.gz
cd gdb-8.3
./configure
make && make install
```
4. 錯誤1:`A compiler with support for C++11 language features is required.`
方案1:`yum install -y gcc gcc-c++`
錯誤2:`makeinfo: command not found`
方案2:`yum install texinfo`
## 備用
1. 在shell中不小心按`ctrl+S`后終端無反應,按`ctrl_q`可恢復
2. 方便快捷下載上傳文件`yum install lrzsz`
3. 修改hosts `vim /etc/hosts`
## [sed](/./linux/sed.md)
## 常用命令
1. `pstree`以樹狀圖的方式展現進程之間的派生關系
2. `ssh -v -p 3306 127.0.0.1` 沒有安裝`telnet`情況下測試端口是否通
- php
- 安全
- php7
- 特性
- 編譯安裝
- 源碼整體框架
- 基本變量
- thinkphp3.2.3
- thinkphp5.0
- thinkphp6.0
- laravel
- 配置
- 路由
- artisan控制臺
- eloquent
- tinker
- composer
- 加密解密
- 小知識點
- 數組
- string
- 代碼簡潔之道
- 編譯
- 語法糖
- lumen
- smarty
- 錯題集
- 算法及數據結構
- 線性表結構
- 插入排序
- 冒泡排序
- 數據庫
- mysql
- oracle
- PostgreSQL
- redis
- sqlserver
- 前端
- 備忘
- js
- nodejs
- vue
- css
- electron
- vue
- 語法糖
- colorui使用筆記
- 微信小程序
- 操作系統
- windows
- bat
- 快捷鍵
- linux
- sed
- 問題解決
- git
- docker
- docker-compose
- 正則表達式
- ps
- lua
- 協議相關
- 問題思索
- Golang
- 測試
- 讀取和寫入json配置文件
- 類
- 接口
- mod
- gin
- fyne
- 禪道二次開發
- 服務
- apache
- 漏洞配置
- http server優化
- nginx
- 安裝
- 面試題庫
- freeswitch