使用Crontab去定時備份GitLab的資料到遠端的NFS Server (192.168.100.100:/backup/gitlab)
1. Check crond service.
# systemctl list-unit-files
2. 若crond.service是disabled,請將它enable,這樣OS啟動後才會自動執行
# systemctl enable crond.service
3. 手動啟動crond service
# systemctl start crond.service
4. 編輯crontab設定
# crontab -e
dreamtails 發表在 痞客邦 留言(0) 人氣()
環境:
OS: CentOS 7.6
原本的GitLab IP: 1.1.1.1
新的GitLab IP: 2.2.2.2
dreamtails 發表在 痞客邦 留言(0) 人氣()
解決方法:使用VMware OVF Tool 來作Export OVA File.
1. 先安裝OVF Tool (請至VMware 官方網站下載)
2. 裝完後,會有ovftool的指令,然後執行 (此為Linux下的範例)
# ovftool --noSSLVerify vi://<ESXi-ACCOUNT>@<ESXi-HOST-IP>/<VM-NAME> <OUTPUT-OVA-FILENAME>
Example:
# ovftool --noSSLVerify vi://root@192.168.1.1/DHCP-Server DHCP-Server-Template.ova
dreamtails 發表在 痞客邦 留言(0) 人氣()
列出所有VM
$ sudo virsh list --all
建立Snapshot
$ sudo virsh snapshot-create <VM-NAME>
列出Sanpshot有哪些
$ sudo virsh snapshot-list <VM-NAME>
回復到Snapshot的狀態
$ sudo virsh snapshot-revert <VM-NAME> --snapshotname <SNAPSHOT-NAME>
dreamtails 發表在 痞客邦 留言(0) 人氣()
[root@CentOS ~]# qemu-img info CentOS.qcow2
image: CentOS.qcow2
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 4.0G
cluster_size: 65536
Format specific information:
compat: 0.10
[root@CentOS ~]# qemu-img resize CentOS.qcow2 +80G
Image resized.
[root@CentOS ~]# qemu-img info CentOS.qcow2
image: CentOS.qcow2
file format: qcow2
virtual size: 100G (107374182400 bytes)
disk size: 4.0G
cluster_size: 65536
Format specific information:
compat: 0.10
dreamtails 發表在 痞客邦 留言(0) 人氣()
1. 在一個interface 上綁定多個IP
# vim /etc/sysconfig/network-scripts/ifcfg-eth0:0
------------------------------------------------------------
DEVICE=eth0:0
BOOTPROTO=none
IPADDR=140.140.140.1
NETMASK=255.255.255.0
ONBOOT=yes
------------------------------------------------------------
# service network restart
2. 開啟IP Forward的功能
# vim /etc/sysctl.conf
------------------------------------------------------------
......
net.ipv4.ip_forward = 1
net.ipv4.tcp_keepalive_time = 86400
......
------------------------------------------------------------
# sysctl -p
3. 加入iptables的NAT policy
# vim /etc/sysconfig/iptables
------------------------------------------------------------
......
*nat
:PREROUTING ACCEPT [417:47118]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
# NAT Policy
-A POSTROUTING -s 192.168.1.1 -o eth0 -j SNAT --to-source 140.140.140.1
-A PREROUTING -d 140.140.140.1 -i eth0 -j DNAT --to-destination 192.168.1.1
COMMIT
......
------------------------------------------------------------
# service iptables restart
dreamtails 發表在 痞客邦 留言(0) 人氣()
dreamtails 發表在 痞客邦 留言(0) 人氣()
使用以下指令去執行就可以看到完整的視窗了!
$ sudo QT_X11_NO_MITSHM=1 unetbootin
dreamtails 發表在 痞客邦 留言(0) 人氣()
Ubuntu 16.04 / 18.04 內建的遠端連線功能:
1. 到「Setting(設定)」的「Sharing」開啟Screen Sharing與Remote Login的功能!
2. 此時應該還是無法連,請看以下解決方法。下這行指令:
$ gsettings set org.gnome.Vino require-encryption false
3. 這樣就可以使用VNC Client的軟體去連了.
dreamtails 發表在 痞客邦 留言(0) 人氣()
$ sudo vim /etc/systemd/system/startup.service
-----------------------------------------------
[Unit]
Description=Job that runs your user script
[Service]
ExecStart=/usr/local/bin/startup_service.sh
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
-----------------------------------------------
$ sudo systemctl daemon-reload
$ sudo systemctl enable startup.service
dreamtails 發表在 痞客邦 留言(0) 人氣()
# free && sync && echo 3 > /proc/sys/vm/drop_caches && free
dreamtails 發表在 痞客邦 留言(0) 人氣()
1. Login, when used JSON Type Body via POST
$ curl -H "Content-Type: application/json" -X POST -d '{"username":"myusername","password":"mypassword"}' https://dreamtails.pixnet.net:1234/
2. Upload Zip via POST
$ curl -X POST -F "file=@/home/dreamtails/Downloads/upload_file.zip;type=application/zip" "https://dreamtails.pixnet.net:1234/upload"
dreamtails 發表在 痞客邦 留言(0) 人氣()
Example:
255.0.0.0 to 8
255.255.0.0 to 16
255.255.255.0 to 24
dreamtails 發表在 痞客邦 留言(0) 人氣()
1. Download Ubuntu Gnome 16.04
2. 裝好Chrome
3. 裝chrome-gnome-shell
$ sudo apt install chrome-gnome-shell
4. 用Chrome打開https://extensions.gnome.org/,並安裝以下幾個extensions.
Coverflow Alt-Tab
Alt+Tab 切換應用程式會有3D效果
Dash to Dock
應用程式啟動器
Dynamic Top Bar
頂端Bar透明化
User Themes
從文件夾載入Gnome-Shell主題
NetSpeed
頂端Bar顯示網路速度
OpenWeather
頂端Bar顯示天氣
dreamtails 發表在 痞客邦 留言(0) 人氣()
$ sudo vim /etc/sysctl.conf
===========================
......
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
===========================
$ sudo sysctl -p
dreamtails 發表在 痞客邦 留言(0) 人氣()