公告版位

目前分類:Linux (140)

瀏覽方式: 標題列表 簡短摘要
# Step 1: Need root permission.
sudo bash

# Step 2: Update your repositories
apt update -y

# Step 3: Install pip for Python 3
apt install python3-pip

# Step 4: Use pip to install VirtualEnv
pip3 install virtualenv

# Step 5: Create a Virtual Environment of Python 3, the virtual env name is "myEnv".
virtualenv -p python3 myEnv

# Step 6: Activate a new Python 3 virtual env.
# or "source env3/bin/activate"
. myEnv/bin/activate

# Step 7-1: You can make sure you are now working with Python 3.
python --version

# Step 7-2: You can make sure the Python 3's Path.
which python

# Step 8: Leave the virtual env.
deactivate

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

$ unzip -O big5 MyTest.zip

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

# cat > /etc/systemd/system/iptables.service << EOF
[Unit]
Before=network.target
[Service]
Type=oneshot
ExecStart=/sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j REJECT
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
EOF

# systemctl enable --now iptables.service

# systemctl start iptables.service

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

列出所有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) 人氣()

使用以下指令去執行就可以看到完整的視窗了!
$ sudo QT_X11_NO_MITSHM=1 unetbootin

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

Ubuntu 16.04 / 18.04 內建的遠端連線功能

1. 到「Setting(設定)」的「Sharing」開啟Screen SharingRemote 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

Linux_release_buf_cache.png

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

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

$ sudo vim /usr/share/applications/eclipse.desktop
============================================
[Desktop Entry]
Version=Photon
Name=Eclipse
Comment=Eclipse is an IDE
Exec=/opt/eclipse/eclipse
Icon=/opt/eclipse/icon.xpm
Path=/opt/eclipse/
Terminal=false
Type=Application
Categories=X-Red-Hat-Extra;Utility;Application;Development;
============================================

 

$ sudo vim /usr/share/applications/p4v.desktop
============================================
[Desktop Entry]
Version=Helix P4V/LINUX26X86_64/2018.2/1687764
Name=Perforce P4V
Exec=/opt/perforce/bin/p4v
Icon=/opt/perforce/lib/P4VResources/icons/p4v.svg
Path=/opt/perforce/
Terminal=false
Type=Application
Categories=X-Red-Hat-Extra;Utility;Application;Development;
============================================

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

# vim /etc/sysctl.conf
-----------------------------
fs.file-max = 65535
-----------------------------

# vim /etc/security/limits.conf
-----------------------------
* soft nofile 65535
* hard nofile 65535
root soft nofile 65535
root hard nofile 65535
jenkins soft nofile 65535
jenkins hard nofile 65535
-----------------------------

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