解決 LibreNMS Missing dependencies!

Error: Missing dependencies! Run the following command to fix:

./scripts/composer_wrapper.php install --no-dev

奇怪 今天一開 librenms 炸了這個訊息
解決方法是 安裝一下 php-mbstring

sudo apt-get install php7.0-mbstring

然後又爆寫入權限….

Error: bootstrap/cache, storage, storage/framework/sessions, storage/framework/views, storage/framework/cache, logs not writable! Run these commands as root on your LibreNMS server to fix:

chown -R librenms:librenms /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/storage/framework/sessions /opt/librenms/storage/framework/views /opt/librenms/storage/framework/cache /opt/librenms/logs

setfacl -R -m g::rwx /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/storage/framework/sessions /opt/librenms/storage/framework/views /opt/librenms/storage/framework/cache /opt/librenms/logs

setfacl -d -m g::rwx /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/storage/framework/sessions /opt/librenms/storage/framework/views /opt/librenms/storage/framework/cache /opt/librenms/logs

If using SELinux you may also need:

解決方法

debian 用 apt install acl 就可以照說明執行 setfacl 了

以上正解
以下土炮

chown -R librenms:librenms /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/storage/framework/sessions /opt/librenms/storage/framework/views /opt/librenms/storage/framework/cache /opt/librenms/logs
chmod -R 777 /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/storage/framework/sessions /opt/librenms/storage/framework/views /opt/librenms/storage/framework/cache /opt/librenms/logs

HPE 5130 JH325A switch 筆記

HPE 5130 switch

重設密碼

console 線連接

拔電 重插

Starting......
Press Ctrl+D to access BASIC BOOT MENU
Press Ctrl+T to start memory test

Ctrl-D 進入 BASIC BOOT MENU

Press Ctrl-B to enter Extended Boot menu..

隨後 Ctrl-B 進入 Extended Boot menu

Password recovery capability is enabled.

   BOOT MENU

1. Download application file to flash
2. Select application file to boot
3. Display all files in flash
4. Delete file from flash
5. Restore to factory default configuration
6. Enter BootRom upgrade menu
7. Skip current system configuration
8. Reserved
9. Set switch startup mode
0. Reboot
Ctrl+F: Format File System
Ctrl+P: Skip Super Password
Ctrl+R: Download application to SDRAM and Run
Ctrl+Z: Access EXTEND-ASSISTANT MENU

Enter your choice(0-9): 7

選擇 7 Skip current system configuration

The current setting will run with current configuration file when reboot.
Are you sure you want to skip current configuration file when reboot? Yes or No
(Y/N):Y

問你下次重開是否跳過目前設定 選 Y

0. Reboot

回到主選單 選擇 重新開機 Reboot

重開機之後進系統

砍掉啟動設定檔

delete startup.cfg

或是回復舊的設定

reset saved-configuration main

最後重開機

reboot

就不用打密碼了

設定新密碼

system-view
[HPE]local-user admin
[HPE-luser-manager-admin]password  simple 密碼
[HPE-luser-manager-admin]service-type http ssh terminal
[HPE-luser-manager-admin]save
[HPE-luser-manager-admin]exit

改 ip 並啟用網頁服務

system-view
[HPE]interface Vlan-interface 1
[HPE-Vlan-interface1]ip address 10.1.1.1 255.255.255.0
[HPE-Vlan-interface1]exit
[HPE] ip http enable
[HPE]save

Juniper switch 設定 auto-snapshot 預防斷電 gg

聽說 Juniper 的 switch 不正常斷電會掛掉
最近看到有 auto-snapshot 可以解決這問題
後面設定請看一下命令提示字元是 “>” 還是 “#” 去選擇你的模式

操作模式

ssh 過去打 cli 進入 command line interface 模式 (提示字元是”>”)

root@ex2200-04:RE:0% cli
{master:0}
root@ex2200-04>

打 configure 進入設定模式 (提示字元是”#”)

root@ex2200-04> configure
Entering configuration mode

{master:0}[edit]
root@ex2200-04#

Read moreJuniper switch 設定 auto-snapshot 預防斷電 gg

GAM: 用 cli 管理 Google G-Suite (apps)

gam

Google g-suite 的管理介面真是出了名的難用
使用者列表是用 js 去讀出來的 最扯的是卷軸向下拉裡面的資料竟然會循環
稱了很久都沒去處理 直到今天才把 GAM 裝起來 以後改用這個管理

安裝步驟是又簡單又麻煩
打這行指令 就安裝完成了 不過這裡面很多步驟

bash <(curl -s -S -L https://raw.githubusercontent.com/jay0lee/GAM/master/src/gam-install.sh)

(debian 沒有 curl 要先 sudo apt-get install curl 一下)

依照步驟說明動作 有很多要用瀏覽器完成 所以要仔細看 貼網址 還有回來按 enter (記得複製不要按 ctrl-c 太爽 就給他中斷掉了)
因為步驟太多 就不貼了 不過都不需要看文件 應該可以完成

補一下參考資料
GAM 官方文件
批次操作文件

debian 安裝 softether VPN server

筆記一下 在 debian 上面安裝 softether VPN Server

很可惜的 softether 並沒有在 debian packages 裡面
必須手動安裝
為了方便追蹤版本 來使用 git 抓官方的 repo 過來安裝
先確認自己系統有沒有 git 沒有的話先去裝一下

首先先安裝 softether 會使用到的套件

sudo apt-get install libreadline6-dev libssl-dev lib32ncurses5-dev

然後用 git 抓官方的 repo 下來

git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git

再來做編譯前的設定

cd SoftEtherVPN
./configure

依照自己的系統選擇

Welcome to the corner-cutting configure script !

Select your operating system below:
 1: Linux
 2: FreeBSD
 3: Solaris
 4: Mac OS X
 5: OpenBSD

Which is your operating system (1 - 5) ? : 1

Select your CPU bits below:
 1: 32-bit
 2: 64-bit

Which is the type of your CPU (1 - 2) ? : 2

編譯並安裝

make
make install

寫個 service 檔餵 systemd

vi /etc/systemd/system/softether.service

內容如下

[Unit]
Description=SoftEther VPN Server
After=network.target

[Service]
Type=forking
ExecStart=/usr/bin/vpnserver start
ExecStop=/usr/bin/vpnserver stop

[Install]
WantedBy=multi-user.target

啟動服務

systemctl start softether.service

加入開機自動啟動

systemctl enable softether.service

其他設定就去 官網下載 SoftEther VPN Server Manager 來連線到 剛裝好的 server
第一次 密碼空白 進去後會有密碼變更提示

其他設定就看個人需求 去官方的 Tutorials 找一下設定就好了