Linux, CentOS, Redhat G++ compiler and rand() / random function

November 18th, 2014

If you are using the G++ compiler in Linux, CentOS, or Redhat there are a couple of steps to adding a random number generator to any project.

  1. Include the precompile library: #include <stdlib.h>
  2. Use the function and add seeding: first_number = rand()%6 +1);

The basic function in C++ for the G++ compiler in Linux looks like this:

#include <iostream>

#include <stdlib.h>

int main()

{

int first_number = rand()%6 +1;

std::cout << first_number;

return (0);

}

Starting a console application in Microsoft Visual C++ 2010 Express

November 11th, 2014

Starting a Microsoft Visual C++ Studio Console Application

  1. Open Microsoft Visual C++ 2010 Express
  2. In the menu go to File – New – Project
  3. Click on Visual C++ and highlight Win32 Console Application
  4. Give the new project a name, default directory, and Solution Name
  5. Click OK and another GUI will pop-up
  6. On the Welcome to the Win32 Application Wizard click Next >
  7. On the Application Settings remove the check box from Precompiled Header and check Empty
  8. Click Finish
  9. When the new project opens right click on Source Files
  10. Go to AddNew Item…
  11. When the wizard opens highlight C++ File (.cpp) and give it the name of main.cpp
  12. Click Add
  13. Enter the following in the main.cpp file

          #include <iostream>

           int main()

{

               return 0;

}

Place your code after the first curly brace and before the return 0; to get started. Happy coding.

 

Windows 7 and 8 shutdown batch file to save electricity

November 2nd, 2014

Hi Everyone,

If you are like me you work on your computer or use it to play games in the evening to alleviate stress. However, once you are finished using the computer you forget to turn if off. Now, for many this does not seem to be a problem but consider other aspects of leaving a computer running.

  1. Someone could gain access to a laptop webcam and see that no one is home or spy on people in the room.
  2. If you accidentally get a virus the PC which can turn it into a zombie or join it to a botnet. So while you are away your PC is working in the background.
  3. Some people just never turn the PC or laptop off because he or she feels the power saving options are sufficient.
  4. The amount that all the electronic devices are costing you per month in your electric bill.

Let’s examine the fourth possibility because it happened to me. My average electric bill when my kids were at home was $125 per month. When they left for college the electric bill dropped to $95 per month. When I deployed the shutdown script on my PC the electric bill dropped to $69 per month. Saving over $50 a month (you could save more) on your electric bill seems like a pretty good idea to me.

Read the rest of this entry »

Video for setting up LPD print services for Windows to share a printer on the network

November 1st, 2014

Here is a nice video showing how to set up LPD print services in Windows so you can share a non-networkable printer on the network.

http://youtu.be/TmksGlGgz1Q

 

Majority of email being delivered to customer except one or two

October 10th, 2014

This is a very common issue if you are sending email with multiple invoice or statement attachments.

If you are using IIS 6 Smart Host to relay email:

  • Open Internet Information Services (IIS) 6 Manager
  • Expand the default domain
  • Right click on the [SMTP Virtual Server #1] and select properties
  • Click on the messages tab in increase the following:

Limit message size to (KB): default is 2048 so increase it to 20480

Limit session size to (KB): default is 10340 increase it to at least the size of the Limit message size.

  •  Click OK and resend the email.

If you are sending directly to your SMTP provider check with them to see what the message size limits are because many will set that to 2 MB like Google Applications. The reason for the limit is so the SMTP server does not get bogged down trying to scan the email with spam filter and processing large requests.

Hope this helps.

Backup Exec: Buex: Failed – Physical Volume Library Drive not available.Backup Failed, errorCode=-536837876

August 25th, 2014

They have been experiencing electrical storms over the past couple of weeks. When I went into Backup Exec the tape drive was offline. I brought the tape drive back online and ran a tape erase to test and it was successful. Sometime just restarting all the Backup Exec services works just as well.

Disaster Recovery – What is a disaster?

August 14th, 2014

An information technology disaster can be defined as any event or series of events which halt the production capability of any information system.  An organization deletes an Excel spreadsheet being used to keep track of sales or inventory is a disaster. Another organization has a fire in the data center and due to fire suppression techniques the server hardware is damaged is a disaster. Regardless of the physical magnitude, it a system’s production capability is lost the organization has suffered a disaster.

Every organization needs to define information technology disasters within each information technology system in use. Evaluations can take the form of hiring a Systems Analyst or even brainstorming. Identify the systems that if lost, will result in halting production capabilities within the organization. Refrain from passing judgment at this time since the emphasis is on identification and not change.

Read the rest of this entry »

Creating groups for email lists within Google Applications

March 30th, 2014

Creating groups in Google Applications can create a group for documentation collaboration and email. Creating a group for email means that the members will not be visible to the recipients

  • Log into your Google Applications account using an Administrator account.
  • With the new Dashboard find the Groups – “Manage groups of users and mailing lists”
  • Click on the Groups section
  • Click on the shortcut located towards the upper right hand corner of the page to create a new group.
  • On the Create new group page enter the following:
  1. Name of the group – A name to call the group.
  2. Group email address – Email address that the group will use. This cannot be an email address that already exists within the Google Applications domain.
  3. Access Level – I generally keep this at the team level so that users can send email to the group but cannot see the members.
  4. Click Create
  • Once the group is created you will be redirected to the group’s application page.
  • To add users to the group click on Manage users in (name of group)
  • In the Add new members section entry the email addresses you want in the group. The email address does not have to be a member of the domain.
  • Once you have added the members press the Add button.
  • NOTE: At any time you can add all members of the domain to the group. This is very important if you are considering adding an email group for all employees or students if the domain is for a school.
  • Once the users have been added you can exit the group and test within an email client by sending email to the group email address.
  • You can also add other groups to the new group by adding the group email address to the newly created group.
  • Restrict Ability to Send Email to the Group – You can restrict the ability to send email to the group by setting the owner as the only one who can send email. What that does is restrict the ability to “Reply to” and for unauthorized personnel from using the group email address to spam the members of the group.  This can be set up by clicking on the new group – Role and permissionsCustom and removing the check mark from all by the Owner group. Click Save changes

Hope you enjoyed this brief overview of creating groups in Google Application. If you have any questions please let me know and I will be happy to answer them.

Final error: 0xe00084ca – The data being read from the media is inconsistent.

January 3rd, 2014

In Backup Exec will at time have issues with tape drives. Data inconsistency can be due to a couple of reasons:

  1. Bad media.
  2. Bad tape drive Read the rest of this entry »

The consistency check of the snapshot for the Microsoft Exchange transaction log Logs has failed. You should check for possible data corruption in the transaction log that is online.

January 3rd, 2014

This problem is related to Backup Exec’s GRT (Granular Recovery Technology) having issue with an Exchange log file. The best method to resolve the issue is to disable GRT within the backup job. Let the backup run and check the logs again after the backup job has run. You should see that the bad log files have been removed and the only log files left are those that were not committed to the Exchange mailbox database.

Read the rest of this entry »