Monday 23 October 2017

Syslog Configuration in Routers | Cisco

Syslog Configuration in Packet Tracer

router >
enable
configure terminal
int fa 0/1
ip address 192.168.0.100 255.255.255.0
no shutdown
exit
logging 192.168.0.1 #ip of syslog server


now connect a Syslog server with router int fa0/1
and set ip same as mentioned in logging 192.168.0.1


:) we are done.


Port Mirroring, Switch Port Analyzer (SPAN) or Sniffing | Cisco

Port Mirroring, Switch Port Analyzer (SPAN) or Sniffing

switch>
enable
config terminal
monitor session 1 source inter fa 0/1
monitor session 1 source inter fa 0/2
monitor session 1 destination int fa 0/24
exit
show monitor

done:)

Monday 16 October 2017

Anonymize or Replace text within a File using SED | Linux

Stream Editor aka 'sed' is a *nix utility to transform and parse text.

for example.
if a file testing.txt contains some text like ' helloworld.zip ',  it will be replace with any text or we can use $RANDOM function also.
sed s/hello.*zip/"hello://$RANDOM.zip"/g testing.txt
the final result will be like this:
hello12345.zip (any random number)
/g means all occurrence of this text


Friday 13 October 2017

Find and Delete All Files Older than 10 Days using mtime | Linux

#to file files older than 10 days:
find /home/folder/ -mtime +10;

#now append it with -exec switch +  rm {} loop to delete all found files:
find /home/folder/ -mtime +10 -exec rm {} \;

----------------------
#and to find only in specific directory ignore sub directories

find /home/folder/ -maxdepth 1 -mtime +10

Monday 9 October 2017

Install and Configure Target iSCSI Server on Windows Server 2012 | Windows

1. in Add new Role and Feature > Navigate to Server Roles
2. under File and Storage Services > Check iSCSI Target Server > > Install.

3. again in Server Manager, a new File and Storage Services has added,
Click on Launch the new Virtual Disk wizard to create Virtual Disk

Select iSCSI virtual disk Location: Select Drive/ or custom Path
Next
Specify iSCSI virtual disk size:  10GB
iSCSI Target. New iSCSI Target > Next
Target Name and Action : any name > Next
Access Servers (list initiators so the disk be presented to only these): ADD by IQN or IP etc
Next > Create(b).
Close(b).
-------------------------------
on Client as Initiator: 

Start iSCSI Initiator
Targets(T): Target: enter IP (ie. 10.1.1.100), Quick Connect(b)
Done(b)

now verify in Disk Management, a new disk is added with 10GB space.