公告版位

# sed -i "3s/^[^#]/#&/" /etc/openvpn/server/server.conf

dreamtails 發表在 痞客邦 留言(0) 人氣()

$ ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "dreamtails@pixnet.cc"

Reference: https://medium.com/risan/upgrade-your-ssh-key-to-ed25519-c6e8d60d3c54

 

dreamtails 發表在 痞客邦 留言(0) 人氣()

Command:
$ git clone https://192.168.100.100/dreamtails/Dreamtails_Project.git


Error Message:
fatal: unable to access 'https://192.168.100.100/dreamtails/Dreamtails_Project.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none


How to Resolve?

[For Git]

$ git config --global http.sslVerify false


[For Linux]

$ export GIT_SSL_NO_VERIFY=1


[For Windows]

$ set GIT_SSL_NO_VERIFY 1

 

dreamtails 發表在 痞客邦 留言(0) 人氣()

1. Prepare your environment.
$ sudo apt install libncurses5-dev \
        libgtk2.0-dev libatk1.0-dev \
        libcairo2-dev python-dev \
        python3-dev git

2. Remove Old VIM.
$ sudo apt remove vim vim-runtime gvim

3. Install VIM.
$ cd /usr && sudo git clone https://github.com/vim/vim.git && cd vim  

$ sudo ./configure --with-features=huge \
        --enable-multibyte \
        --enable-pythoninterp=yes \
        --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ \
        --enable-python3interp=yes \
        --with-python3-config-dir=/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/ \
        --enable-gui=gtk2 \
        --enable-cscope \
        --prefix=/usr/local/

$ sudo make VIMRUNTIMEDIR=/usr/local/share/vim/vim81 

4. Preparing deb package using "checkinstall"
$ sudo apt install checkinstall
$ cd /usr/vim && sudo checkinstall

5. Set VIM as a default editor
$ sudo update-alternatives --install /usr/bin/editor editor /usr/local/bin/vim 1
$ sudo update-alternatives --set editor /usr/local/bin/vim
$ sudo update-alternatives --install /usr/bin/vi vi /usr/local/bin/vim 1
$ sudo update-alternatives --set vi /usr/local/bin/vim

6. Verify that you're running the new Vim binary by looking
$ vim --version | grep python

 

Reference: https://vi.stackexchange.com/questions/11526/how-to-enable-python-feature-in-vim

dreamtails 發表在 痞客邦 留言(0) 人氣()

1. 自己目前蠻推薦以下這個字型:
Fantasque Sans Mono - https://github.com/belluzj/fantasque-sans

2. 將您要換的字型放到以下路徑
$ mv FantasqueSansMono-*.ttf ~/.fonts/

3. 更新字型資料庫
$ fc-cache -vf ~/.fonts/

4. 安裝Gnome-Tweak-Tool
$ apt install -y gnome-tweak-tool

5. 執行Gnome-Tweak-Tool去更改字型
$ gnome-tweaks

dreamtails 發表在 痞客邦 留言(0) 人氣()

1. Install Package to /usr/local
$ ./configure --prefix=/usr/local
$ make
$ sudo make install prefix=/usr/local

2. Uninstall Package
$ make clean
$ make uninstall

dreamtails 發表在 痞客邦 留言(0) 人氣()

Turn off sleep/suspend/hibernate mode from the CLI:
$ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Get the sleep/suspend/hibernate status from the CLI:
$ sudo systemctl status sleep.target
$ sudo systemctl status suspend.target
$ sudo systemctl status hibernate.target
$ sudo systemctl status hybrid-sleep.target

dreamtails 發表在 痞客邦 留言(0) 人氣()

Step1)
$ sudo apt install -y resolvconf

Step2)
$ sudo vim /etc/resolvconf/resolv.conf.d/head
or
$ sudo vim /etc/resolvconf/resolv.conf.d/tail
===================================
nameserver 192.168.254.254
nameserver 10.10.10.10
nameserver 8.8.8.8
search dreamtails.local dreamtails.com

===================================

dreamtails 發表在 痞客邦 留言(0) 人氣()

使用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) 人氣()

因為裝了Gnome的Dash to Dock後,覺得不是那麼的討喜,所以想還原成Ubuntu原始的桌面環境,請下以下指令:

$ dconf reset -f /

Reference: https://www.omgubuntu.co.uk/2017/10/how-to-reset-ubuntu-desktop-to-default

dreamtails 發表在 痞客邦 留言(0) 人氣()