Saturday, May 10, 2014
/var/lastlog show the huge size from ls output.
This does not make sense because df only show used size last than 1G
It turns out, the du would give more accurate size.
It is because the lastlog file is sparse file, it contain many empty space . Using –s option in the ls would show the actual size instead of pre allocated size.
Wednesday, May 7, 2014
Very useful open source application that can help visualize cryptography … I wish I know this years ago when I still in school .
Download from here
Here are some notes for setting up the replication in Mongo DB. Unlike other DBMS, mongodb’s replication more like the database mirroring . You can not pick or choice what column get replicate .
Configure three Mongo DB run as service. Below are my configure file.
There files are identical except the service name and port number. I use port 27017, 27018 and 27019. The key thing here is the replSet. This is the replication set name.
From procexp, you can see three service are using the same binary but of course, they all have its own database directory.
Tuesday, May 6, 2014
Install Mongo DB on windows is easy . 4 steps and you are in business.
- Download the software.
- Unzip the software
- Create the data folder
- run the daemon mongod.exe .
Simply control + C would shutdown the mongo DB gracefully.
RUN mongo DB as windows service
Create the configuration file:
- options are case sensitive . The best way to find the options are check the mongod –help
- quote on the path does not work. EX: can not use “C:\data\db”
Use below command to install as service .
Then we can find mongo db list in the service manager.
Failed to connect to 127.0.0.1:27017, reason: errno:10061 No connection could be made because the target machine actively refused it.
This is because the you are running on the non-privilege session. change to the administrator command line would resolve this.
Monday, May 5, 2014
This is my note for configure Linux intergrade windows domain authentication with Kerberos
- yum install samba
- yum install krb5-server
- yum install krb5-workstation
- yum install samba-winbind
- yum install ntpdate --> This is required for sync time
- yum install cifs-utils
Setup the Host Name on Linux
Setup the host name in /etc/sysconfig/network
Sunday, May 4, 2014
tmux is terminal multiplexer. Similar to the screen that I use at office.
Here are few advantages/reasons that using tmux over screen.
- tmux is under activity development and with BSD license.
- tmux use less resource.
- Flexible control the pane.
- Scroll back history
It is not part of centos yum repository. To install it, we need to set up the EPEL.
The user configure tmux configure file is located at ~/.tmux.conf
Here is my binding and below cheat sheet is base on that.
|List tmux session||tmux lis|
|Attached the session||tmux a –t <session id>|
|Kill the current window||prefix + &|
|pane to window||prefix + !|
|next pane||prefix + o|
|next window||prefix + n|
|copy mode||prefix + <ESC>|
|copy to the vmux buffer||use mouse select the text or
copy mode –> prefix + v to select the text –> prefix + y to copy
|copy to vi||prefix + p|
|copy from putty to notepad||shift key and select as normally putty|
This is tricky one. I use putty to my linux box and I like the putty function that can just select the text and copy paste. However, because tumx buffer is independent outside the system buffer and tmux would also take the signal about the putty for the mouse resize. To achieve this goal, we have 2 ways to do it.
1. complete disable the signals from putty .
Terminal –> Features –> Disable xterm-style mouse reporting
By check this box, we can no longer use mouse to resize or pane or enter the copy mode, and copy tmux buffer.
2. Press shift key while copy paste
I decided to use the 2nd approach It will take some time to get used to it.
Another challenge is to copy the content of pane into notepad. At this point, I will just move the pane into its own window and use the shift key to do it.
Saturday, May 3, 2014
EPEL is Fedora Repository. By default, the Centos does not configure to use it.
Below command list what is current yum repository.
To install it:
Re run the yum repolist again, this will update the repository.