2019年10月26日 星期六

[開箱] 超怪的BB槍 AR-57

從香港訂的AR-57 經過了一番波折終於寄來拉~~
↓下面是他的外箱

↓盒上還附上一張初速測量表,是給海關看的

開箱拉~~~
裡面附一個P90彈匣,還有基本的鐵瞄

2019年6月30日 星期日

每次用docker 指令都要加sudo....

其實這篇早該寫了,因為用完那個指令後就不會再用,因此到新機器就會忘記當時是怎麼用的。


正文開始:

sudo usermod -aG docker $USER

就這麼一行可以省去每次加 sudo 總共五個字的麻煩。

觀眾們,摳過去用吧~~

2019年6月28日 星期五

Python stop looping thread, 跑回圈的 thread 的停止方法

先看Code吧


import threading
import time


def process_1():
counter = 0
t = threading.currentThread()
while getattr(t, "loop_alive", True):
print('process_1counter:', counter)
counter += 1
time.sleep(1)
if counter > 80:
break
print('process_1 thread stop')


p1_thread = threading.Thread(target=p2, args=())
p1_thread.start()

time.sleep(10)

p1_thread.loop_alive = False


2019年3月11日 星期一

VIM 常用設定

set nu
set cindent
set expandtab
set tabstop=4
set softtabstop=4

  • set nu 為顯示行號,要關掉的話可以用 set nonu
  • set cindent 是自動縮排,有三種「autoindent」、「smartindent」和「cindent」
  • set expandtab把 TAB換成空白鍵
  • tabstop, softtabstop TAB換成多少格空白鍵

2019年2月15日 星期五

ssh 啟用密碼登入

有些雲端主機服務的公司
在遠端主機加入ssh public key到 ~/.ssh/authorize_keys 之後
會發生無法用密碼登入的狀況
其實解法很簡單

打開 /etc/ssh/sshd_config
並且把PasswordAuthentication 設為 yes(如下
PasswordAuthentication yes

之後再重啟 sshd 服務就可以了
restart sshd

2019年1月24日 星期四

2018年8月16日 星期四

我在新 Ubuntu 電腦上會進行的初始設定

我在新 Ubuntu 電腦上會進行的初始設定

常用工具程式
vim, tmux, tree, htop, wget, git, GitKraken, GIMP, Sublime Text, Docker
vim, tmux, tree, htop, wget, git 安裝比較簡單
sudo apt update;
sudo apt install vim tmux tree htop wget git
sudo apt-get install p7zip-full


Git 初始化設定
git config --global user.name "yesseecity"
git config --global user.email “yesseecity@example.com”
git config --global core.editor vim


ibus 中文輸入法
sudo apt-get install ibus-zhuyin #注音輸入法
裝好後
ibus-setup
之後再到 Ibus Preferences > Input Method 把注音加進來 (Ubuntu 22.04.5)
下一步是到 Settings > Keyboard > Input Sources ,再新增 Chinese (Taiwan) > Chinese (Zhuyin) (Ubuntu 22.04.5)