Tuesday, January 17, 2017

Serial Edit on VIM editor

When we need to use serial edit while on vim editor.

The following command will change from lines 3 to 7 all words of dogs in to cats.

:3,7s/dogs/cats/g

Monday, January 16, 2017

Hmmmm

Hmmm 5% increase per year


0.05 Per Month Per Year Cumulative
1st Year 23000 276000 276000
2nd Year 24150 289800 565800
3rd Year 25358 304290 870090
4th Year 26625 319505 1189595
5th Year 27957 335480 1525074
6th Year 29354 352254 1877328
7th Year 30822 369866 2247194
8th Year 32363 388360 2635554
9th Year 33981 407778 3043332
10th Year 35681 428167 3471498
11th Year 37465 449575 3921073
12th Year 39338 472054 4393127
13th Year 41305 495656 4888783
14th Year 43370 520439 5409222
15th Year 45538 546461 5955684
16th Year 47815 573784 6529468
17th Year 50206 602473 7131941
18th Year 52716 632597 7764538
19th Year 55352 664227 8428765
20th Year 58120 697438 9126203
21st Year 61026 732310 9858513
22nd Year 64077 768926 10627439
23rd Year 67281 807372 11434811
24th Year 70645 847741 12282552
25th Year 74177 890128 13172679

Thursday, January 12, 2017

Openssl

This site has wonderful information and I have picked up a few command form it.

To check the contents of a Certificate Request file (csr)
$ openssl req -in server.csr -noout -text

To view the contents of a CA Signed certificate request file (cer)
$ openssl x509 -in server.cer -noout -text


Tuesday, December 27, 2016

Centos 7 Firewall

In order to allow port 22 on centos 7  I followed what was given in the following link

http://stackoverflow.com/questions/24729024/centos-7-open-firewall-port


Monday, December 19, 2016

A processes elapsed time (etime)

Using ps we can find the elapsed time for a process, when we know its process ID.

ps -eo pid,etime,command | grep

Monday, December 5, 2016

Screen - Linux Utility

Screen is an linux utility to do tasks on many terminal, with just one SSH connection to a server.  We can consider it somewhat like the tabs on our browser.

To start Screen

$ screen -S Bala
The word Bala will be attached to this version of screens.  This means to say that I can open another screen which has its one set of tables with another name of Test with the command "screen -S Test"

#
Command
Definition
1
CTRL+A & press c
To create a new Tab inside the screen
2
CTRL+A & press n
To switch between the tabs.
3
CTRL+A & press d
To detach from this screen instance to be reconnected later.
4
Screen -ls
This can be used to list all screen process like Bala or Test.
5
Screen -r
This can be used to reattach to the detached screen.
6
CTRL+A & Shift s
To Split the screen horizontally
7
CTRL+A & Tab
To move to the split screen.
8
CTRL+A & press c
To get the prompt here
9
CTRL+A & Shift x
To remove the split screen.

http://unix.stackexchange.com/questions/26248/tabs-when-using-screen

Put this in .screenrc

# skip the startup message
startup_message off

# go to home dir
chdir

# Automatically detach on hangup. 
autodetach on

# Change default scrollback value for new windows
defscrollback 10000

# start with visual bell as default
vbell on
vbell_msg "bell on %t (%n)"

# look and feel
caption always "%{= bb}%{+b w}%n %t %h %=%l %H %c"
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"

activity "Activity in %t(%n)"

shelltitle "shell"
shell -$SHELL

Wednesday, June 1, 2016

snort oinkmaster

To modify Signatures using oinkmaster.

modifysid 1000000 "\$EXTERNAL_NET" | "!\$HOME_NET"

modifysid 1000001 "\$EXTERNAL_NET" | "![10.0.0.1,10.0.0.2]"

modifysid 1000001 "\-> any" | "\-> ![10.0.0.1]"

disablesid 1000002

DANGER:  Don't you dare leave spaces between the IP address while you are negating them in modifysid shown in the second line.  The reference for that is shown below from snort manual.