Category Archives: Linux

Add git branch name to bash prompt

edit ~/.bash_profile

Posted in CentOS, Git, Linux, Mac, Ubuntu | Leave a comment

Get timestamp in milliseconds

echo $(($(date +%s%N)/1000000)) in Mac OS X, the command date does not support the %N flag, we can install coreutils using homebrew. brew install coreutils Then use gdate to get which we want. echo $(($(gdate +%s%N)/1000000))

Posted in Linux, Mac | Leave a comment

find unused files and delete them

find /var/log/radius/radacct -type f -name “reply*” -mtime +60 -exec rm -rf {} \; -mtime N — more than N days without being edited -exec CMD {} \; — comands, {} means the files which be found.

Posted in Linux, Shell Script | Leave a comment

[Linux] sudo: sorry, you must have a tty to run sudo

edit /etc/sudoers find ‘requiretty’ add username like this Defaults:webuser requiretty

Posted in Linux | Leave a comment

Delete the specific files in all subdirectories

check the find result find . -name “*.bak” -type f delete it find . -name “*.bak” -type f -delete Ref. ask Ubuntu: How can I recursively delete all files of a specific extension in the current directory?

Posted in Linux | Leave a comment

[Linux] Sort the disk usage

Ref.: [ubuntu] 利用du搭配sort來查看磁碟使用空間]1

Posted in Linux | Leave a comment

Install aglio in Ubuntu 14.04

Install nodejs Ref. NodeSource Node.js Binary Distributions

Install python

Install aglio Ref. Github : aglio

Posted in Aglio, Ubuntu | Leave a comment

[Apache HBase] Install Apache HBase in Ubuntu 14.04

Java 1.7

Cloudera HBase Ref. installing-apache-hbase-on-ubuntu-for-standalone-mode Note. hbase tar file choose http://archive.apache.org/dist/hbase/hbase-0.98.5/hbase-0.98.5-hadoop1-bin.tar.gz (or http://ftp.mirror.tw/pub/apache/hbase/hbase-0.98.11/hbase-0.98.11-hadoop1-bin.tar.gz )

Posted in HBase, Ubuntu | Leave a comment

[Ubuntu] Enable exFAT support

All you need is install the exfat-* packages.

Posted in Ubuntu | Leave a comment

[Ubuntu] Enable power saving in Lenovo X61

Ref: http://www.webupd8.org/2014/04/prevent-your-laptop-from-overheating.html Because I installed Ubuntu 14.04 in my Lenovo X61. Although it could switch into the sleep mode after closing the lid. It’s not really using the power saving mode. So we must edit the GRUB file.

Find … Continue reading

Posted in Ubuntu | Leave a comment