Generating report via CPUZ and sending it to your email id

Most of the time we need our client’s hardware information. CPU-Z is a freeware that gathers information on some of the main devices of your system.

CPU-Z is capable of generating html report. Client can send the report as an attachment to us. To make this task simpler, we are using script to automate the same. Script will generate cpu-z report in html format at it will ask user for their email server credential to send the report via email.

Download CPU-Z
CPU-Z

Download sendEmail for windows
sendEmail

Running the program
Create an “inv” folder in c:
Extract CPU-Z and sendEmail & copy cpuz.exe, cpuz.ini, sendEmail.exe to c:\inv
Your folder structure should be

c:\inv--|
        --------|cpuz.exe
        --------|cpuz.ini
        --------|SendEmail.exe
        --------|report.bat

We need to modify cpuz.ini as per our need,

[CPU-Z]
[CPU-Z]
TextFontName=Verdana
TextFontSize=13
TextFontColor=000060
LabelFontName=Verdana
LabelFontSize=13
PCI=0
MaxPCIBus=256
DMI=1
Sensor=0
SMBus=0
Display=1
ShowDutyCycles=0

Now we have to create bat file for sending CPU-Z’s report
report.bat

@echo off
cd c:\inv\
del report.htm
echo "Genrating cpuz info"
cpuz.exe --html=report
cd \
cd c:\inv
SET /P from=[Enter your email id]
SET /P to=[Enter the person email id to whom you want to send email]
SET /P sub=[Enter subject]
SET /P smtp=[Enter your smtp server ip]
SET /P port=[Enter your smtp server port]
SET /P username=[Enter username for smtp server]
SET /P password=[Enter smtp server password]
sendemail.exe -f %from% -t %to% -u %sub% -s %smtp%:%port% -m "inv report" -a report.htm -xu %username% -xp %password% -l smtp.log -o message-content-type=auto

Bat file will generate a report of CPU-Z & send the same on user mention email id. It will ask user for his email id, sender, subject, smtp server address, credentials for smtp server. It will also generate a log file as c:\inv\smtp.log
You can hard code your email id, smtp server credentials.

Managing Blackberry from linux

Linux users who also use a BlackBerry now have an option for managing their BlackBerry directly from Linux.
Barry is an Open Source application that will provide synchronization, backup, restore and program management for BlackBerry devices. Barry is primarily developed on Linux, but is intended as a cross platform library and application set, targeting Linux, BSD, 32/64bit, and big/little endian systems.
The Barry project began in October 2005 and has steadily added features and polish to Blackberry usage on Linux ever since. We were the first to reverse engineer the battery charging handshake via USB.
Today, it is possible to:

  • Charge your Blackberry’s battery from your USB port
  • Parse the following database records: Address Book, Email, Calendar, Service Book, Memos, Tasks, PIN Messages, Saved Email, Folders, Phone Call Logs, and SMS messages
  • Build the following database records: Address Book, Calendar, Memos, Tasks
  • Export Address Book contacts in text or LDAP LDIF format
  • Make full data backups and restores of your device using a GUI
  • Synchronize contacts and calendar items using the OpenSync framework
  • Use the Blackberry as a modem
  • Install and manage Java applications from the command line
  • Take screenshots of your device
  • Set the device time from the command line

For more features you can check their website.

To install barry on fedora run following as a root user

yum install -y barry

To install barry on ubuntu run following as a root user

apt-get install barry

Attach your blackberry device and run barry
[vidyadhar@vidyadhar ~]$ barrybackup

It will ask you to enter device name for your blackberry device

If you have set device password for blackberry, you have to enter the same

For example to take address book backup, click on config button, choose Device database backup list configure, select address book & address book all. Then on the main screen click on backup. By default barry will generate backup in .barry folder in your home directory.

Installing Windows 7 from Hard Disk

Another way of installing windows 7 is installing it from the Hard Disk itself.
Requirements:
Hiren Boot CD 10.4
Windows 7 CD
Usb Stick

Create Hiren Boot usb by following the guide on Hiren’s Website

1. Insert Hiren Boot USB in your USB Port and boot your machine from USB
2. Choose “Dos BootCD” Option

3. Further choose “Partition Tools”, “Smart FDISK” and press enter.

4. In Smart FDISK Window press F2 for creating Primary Partition. Size is 15Gb, partition type fat32, click on OK.

5. For marking the partition as active press Alt+P, then Alt+A to mark the partion active.

6. To save the change press Alt+P, then Alt+S
7. To Exit press Alt+X. It will ask you to restart your machine. Choose OK, Again boot your machine from USB and select “Mini Windows XP” and press enter.

8. In Mini Windows XP mode Right click on My Computer, select Manage. Right Click on the newly created partition and click on format option. Choose File system as NTFS select quick format option.

9. Copy “boot sources bootmgr” from windows 7 disk to your newly formatted C partition

10. Start Command prompt from the desktop and run the following commands:

c:\
cd boot
bootsect /nt60 SYS

11. Just restart your machine by clicking start button.
12. Restart your machine by selecting hard disk as a first boot device and it will start with Windows 7 setup.

Password Protecting USB Pen Drive

One of my user needs to create a password protected folder in its pen drive. This is very simple but one more special requirement he asked for, if he insert that pen drive in any another pc he can able to see that folder over there without any software installation. This is quite tricky requirement. I found a tool for it i.e. Rohos Mini Drive. It’s a freeware with some limitations.

Rohos Mini Drive creates hidden and encrypted partition on the USB flash drive memory. You work with the files on the hidden partition without opening a special program. Those who have megabytes of sensitive files on the USB drive and seriously concerned with a data security, cannot imagine their USB stick without the hidden volume that is created using this tool.

Download the program from here. Install it and run it.

After installation the Rohos Mini Drive, insert your USB pen drive to the computer and run the Rohos Mini Drive application. Click on Setup USB Key

Insert a password.

It will create a partition namely K: with 297mb space. You can customize the partition size by clicking Change button.

Just you have to add file in this newly created partition, when you done just eject that partion as well as the pen drive.
For testing purpose you can insert this pen drive to any another PC. There it will show you one roho_mini_pendrive icon. Double click it and insert your password that’s it now you can access your password protected partition on that computer.
Source

Cacti on CentOS

Cacti is a complete network graphing solution designed to harness the power of RRDTool’s data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices.

We have to install following packages on our machine.

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
 
yum install -y mysql-server mysql php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-snmp php-pear-Net-SMTP php-mysql httpd net-snmp-utils php-snmp net-snmp-libs

Configuring the MySQL server

service mysqld start

Assign root password for MySQL

mysqladmin -u root password NEW_PASSWORD

Creating cacti database

mysql -u root -p
enter you mysql root password
mysql>create database cacti;

Creating user for cacti and assign a new password as cacti

mysql>GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'cacti';
mysql>FLUSH privileges;
mysql>exit;

Configuring snmp

Just copy my snmpd.conf file on your server, to do it

cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.original
rm -rf /etc/snmp/snmpd.conf

Copy my snmpd.file from here.

Just change the contact & network as per your requirements.

Run the following command to know wether the snmp is working or not

service snmpd restart
snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex

Sample output

IP-MIB::ipAdEntIfIndex.192.168.213.128 = INTEGER: 2
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1

Installing cacti

yum -y install cacti

Installing cacti tables
(You need to type cacti user password in my case it is cacti)

mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.7d/cacti.sql

Configuring cacti

vi /etc/cacti/db.php
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti";
$database_port = "3306";

Save the file and exit

Configuring webserver

vi /etc/httpd/conf.d/cacti.conf
#
# Cacti: An rrd based graphing tool
#
Alias /cacti    /usr/share/cacti
 
 
        Order Deny,Allow
        Allow from all

Save and exit.

Restarting webserver

service httpd restart

Cronjob for cacti

Open /etc/cron.d/cacti file and uncomment the first line.

Running cacti installer

Now cacti is ready to install. Copy the following link on your webbrowser:
http://you_server_ip/cacti/

Just follow on screen instructions. The default username and password for cacti is admin / admin. Upon first login, you will be force to change the default password.

Page 8 of 9« First...«456789»
rss twitter facbook

Categories

Archives