Archive for February, 2012

Batch check if a Program or Service is running

tasklist /FI "IMAGENAME eq %PROGNAME%" 2>NUL | find /I /N "%PROGNAME%">NUL
if "%ERRORLEVEL%"=="0" echo Programm is running
if "%ERRORLEVEL%"=="1" echo Programm is not running

%PROGNAME% needs to be replaced with your program name.

No Comments »

admin on February 18th 2012 in IT, Windows

sendEmail from Bash over GMail

The syntax is following:
sendEmail -v –f $EMAIL_FROM -s smtp.gmail.com:587 -xu p$USERNAME –xp $PASSWORD –t $EMAIL_TO -o tls=yes –u $SUBJECT –m $MESSAGE

But after I tried it I got following message:
ERROR => No TLS support!  SendEmail can’t load required libraries. (try installing Net::SSLeay and IO::Socket::SSL

This fixed the problem:
apt-get install libio-socket-ssl-perl libnet-ssleay-perl

No Comments »

admin on February 10th 2012 in Linux

Color LInux Prompt

vi ~/.bashrc

To color it red change PS1 to:
export PS1=’\[\e[1;31m\][\u@\h \W]\$\[\e[0m\] ‘

After that you need to save it and reload it with:
source ~/.bashrc

No Comments »

admin on February 8th 2012 in IT, Linux

Quick and Dirty MS Database Analysis

This method queries all tables in a database and it displays the top 10 rows.

Get all tables with the following query:
SELECT name FROM ssysobjects WHERE type = ‘u’;

Copy&Paste it into Excel A Column and put following Formula into B Column for each row:
="SELECT TOP 10 * FROM " & A1 &";"

Result will be something like this:
SELECT TOP 10 * FROM COMPANY; SELECT TOP 10 * FROM PEOPLE; SELECT TOP 10 * FROM BILLS;

Run this query in Microsoft Management Studio an analyse the result.

No Comments »

admin on February 4th 2012 in MSSQL




Check out new movies online website. Download and buy movies now.
1