How to call an class with arguments from another class in ruby or puppet DSL ???
My blog contains solutions of problems i have faced during working with computers and servers
Thursday, March 30, 2017
Friday, October 14, 2016
CHEF post 1
Hi all
I am started to learning CHEF, you may thought i am going to cook some food. ha ha ha, very funny guys. Those who doesn't know what is chef, It is an configuration management language. so you think, some of us using some other tools are scripts to manage config files. CHEF is an new concept , it's been there for many years, i am started learning now, i am going to do an walkthrough for my CHEF knowledge with all of you ..!!!
Thanks
Thirumoorthi
I am started to learning CHEF, you may thought i am going to cook some food. ha ha ha, very funny guys. Those who doesn't know what is chef, It is an configuration management language. so you think, some of us using some other tools are scripts to manage config files. CHEF is an new concept , it's been there for many years, i am started learning now, i am going to do an walkthrough for my CHEF knowledge with all of you ..!!!
Thanks
Thirumoorthi
Thursday, June 2, 2016
What I learned Today " Password less login for your servers "
Hi all ,
Even though some of the servers are compromised using passwords , So to avoid those kind of issues we have to setup Password less login to ensure high safety and security to our servers.
Steps : Create SSH keys to your user id in your server , use bellow commands to create SSH keys ,
Even though some of the servers are compromised using passwords , So to avoid those kind of issues we have to setup Password less login to ensure high safety and security to our servers.
Steps : Create SSH keys to your user id in your server , use bellow commands to create SSH keys ,
cd ~/.ssh ssh-keygen -t dsa -b 1024
Create an PEM key from an gerenated PRIVATEKEY
openssl dsa -in id_dsa -outform pem > test.pem
Copy generated Public key to Authorized_keys file,
cat id_dsa.pub >> authorized_keys
That's it we are done with the key generation. We have to do is to copy that pem key to
local machine and log in to that server with this pem key.
ssh -i "test.pem" username@servername
That's it we are good to gooooo.....!!!!!
Friday, February 12, 2016
Completed first python script on Excel automation
I am happy to share that I finished excel automation for my official work.I actually used openpyxl for my xlsx automation. I feel great when I done it. Before that I thought automating an excellent work is bit difficult but once you learn to do, it's mind blowing.
I'm trying to automate xlsx works for an little bit of an time. But due to some backlogs I didn't finish it on the expected time period.
Wednesday, September 30, 2015
What I learned today sep 30th 2015
I find out that search and replace for an file using SED editor
sed -i 's#055#007#' /etc/login.defs ; grep UMASK /etc/login.defs
above command replaces 055 value in login.defs to 007,
this may looks like simple, but it is more powerfull stuff
Monday, July 20, 2015
what i learned #today 20-07-2015
Hi all ,
one of my friend asked me how to scan newly attached LUN's
one of my friend asked me how to scan newly attached LUN's
How to scan new FC LUNS and SCSI disks in Linux ?
How to scan new FC LUNS and SCSI disks in Redhat Linux without rebooting the server? Most of the Linux beginners have wondering how to do this and this article will be for them.It may look like very simple as we perform this in daily operation to scan luns but system has many work to do in background when you execute storage scanning commands. Redhat says this type of scan can be distributive,since it can cause delays while I/O operation timeout and remove devices unexpectedly from OS.So perform this scan when really you want to scan the disks and LUNS.
Scanning FC-LUN’s in Redhat Linux
1.First find out how many disks are visible in “fdisk -l” .
# fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l
2.Find out how many host bus adapter configured in the Linux box.you can use “systool -fc_host -v” to verify available FC in the system.
# ls /sys/class/fc_host host0 host1
In this case,you need to scan host0 & host1 HBA.
3.If the system virtual memory is too low ,then do not proceed further.If you have enough free virtual memory,then you can proceed with below command to scan new LUNS.
From Redhat Linux 5.4 onwards, redhat introduced “/usr/bin/rescan-scsi-bus.sh” script to scan all the SCSI bus and update the SCSI layer to reflect new devices.
# echo "1" > /sys/class/fc_host/host0/issue_lip # echo "1" > /sys/class/fc_host/host1/issue_lip
Note: You need to monitor the “issue_lip” in /var/log/messages to determine when the scan will complete.This operation is an asynchronous operation.
4.Verify if the new LUN is visible or not by counting the available disks.
4.Verify if the new LUN is visible or not by counting the available disks.
# fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l
If any new LUNS added ,then you can see more count is more then before scanning the LUNS.
Scanning SCSI DISKS in Redhat Linux
1.Finding the existing disk from fdisk.
[root@mylinz1 ~]# fdisk -l |egrep '^Disk' |egrep -v 'dm-' Disk /dev/sda: 21.5 GB, 21474836480 bytes
2.Find out how many SCSI controller configured.
[root@mylinz1 ~]# ls /sys/class/scsi_host/host host0 host1 host2
In this case,you need to scan host0,host1 & host2.
3.Scan the SCSI disks using below command.
3.Scan the SCSI disks using below command.
[root@mylinz1 ~]# echo "- - -" > /sys/class/scsi_host/host0/scan [root@mylinz1 ~]# echo "- - -" > /sys/class/scsi_host/host1/scan [root@mylinz1 ~]# echo "- - -" > /sys/class/scsi_host/host2/scan
4.Verify if the new disks are visible or not.
[root@mylinz1 ~]# fdisk -l |egrep '^Disk' |egrep -v 'dm-' Disk /dev/sda: 21.5 GB, 21474836480 bytes Disk /dev/sdb: 1073 MB, 1073741824 bytes Disk /dev/sdc: 1073 MB, 1073741824 bytes
From Redhat Linux 5.4 onwards, redhat introduced “/usr/bin/rescan-scsi-bus.sh” script to scan all the SCSI bus and update the SCSI layer to reflect new devices.
But most of the time,script will not be able to scan new disks and you need go with echo command.
please look into this link
please look into this link
Thank you for reading this article.
Thursday, July 16, 2015
What i learned today 15-07-2015
Today we have some problem faced in our environment, that we have to check whether the LDAP port is opened or closed . usually we go with telnet command that will show us which port is opened.
But some times we should to check more than that , so we should use tcpdump to check on all the details as required.
following is the command used to solve
But some times we should to check more than that , so we should use tcpdump to check on all the details as required.
following is the command used to solve
tcpdump -i ethernetnumber port 909
eg :- tcpdump -i eth0 port 909
Above example gives you whats going on in particular port 909.
Friday, July 10, 2015
What i learned today 9-7-15
Hi all
Bellow are the things learned today.
1.
I understand why we use blacklist=e1000e command in kernel arguments while installing OS in physical servers, i do this previously in server os installations but i forget it some how.
guys please make an note of this, because it is really helpfull for you while installing OS. problem is anaconda installer is unable to find which network card to be used to search for rpms to proceed with OS installation.
2.
for the first time in my life i used for loop in my work environment , wow it works amazing(i know) , But when you feel an relaxation while it creates output as you desired.
I look for ways to bringing up all the network cards in my network , usualy what we do means that we go and enter all the cards one by one , we know there is an option for it to reduce the process but we are not ready to find out how to solve it , i just googled it and find out these.
for i in {0..15};do ifconfig eth"$i" up ; done
This looks like simple to you, but it bring up all the network cards in my Server, Pretty weird right. ya i too accept that fact
Bellow are the things learned today.
1.
I understand why we use blacklist=e1000e command in kernel arguments while installing OS in physical servers, i do this previously in server os installations but i forget it some how.
guys please make an note of this, because it is really helpfull for you while installing OS. problem is anaconda installer is unable to find which network card to be used to search for rpms to proceed with OS installation.
2.
for the first time in my life i used for loop in my work environment , wow it works amazing(i know) , But when you feel an relaxation while it creates output as you desired.
I look for ways to bringing up all the network cards in my network , usualy what we do means that we go and enter all the cards one by one , we know there is an option for it to reduce the process but we are not ready to find out how to solve it , i just googled it and find out these.
for i in {0..15};do ifconfig eth"$i" up ; done
This looks like simple to you, but it bring up all the network cards in my Server, Pretty weird right. ya i too accept that fact
Friday, June 12, 2015
Reset ADS/LDAP user from client end
Normaly we think if an ADS/LDAP user unable to login means , the problem is with ADS/LDAP server , Guess what it is not
Login counter is an just an counter it counts number of logins failed it think, if we reset that counter to zero means we can able to login to the server via that user
you may see following error in /var/log/messages
Jun 10 13:52:04 systemname lsass: [lsass] Failed to authenticate user (name = 'username') -> error = 40056, symbol = LW_ERROR_ACCOUNT_DISABLED, client pid = 31405
Jun 10 13:52:06 systemname sshd[31405]: Failed password for username from x.x.x.x port 1190 ssh2
If you’re root but is not managing to become a user with su, you also need to reset the login counter:
root@testsrv~ # su – username
su: incorrect password
root@testsrv:~ # /sbin/pam_tally --user user1--reset
User user1 (672) had 34
(or)
root@testsrv:~ # /sbin/pam_tally2 --user user1--reset
root@testsrv:~ # su – username
user1@testsrv:~ $
Friday, May 15, 2015
What i know today %date 15th may 2015
1. If you want to rename an file with host name of an server, just do an simple command
#mv oldfilename newfilename$(hostname)
instead of host name you can change it to any variable name
2. compare two files using following command
# sdiff -s file1 file2
#mv oldfilename newfilename$(hostname)
instead of host name you can change it to any variable name
2. compare two files using following command
# sdiff -s file1 file2
Friday, November 8, 2013
Default port numbers
| Port Number | Description |
|---|---|
| 1 | TCP Port Service Multiplexer (TCPMUX) |
| 5 | Remote Job Entry (RJE) |
| 7 | ECHO |
| 18 | Message Send Protocol (MSP) |
| 20 | FTP -- Data |
| 21 | FTP -- Control |
| 22 | SSH Remote Login Protocol |
| 23 | Telnet |
| 25 | Simple Mail Transfer Protocol (SMTP) |
| 29 | MSG ICP |
| 37 | Time |
| 42 | Host Name Server (Nameserv) |
| 43 | WhoIs |
| 49 | Login Host Protocol (Login) |
| 53 | Domain Name System (DNS) |
| 69 | Trivial File Transfer Protocol (TFTP) |
| 70 | Gopher Services |
| 79 | Finger |
| 80 | HTTP |
| 103 | X.400 Standard |
| 108 | SNA Gateway Access Server |
| 109 | POP2 |
| 110 | POP3 |
| 115 | Simple File Transfer Protocol (SFTP) |
| 118 | SQL Services |
| 119 | Newsgroup (NNTP) |
| 137 | NetBIOS Name Service |
| 139 | NetBIOS Datagram Service |
| 143 | Interim Mail Access Protocol (IMAP) |
| 150 | NetBIOS Session Service |
| 156 | SQL Server |
| 161 | SNMP |
| 179 | Border Gateway Protocol (BGP) |
| 190 | Gateway Access Control Protocol (GACP) |
| 194 | Internet Relay Chat (IRC) |
| 197 | Directory Location Service (DLS) |
| 389 | Lightweight Directory Access Protocol (LDAP) |
| 396 | Novell Netware over IP |
| 443 | HTTPS |
| 444 | Simple Network Paging Protocol (SNPP) |
| 445 | Microsoft-DS |
| 458 | Apple QuickTime |
| 546 | DHCP Client |
| 547 | DHCP Server |
| 563 | SNEWS |
| 569 | MSN |
| 1080 | Socks |
How to enforce password complexity on Linux
On most Linux systems, you can use PAM (the "pluggable authentication module") to enforce password complexity. If you have a file named /etc/pam.d/system-auth on RedHat (/etc/pam.d/common-password on Debian systems), look for lines that look like those shown below.
$ grep password /etc/pam.d/system-auth password requisite pam_cracklib.so try_first_pass retry=3 password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok password required pam_deny.so
That's what you should expect to see on a new system.
By default, passwords must have at least six characters (see /etc/login.defs for possible changes). This is hardly long enough by current standards to consider passwords to be secure. You will have a much stronger password complexity policy if you change the first line to something like this, requiring longer passwords and ensuring a degree of complexity as well.
password requisite pam_cracklib.so try_first_pass retry=3 minlength=12 lcredit=1 ucredit=1 dcredit=1 ocredit=1 difok=4
Here's what each of the available parameters does:
try_first_pass = sets the number of times users can attempt setting a good password before the passwd command aborts minlen = establishes a measure of complexity related to the password length (more in a moment on this) lcredit = sets the minimum number of required lowercase letters ucredit = sets the minimum number of required uppercase letters dcredit = sets the minimum number of required digits ocredit = sets the minimum number of required other characters difok = sets the number of characters that must be different from those in the previous password
That said, minlen is actually a measure of complexity, not simply length. It specifies a complexity score that must be reached for a password to be deemed as acceptable. If each character in a password added one to the complexity count, then minlen would simply represent the password length but, if some characters count more than once, the calculation is more complex. So let's see how this works.
The minlen complexity measure is calculated in a number of steps:
- every character in a password yields one point, regardless of the type of character
- every lowercase letter adds one point, but only up to the value of lcredit
- every uppercase letter adds one point, but only up to the value of ucredit
- every digit adds one point, but only up to the value of dcredit
- every special character adds one point, but only up to the value of ocredit
If lcredit, ucredit, dcredit and ocredit were all set to 0, only the password length would be used to determine if it's acceptable. No characters would add extra points to the complexity score.
When you set any of the lcredit, ucredit, dcredit or ocredit parameters to a negative number, then you MUST have at least that number of characters for each character class for the password to pass the complexity test.
Setting minlen to 12 and difok to 4 are generally good settings. However, if you want to require 12 character passwords and complexity too, you will need a larger minlen setting. With minlen set to 12 and one point given for including each of a lowercase, uppercase, digit and special character (the defaults), you could get by with passwords that have only eight characters -- even with minlen set to 12! A stronger policy would be required by this:
password requisite pam_cracklib.so try_first_pass retry=3 minlength=16 lcredit=-1 ucredit=-1 dcredit=-1 ocredit=-1 difok=4
These settings would ensure that your passwords have 12 characters, including at least one characters in each of the four classes.
If you'd like to experiment with the password length and complexity settings, try the script below. It's a bit cumbersome, but it should capture all the requirements aside from the difok(differences) criteria. Change the settings in the first section to match those you want to evaluate.
#!/usr/bin/perl -w
# -- set your complexity preferences here --
$minlen=16;
$lcredit=-1;
$ucredit=-1;
$dcredit=-1;
$ocredit=-1;
# -- initialize the counters --
$score=0;
$lcase=0;
$ucase=0;
$digits=0;
$other=0;
# -- set fail to false --
$fail=0;
# -- check for argument --
if ( $#ARGV < 0 ) {
print "argument expected\n";
exit;
} else {
$password=$ARGV[0];
}
# -- determine if any character settings are mandatory (if negative)
if ($lcredit < 0) { # needed # of lowercase characters
$lneeded=-1 * $lcredit;
$lextra=$lneeded;
} else {
$lneeded=0;
$lextra=$lcredit;
}
if ($ucredit < 0) { # needed # of uppercase characters
$uneeded=-1 * $ucredit;
$uextra=$uneeded;
} else {
$uneeded=0;
$uextra=$ucredit;
}
if ($dcredit < 0) { # needed # of digits
$dneeded=-1 * $dcredit;
$dextra=$dneeded;
} else {
$dneeded=0;
$dextra=$dcredit;
}
if ($ocredit < 0) { # needed # of special characters
$oneeded=-1 * $ocredit;
$oextra=$oneeded;
} else {
$oneeded=0;
$oextra=$ocredit;
}
$score=length($password); # 1 point for each character
# -- count the characters of each type --
foreach $char (split //, $password) {
if ($char =~ /\d/) {
$digits++; # digits
} elsif ($char !~ /\w/) {
$other++; # special characters
} elsif ($char eq lc($char)) {
$lcase++; # lowercase
} elsif ($char eq uc($char)) {
$ucase++; # uppercase
} else {
print "Error: unrecognized character. Please fix this script!\n";
}
}
if ($lcase < $lneeded) {
print "password failure: need $lneeded lowercase character(s)\n";
$fail=1;
}
if ($ucase < $uneeded) {
print "password failure: need $uneeded uppercase character(s)\n";
$fail=1;
}
if ($digits < $dneeded) {
print "password failure: need $dneeded digit(s)\n";
$fail=1;
}
if ($other < $oneeded) {
print "password failure: need $oneeded special character(s)\n";
$fail=1;
}
if ($fail > 0) {
exit;
}
# -- reduce credits to number allowed --
if ($lcase > $lextra) {
$lcase=$lextra;
}
if ($ucase > $uextra) {
$ucase=$uextra;
}
if ($digits > $dextra) {
$digits=$dextra;
}
if ($other > $oextra) {
$other=$oextra;
}
print "$score + $lcase + $ucase + $digits + $other\n";
$score=$score + $lcase + $ucase + $digits + $other;
if ($score >= $minlen) {
print "password passes with score of $score\n";
} else {
print "password fails with score of $score\n";
}
Check out /etc/login.defs for password expiration parameters -- another component of good password security.
And please note that cracklib ensures that users can't just reverse their prior passwords or rotate letters to avoid making significant password changes. So, p4ssw0rd cannot be replaced with dr0wss4p or 4ssw0rdp.
Tuesday, November 5, 2013
Creating a app specifically for locating temples, churchs and mosques
The idea behid this is when you are going to a different town in which you don't what is nearby, so we enable this app to solve those kind of situations.
But I think google apps already have this feature but I want to create it different from that..!
Thursday, October 31, 2013
Configuring Outlook Express via PowerShell
I don't think there is an option for configuring outlook via power shell , i have to check it out
Wednesday, October 30, 2013
Create Filters in Outlook Express
Create Filters in Outlook Express
Outlook Express allows you to set up very elaborate filters for handling mail which you can direct to certain folders by setting up Mail Rules.
Outlook Express uses the term Rules, but a Rule and a Filter are the same thing.
- Click on the Tools menu
- Select Message Rules
- Click Mail
- In the Mail Rules window click New
In the New Mail Rule window you will need to follow steps 1 through 4.
- Under the first section, 1. Select the conditions for your rule
- Select which conditions you want to use as the basis of this filter. Choose Where the Subject line contains specific words to block all messages with “[SPAM” in the Subject field, so that all messages tagged by the anti-spam system will be moved to a SPAMBOX folder that you will create later.
- In the second box, 2. Select the Action for your rule
- Check the box Move it to the specified folder
In each section you can check one or more boxes, depending on what you are trying to accomplish
As you are checking off your criteria, you will notice that blue keywords will pop up in box 3. Rule Description - Click the blue keywords to enter your specific criteria for the rule
You can enter multiple keywords in the same rule - Enter each keyword or phrase and click Add
For this rule, just enter SPAM, in all caps - Click OK to return to the New Mail Rule window
- Under 2. Select the Actions for you Rule, put a check in the box Move it to the Specified folder
- Click the blue keywords in box #3 to change specified folder to SPAMBOX
You will probably have to create a new folder, or you can use any of your existing folders - Give your rule a Name
- Click OK
Friday, January 18, 2013
what happens when ur eyebrows tickles
i am not an astrologer or an scientist but my grand mother says that if your right eyebrow tickles means some good thing is going to happen but for an instance if your left eye brow tickles means that you are getting into an fight better you control your tough...,
may people don't believe in karma and all but as an tamilan i believe in my self and karma,
better check this out and comment
may people don't believe in karma and all but as an tamilan i believe in my self and karma,
better check this out and comment
Monday, December 19, 2011
YUM COMPLETE CONFIGURATION WITH VIDEO
Yum is a yellow dog update manager it is a new package manager
introduced by redhat with RHEL5 in year 2007 but now in RHEL6 they also
have this facility to manage the packages. By using YUM we can manage
the packages in many ways. YUM is always working in Server /Client
environment. To configure YUM Server and Client perform the steps given
below
STEP 1 # mount /dev/dvd /mnt
mounting RHEL6 DVD TO AN LOCAL FOLDER
# cd /mnt/Packages
# rpm -ivh vsftpd
NOTE : Because YUM only can be configured either by using FTP or HTTP
# rpm -ivh createrepo
NOTE : There will be two dependencies just install them
#cd ..
# cp -rfv * /var/ftp/pub
This will start copy of dvd data into the /var/ftp/pub
# cd
# umount /mnt
# cd /var/ftp/pub
# createrepo -v Packages
NOTE: This will create the private repository of our database
Thursday, November 10, 2011
Subscribe to:
Posts (Atom)
Certifications in Hiring: Valuable but Not Always Necessary
In today's competitive job market, certifications have become a common currency for both employers and job seekers. They serve as standa...
-
Normaly we think if an ADS/LDAP user unable to login means , the problem is with ADS/LDAP server , Guess what it is not Login cou...
-
Today we have some problem faced in our environment, that we have to check whether the LDAP port is opened or closed . usually we go with ...
-
Hi all , one of my friend asked me how to scan newly attached LUN's How to scan new FC LUNS and SCSI disks in Linux ? How to ...