Category Archives: System Administration

mysql shell clear screen

mysql>system clear system呼叫系統shell執行

Posted in System Administration | Leave a comment

tcp dynamic port number

在服務器listen port時,port選擇需要注意衝突問題。以windows os來說, Microsoft has increased the dynamic client port range for outgoing connections in Windows Vista and Windows Server 2008. The new default start port is 49152, and the new default end port is 65535. This is a change … Continue reading

Posted in System Administration | Leave a comment

svn ignore tips

編輯 svn:ignore list注意dirname尾巴不要slash / svn propedit svn:ignore . 刪除svn:ignore svn propdel svn:ignore

Posted in System Administration | Leave a comment

git with specific ssh key

需要將github private repo分享時,可針對repo使用collaborator方式加入帳號,缺點是該帳號具有寫入權限,或是在global設定可存取的ssh key,但這樣的key具有整個帳號的存取權限 另一種方式是針對repo加入deploy key,可以設定是否有寫入權限,但缺點是一旦在某個repo設定了key,不能在其他repo加入。 因此透過新生成的key來指定哪些key可以存取repo,而非使用機器預設的ssh key(~/.ssh/id_rsa)便成了一個折衷方式。 這樣一來可以針對每個repo分別gen一組(or多組)唯讀權限的key,與可寫入的key,再分發給使用者操作。 一行產生ssh key在特定位置(此處設為當前目錄) ssh-keygen -t rsa -b 4096 -f ./id_rsa -y -q -N “” git指定 ssh key 參考:https://stackoverflow.com/questions/4565700/specify-private-ssh-key-to-use-when-executing-shell-command ssh-agent bash -c ‘ssh-add /somewhere/id_rsa; git clone git@github.com:user/project.git’ 其他操作亦同 ssh-agent bash -c ‘ssh-add /somewhere/id_rsa; … Continue reading

Posted in System Administration | Leave a comment

latex install

full installation of texlive yum -y install texlive texlive-*.noarch

Posted in System Administration | Leave a comment

ssl key generation one liner

openssl req -subj ‘/CN=example.com/O=O/C=US’ -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout server.key -out server.crt

Posted in System Administration | Leave a comment

chromium note

https://github.com/henrypp/chromium/releases Chromium各版本build,在自動化處理網頁連線時,不同版本的chrome是需要的, 因為越新的版本對一些html5的API限縮得越多(例如chrome 66後,AudioContext需要user gesture才能正常init), 一般配合selenium WebDriver 或 chrome dev protocol來進行操作 可參考 https://github.com/GoogleChrome/puppeteer

Posted in System Administration | Leave a comment

ffmpeg audio volume adjust

當多媒體檔案聲音大小需要調整時 可參考 https://trac.ffmpeg.org/wiki/AudioVolume get stats ffmpeg -i INPUT_FILE -filter:a volumedetect -f null NUL (NUL or /dev/null) [Parsed_volumedetect_0 @ 000001be4a046040] n_samples: 26064896 [Parsed_volumedetect_0 @ 000001be4a046040] mean_volume: -32.1 dB [Parsed_volumedetect_0 @ 000001be4a046040] max_volume: -5.6 dB adjust volume ffmpeg -i INPUT_FILE -af “volume=5.6dB” … Continue reading

Posted in System Administration | Leave a comment

genisoimage

genisoimage -joliet-long -J -r -allow-lowercase -allow-multidot -o 檔案名.iso 目錄名稱 -J 為必須, 指定input charset 為unicode, 不然default是iso8859-1, 會導致output的名稱被取代成underscore

Posted in System Administration | Leave a comment

mount tips

show export list showmount -e #local showmount -e 192.168.1.10 #remote mount -t nfs 192.168.1.10:/XXXX /YYYY nfsstat -m #查看nfs mount相關信息 mount -t cifs -o admin,passwd //192.168.1.10/base /mnt mount -t cifs -o username=admin //192.168.1.10/base /mnt VBoxManage storageattach #VBOXNAME –storagectl “SATA” –port 0 … Continue reading

Posted in System Administration | Leave a comment