Top 10 ways to save PC computing energy

How many of us leave our PCs running all day long, even when we’re not using them? Despite the fact that today’s desktop and laptop PCs and their OSes provide extensive power management functions, most PC users don’t bother to use them to shrink their systems’ carbon footprints.

According to an online survey conducted by the Climate Savers Computing Initiative, 55 percent of 7,274 respondents don’t take advantage of their PCs’ power management functions, such as suspend/resume shut-down options and performance profiles.

On the bright side, of those not already using power management, nearly all (97 percent) said they’d like to begin using their systems’ power-saving capabilities. According to the Initiative, each of these users stands to reduce their carbon footprint by nearly half a ton of CO2 annually, not to mention saving $60 or more in energy costs per year. Read the rest of this entry »

The Ultimate Guide for Creating Strong Passwords

Strong Password

“Treat your password like your toothbrush. Don’t let anybody else use it, and get a new one every six months” – Clifford Stoll

When you create an account on a website, you may have the “password dilemma” for a second. The dilemma is whether you should provide a weak password that is easy to remember or a strong password that is hard to remember. Following are the rules and guidelines that may help you in overcoming the password dilemma and help you in creating a strong password that are secure. These are the things that I’ve used over years based on my own interest in the area of keeping the password safe and secure.

I. Two essential password rules:

Following two rules are bare minimal that you should follow while creating a password.

Rule 1 – Password Length: Stick with passwords that are at least 8 characters in length. The more character in the passwords is better, as the time taken to crack the password by an attacker will be longer. 10 characters or longer are better.

Rule 2 – Password Complexity: Should contain at least one character from each of the following group. At least 4 characters in your passwords should be each one of the following.

  1. Lower case alphabets
  2. Upper case alphabets
  3. Numbers
  4. Special Characters

I call the above two rules combined as “8 4 Rule” (Eight Four Rule):

  • 8 = 8 characters minimum length
  • 4 = 1 lower case + 1 upper case + 1 number + 1 special character.

Just following the “8 4 Rule” will be a huge improvement and instantly make your password much stronger than before for most of you who don’t follow any guidelines or rules while creating a passwords. If your banking and any financially sensitive website passwords doesn’t follow the “8 4 Rule”, I strongly suggest that you stop everything now and change those passwords immediately to follow the “8 4 Rule”.

II. Guidelines for creating strong passwords:

  1. Follow “8 4 Rule”. Like I mentioned above this is the foundation of creating a strong password.
  2. Unique Characters. Should contain at least 5 unique characters. You already have 4 different character if you’ve followed “8 4 Rule”.
  3. Use Password Manager. Strong passwords are hard to remember. So, as part of creating a strong password you need a reliable and trustworthy way of remembering the strong password. Using password management tool to store passwords should really become a habit. Anytime you create a password, note it down on a password manager tool, that will encrypt the password and store it safe for you. I recommend Password Dragon (Shameless plug. I’m the developer of this software), a free, easy and secure password manager that works on Windows, Linux and Mac. This can also be launched from the USB drive. There are lot of free password manager tools available, choose the one that best suites your taste and use it.
  4. Use Passphrase. If you don’t want to use password management tool, Use Passphrase to easily remember the passwords. You can use initials of a song or a phrase that are very familiar to you. for e.g. “Passwords are like underwears, change yours often!” phrase can be converted to a strong password “Prlu,Curs0!”

III. Guidelines for avoiding weak passwords.

Avoid the following in your passwords. Even part of your passwords should not be anything in the following items.

  1. Password same as username or part of the username
  2. Name of family members, friends or pets.
  3. Personal information about yourself or family members. This includes the generic information that can be obtained about you very easily, such as birth date, phone number, vehicle license plate number, street name, apartment/house number etc.
  4. Sequences. i.e consecutive alphabets, numbers or keys on the keyboard. for e.g. abcde, 12345, qwert.
  5. Dictionary words. Dictionary words with number or character in front or back
  6. Real word from any language
  7. Word found in dictionary with number substitution for word look alike. for e.g. Replacing the letter O with number 0. i.e passw0rd.
  8. Any of the above in reverse sequence
  9. Any of the above with a number in front or back.
  10. Empty password

IV. Common sense about passwords:

All the following points are nothing new and very much common sense. But most of the time, we tend to ignore these items.

  1. Create unique password every time. When you are changing a password for an existing account, it should not be the same as the previous password. Also, do not use incremental passwords while changing it. i.e password1, password2 etc.
  2. Change your passwords for all your accounts once every 6 months. Since passwords have a fixed length, a brute-force attack to guess the password will always succeed if enough time and processing power was available to the attacker. So, it is always recommended to change the passwords often. Schedule an recurring appointment on your calendar to change your passwords once every 6 months.
  3. Never write down your passwords. Creating a very strong password and writing it down on a paper is as bad as creating an easy to remember weak password and not writing it down anywhere. There are several interesting surrey’s done on this subject, where it was found that several people write down the password and keep it somewhere next to the computer. Some of them think keeping the post-it note below the mouse pad is secure enough. You should never write down the password on a paper. If you want to carry your password along with you all the times, use a password manager tool that runs from USB stick and take that with you all the times.
  4. Don’t share with anyone. Anyone includes your friends and family. Probably you might have heard the phrase “Passwords are like underwear, don’t share with anybody”. We teach our kids several things in life. Teaching them about online safety and not sharing the password with anybody should be one of them.
  5. Never keep the same password for two different sites. It is very tempting to create one set of passwords for all your emails, another password for all the banking sites, another password for all the social networking sites etc. Avoid this temptation and keep unique passwords for all your accounts.
  6. Don’t type your password when someone is looking over your shoulder. This is especially very important if you type slowly and search for the letters in the keyboard and type with one finger, as it is very easy for someone looking over your shoulder to figure out the password.
  7. Never send your password to anybody in an email. If you follow #3 mentioned above, this should not be an option. But the reason I’m specifically saying about this is because several hackers send emails as a support person and asking for your user name and password through email. Legitimate website or organization will never ask you for your user name and password either via email or over telephone.
  8. Change password immediately when they are compromised. Even if you have the slightest doubt that someone might have stolen your password, change it immediately. Don’t even waste a minute.
  9. Don’t use the “Remember password” option on the browser without setting the Master Password. Don’t use this feature of the browser to store your username and passwords without enabling the “Master Password” option. If you don’t set master password on the firefox browser, anybody who uses your firefox browser can see all the passwords that are stored in the firefox browser in plain text. Also, be very careful with this option and say ‘Not Now’ in the remember password pop-up, when you are using a system that doesn’t belong to you.
  10. Don’t type your password on a computer that does not belong to you. If possible, don’t use someone else computer that you don’t trust to login to any website, especially to very sensitive website such as banking. It is a very common practice for hackers to use key loggers that will log all the key strokes on a system, which will capture everything you type including the passwords.

From : TheGeekStuff

10 Ultimate Rules for Effective System Administration

The following 10 items are guidelines more than rules, that I have learned over the years doing intensive work on the IT infrastructure. These guidelines are mostly common sense and can be helpful for anybody who administers an IT system, including Linux/Windows Administrator, Network Administrator and DBA.

1. Keep it simple.

In technology environment, keeping things simple takes lot more effort and maturity than keeping it complex. As an administrator, when it comes to implementing a particular functionality or solving a problem, there are always several options available. It is best to learn all the available options, including the complex ones to understand how it works. However while implementing, try to keep it as simple as possible. The option you choose should be simple and have the following characteristics:

  • Easy to maintain in a long run
  • Does not add additional over head to the system
  • Solves the primary business/technical problem

Whenever you are in a dilemma of whether to choose a bleeding edge technology or proven technology that has been around for a while, always go with the proven technology for production implementation.

Everything should be made as simple as possible, but not simpler. – Albert Einstein

Read the rest of this entry »

Linux exercises for examination – Updated !!

Day la 9 bai ma minh co de bai … con cac bai con lai…hoac co cho nao ko hieu thi cac ban cu comment thac mac cho minh hoac wa YM! billyduc1987 …. Chuc moi nguoi thi tot ^^

Vi co 10 bai nhung bai 4 va bai 9 bi trung nen mat 1 bai…ai co bai do thi send cho D, bai 8 va bai 10 phai chay = quyen root, 2 bai nay billy chua chay thu lai trong F9 vi may moi cai lai…mac cong xoa user…ban nao co may ao thi chay thu lai … va bao loi cho D biet de fix loi…giai thuat thi OK do !

1. Viết chương trình in ra n dòng như sau: (n truyền tham số; n=1..30).
VD: n=5
11111
22222
33333
44444
55555

Cần phải kiễm tra:
+ Nếu n < 1 thì báo lỗi và thoát chương trình.
+ Nếu n > 30 thì báo lỗi và thoát chương trình.

echo -n “Nhap n = “
read n
if [ $n -le 1 -o $n -ge 30 ]
then
echo “Error give n between (1 – 30)”
exit 1
else
for ((i=1;i<=n;i++))
do
for ((j=1;j<=n;j++))
do
echo -n “$i “
done
echo
done
fi

2. Hãy viết chương trình xuất ra trắng đen như bàn cờ quốc tế n x n (n nhập từ bàn phím)
Phần kiễm tra:
Không cần phải kiễm tra n nhập vào như thế nào.
VD: n được nhập = 9

echo -n “Nhap n = “
read n
echo
t=0
for((i=1;i<n;i++))
do
t=`expr $i % 2`
if [ $t -eq 1 ]
then
for((j=1;j<n;j++))
do
echo -e -n “33[47m "
echo -e -n "33[40m "
done
echo -e "33[0m "
else
for((j=1;j<n;j++))
do
echo -e -n "33[40m "
echo -e -n "33[47m "
done
echo -e "33[0m "
fi
done
echo -e "33[0m "

3. Hãy cho biết giá trị của n! (n truyền từ tham số n >= 0) VD:
Nếu n=0 ==> n!=1
Nếu n=1 ==> n!=1
Nếu n=2 ==> n!=2
Nếu n=3 ==> n!=6
Nếu n=4 ==> n!=24
...

Cần phải kiễm tra:
+ Nếu không có tham số nào thì báo lỗi và thoát chương trình.
+ Nếu n < 0 thì báo lỗi và thoát chương trình.

echo -n "Nhap n giai thua = "
read n
if [ $n -le 1 ]
then
echo “n! = 1″
else
gt=1
i=1
while [ $i -le $n ]
do
gt=`expr $gt \* $i`
i=`expr $i + 1`
done
echo “n! = $gt”
fi

5. Sử dụng vòng lập for để in “1. Hello Word” n lần (n = 0..100) . với n truyền tham số.
Cần phải kiễm tra:
+ Nếu n < 0 thì báo lỗi và thoát chương trình.
+ Nếu n > 100 thì báo lỗi và thoát chương trình.

echo -n “Nhap n = “
read n
if [ $n -gt 100 -o $n -lt 0 ]
then
echo “Error…Give number between 0 -> 100 please”
exit 1
else
for ((i=1;i<=n;i++))
do
echo “$i. Hello World”
done
fi

6. Viết chương trình nhận vào 2 số a, b. Cho biết tích 2 số a * b là bao nhiêu.
Cần phải kiễm tra:
+ Nếu không đủ tham số thì báo lỗi và thoát chương trình.

if [ $# -lt 2 -o $# -gt 2 ]
then
echo “Error…give 2 number for multiply”
exit 1
else
echo “Tich $1 * $2 = `expr $1 \* $2`”
fi
7. Viết chương trình in bảng cửu chương n (n = 1..10) (n truyền từ tham số. Nếu không có tham số nào thì default n = 2 Nếu có tham số nhưng không thuộc từ 1..10 thì báo lỗi và thoát chương trình.
Cần phải kiễm tra:
+ Nếu n < 1 thì báo lỗi và thoát chương trình.
+ Nếu n > 10 thì báo lỗi và thoát chương trình.

if [ $# -eq 0 ]
then
n=2
elif [ $# -gt 1 ]
then
echo “Error…Give 1 number for multiply number”
exit 1
else
n=$1
fi
if [ $n -lt 1 -o $n -gt 10 ]
then
echo “hehe…we give u only 1 to 10″
exit 1
else
for((i=1;i<=10;i++))
do
echo “$n * $i = `expr $n \* $i`”
done
fi

8. Viết chương trình:
+ tạo các thư mục /g1
/g2
/g1/u1
/g1/u2

+ Tạo 2 user (user1 và user2) và 2 nhóm (g1 và g2).
+ Cấp quyền cho user1 toàn quyền trên /g1/u1
+ Home dir của user2 là /g1/u2
+ nhóm g2 toàn quyền trên thư mục /g2
+ Nhóm khác chỉ đọc trên thư mục /g2

Phần kiễm tra:
+ Không cần phải kiểm tra gì cả.

mkdir /home/g1
mkdir /home/g1/u1
mkdir /home/g2
mkdir /home/g1/u2
groupadd g1
groupadd g2
useradd -p hihi -d /home/g1/u1 -g g1 u1
chown u1 /home/g1/u1
useradd -p hehe -d /home/g1/u2 -g g1 u2
chgrp g2 /home/g2
chmod 744 /home/g2

chay bai 8 bang quyen root (su -) ./bai8
9. Viết chương trình nhận vào 1 tham số tên của bạn và 1 tham số đường dẫn tên file, rồi xuất ra màn hình nhiều dòng của file , mỗi dòng đều có cấu trúc: : nội dung dòng i”. Với được truyền từ tham số đầu tiên, tên file được truyền tiếp theo.
Cần phải kiễm tra:
+ Nếu thiếu 1 trong những tham số thì báo lỗi và thoát chương trình.
+ Nếu file không tồn tại báo lỗi và thoát chương trình.

if [ $# -lt 2 -o $# -gt 2 ]
then
echo “Error…Give $1 = yourname … give $2 = yourpath”
exit 1
else
name=$1
path=$2
while read linei
do
echo “$linei — $name — $path”
done < $path
fi

./bai9 yourname ./yourpath          ex: ./bai9 billyduc ./text.txt

text.txt

haha
hehe
hihi
hoho
huhu

10. Tạo n user va n/2 nhóm (n nhập từ bàn phím với n > 0 và chẳn): user1 user2 : nhom1; user3, user4: nhom 2.

Cần phải kiễm tra:
+ Nếu không có tham số nào thì báo lỗi và thoát chương trình.
+ Nếu n <= 0 thì báo lỗi và thoát chương trình.

if [ $# -ne 1 ]
then
echo “Error…Give 1 arguments : an even number”
exit 1
else
n=$1
t=`expr n % 2`
if [ $n -lt 1 -a $t -eq 1 ]
then
echo “Error..give even number”
exit 1
else
for((i=1;i<=t;i++))
do
groupadd g$i
j=`expr $i * 2 – 1`
useradd -g g$i u$j
j=`expr $i * 2`
useradd -g g$i u$j
done
done
fi
fi

The End !!
Updated – 2 bai cuoi
# sort danh sach gom nhieu truong khac nhau
if [ ! -e $1 ]
then
echo “File $1 not found”
exit 1
else
tr -s ‘\t’ ‘ ‘ /tmp/sortfile.$$#
while read dong
do
sotu=`echo $dong | wc -w`
holot=`echo $dong | cut -d : -f1`
ten=`echo $dong | cut -d : -f2`
misc=`echo $dong |cut -d : -f3-$sotu`
echo “$ten : $holot : $misc” >> /tmp/sortfile.$$
done
sort /tmp/sortfile.$$ |
while read i
do
sotu=`echo $i | wc -w`
ten=`echo $i | cut -d : -f1`
holot=`echo $i | cut -d : -f2`
misc=`echo $i |cut -d : -f3-$sotu`
echo “$holot $ten $misc”|tr -s ‘\t’ ‘ ‘>> ketquadiem
done
cat ketquadiem
#cat /tmp/sortfile.$$
fi

./baicuoi1 tendanhsach (chay file bai cuoi)

file danh sach
Nguyen Thi Kim : Phuong : TH0003 : 5
Tran Ngoc : Phuc : Th006 : 10
Nguyen Nhat : Quang : TH001 : 8
Nguyen Cong : Tam : TH0010 : 4
Phan Duc : Anh : TH0010 : 7

##################################
#baicuoi2
if [ $# -ne 2 ]
then
echo “Error..Give me one name to find mark and give mark list”
exit 1
else
grep -i $1 $2
fi
#####################################
./baicuoi2 tencantim danhsachcantim
ex: ./baicuoi2 billyduc ketqua.txt

Bravo ^^ Have anyquestion ?? Send it to me ^^