Tip: Add User and Generate Password Script
Hey guys!
Finally, I found time to update this lovely blog of mine. And luckily, I have one super cool simple script to share. This script will help a lot of system administrators in adding user accounts, very useful if you have about a hundred servers to login to and execute useradd and passwd again and again. This is a bash script, so no need to install packages and easy to understand.
Here goes the code.
#!/bin/bash
for USER in $(cat /tmp/users.txt) do
$(useradd $USER)
###Remove the space between 8 and )
PASSWORD=$(openssl rand -base64 8 )
###passwd [double dash] stdin
echo $PASSWORD | $(passwd –stdin $USER)
echo “$USER $PASSWORD” | mail -s “Your Account Info” $USER@company.com
sleep 3
done
Here is a quick summary of the code per line:
for USER in $(cat /tmp/users.txt) do
This line begins the for loop and /tmp/users.txt should be a text file containing the list of usernames to be added one username per line. The value of $USER
$(useradd $USER)
This line will begin by executing the command useradd. If the script fails at this point because the username already exists, it will proceed with changing the password of the username.
###Remove the space between 8 and )
###passwd [double dash] stdin
PASSWORD=$(openssl rand -base64 8 )
echo $PASSWORD | $(passwd --stdin $USER)
This line generates an 8-byte random password using openssl and pipes it to command passwd using –stdin option so the generated password can be passed.
echo "$USER $PASSWORD" | mail -s "Your Account Info" $USER@company.com
This line sends an email to the user containing the username and password, assuming that the email address is the same as the username.
This script can be further enhanced (imagination is limitless!) and feel free to share your script here.
Creative CPU Designs
I have tried PC Modding before but never really succeeded in doing so for a couple of reasons. One is I am too lazy to create something that is artistic, and the other reason is I am not that artistic. And besides, cool CPU designs are available at my favorite PC store anyway so I’ll just go ahead and buy one if I want to change my PC’s look.
Anyway, here are some of the coolest CPU designs that I found over at www.technoscrap.com. Feast your eyes over the coolest and weirdest designs:
Seagate Unveils 1TB Hard Disk Drive
It may seem a dream at first to have a whopping 1 Terabyte of disk storage for all your digital movie, picture and music files. And now the dream is over as Seagate, world’s top manufacturer of digital storage media, made available to consumers 1TB hard disk drive (HDD) at 72000rpm motor speed.
The HDD is made up of four platters and eight heads, making it 180GB worth of storage per square inch, industry’s highest when it comes areal density. But power consumption and noise level are still at par with the current drive models using 13w of power and 2.8bels in idle mode and 3.7bels in seek modes. The speed is also the same with the 1TB model since it uses 7200 revolutions per minute in its spin. The drive can cache 32MB of data and seek time averages at 8.5ms.
Current prices range from $180to $250 for SATA based on amazon.com prices.
Speak Up!
I have read somewhere, maybe watched it on television, that human ears are the first of the five senses that become active just as you wake up. It means you hear sounds around you first, before you feel the pillow, see the morning sunshine or smell the breakfast coffee.
But can you imagine life without sounds? I can’t. Music is part of my everyday life from the morning news to my MP3 while getting some work done up to my nightly habit of watching anime shows. That is why I equip my computer with 5.1 speaker system to make sure that I get the best sound out of anything that my computer plays.
Even our home entertainment system is equipped with branded sound system to make sure that every movie that we watch on the DVD player is as real as it can get. And contemporary computer speakers are easy to find. If you what Google is, then you are halfway there to finding the best set of speakers that you can find. A good sound system cannot replace what a cheap, poor speaker system so it is always good to invest in something that is worth your money.
Creative Labs Threatens Third Party Driver Modder
A post from Creative Labs Forums delivers a message from Phil O’Shaughnessy, Corporate Communications VP, to Daniel_K, an individual who modifies the sound card drivers of Creative to unlock functionalities that are not usually available for Windows Vista users.
Search PinoyTux
Subscribe to Email Feeds
Blog Lounge
Popular Posts
Recent Posts
Drop your Card Here
Recent Comments
- david portman
on Cebu Pacific Airlines is Evil! - kim chiu
on Cebu Pacific Airlines is Evil! - Alma
on Cebu Pacific Airlines is Evil! - AnnKatz
on Cebu Pacific Sucks - chinito
on Cebu Pacific Airlines is Evil!


















