How to install NTP on Linux Debian

#apt-get install ntp

Edit the config file to adjust it:
#vi  /etc/ntp.conf

Restart the service to make it run:
#service ntp restart

Manual Sync:
#ntpd -q –g

To overwrite the HW Clock:
#hwclock –systohc

admin on June 29th 2012 in IT, Linux

No Comments »

Installation of OwnCloud on Debian

Well most people use Dropbox or iCloud to sync their data. It works very good but I don’t like the idea to have my data stored on some other server. I like to have more control and this is the main reason why I give OwnCloud a shot.

Installation
I installed it on debian and the setup instructions from the homepage did not work for me. When I tried to install it I got following message:
E: Unable to locate package php-xml
E: Unable to locate package php-mbstring
E: Unable to locate package php5-zip

This solution worked for me:
#apt-get update
#apt-get upgrade

#apt-get install apache2 php5 php5-json php5-gd php5-sqlite curl libcurl3 libcurl3-dev php5-curl php5-common php-xml-parser
#apt-get install sqlite

Important: Of course replace the links whit the newest ones on the homepage: http://owncloud.org/

#wget http://download.owncloud.org/releases/owncloud-4.0.4.tar.bz2
#tar -xjf owncloud-4.0.4.tar.bz2
#cp -r owncloud /var/www
#chown -R www-data:www-data /var/www

#service apache2 restart

Point your browser to it and login with:
admin admin

After those steps I installed the client on my Windows PC and recognized that it didn’t sync. The problem was that the time on the client and and on the server was not the same. So make sure it is!

admin on June 29th 2012 in Internet, IT, Linux

No Comments »

HOw to use md5sum

It creates a 128 bit checksum which is unique. So if two files are not identical they won’t have the same md5 checksum. You can use it to check if the file which you have download has not been manipulated or is corrupted.

Output of one file:
# md5sum sample.txt
d41d8cd98f00b204e9800998ecf8427e  sample.txt

Output of multiple files:
# md5sum *.txt
5aa6788f9355e26bd8aef7303dda97fe  sample2.txt
d41d8cd98f00b204e9800998ecf8427e  sample.txt

You can create your own md5 file and verify it afterwards:
# md5sum sample.txt > verify.md5
# md5sum –c verify.md5

admin on June 29th 2012 in IT, Linux

No Comments »

Google Picture Search

Well many people don’t know about this function. Let’s say you found a really nice picture but you don’t know from who it is.

Just go to:
1. http://www.google.com/imghp
2. Upload the picture
3. Do a Google Picture search and you might find out

admin on June 11th 2012 in IT, Search Engine

No Comments »

Error 2738. Could not access VBScript run time for custom action.

Today i tried to install VMWare vSphere PowerCLI and got the vbscript error message.

Follow this steps to solve the problem:

1. Create a backup
2. Delete following registry entries:

Win32 Bit
HKCU\SOFTWARE\Classes\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}
HKCU\SOFTWARE\Classes\CLSID\{F414C260-6AC0-11CF-B6D1-00AA00BBBB58}

Win64 Bit
HKCU\SOFTWARE\Classes\Wow6432Node\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}
HKCU\SOFTWARE\Classes\Wow6432Node\CLSID\{F414C260-6AC0-11CF-B6D1-00AA00BBBB58}

3. Run CMD as an Administrator
4. regsvr32 vbscript.dll
5. regsvr32 jscript.dll

admin on June 4th 2012 in IT, PowerShell, Windows

No Comments »

Powershell

Powershell is awesome.

Here a collection of some snippets:

Check who is accessing a file on a server:
net file | where {$_ –match “$filename”}

More:
Get-Service | Sort-Object -Descending Status | ForEach{if($_.Status
-eq “Running”){Write-Host $_.Name -ForegroundColor green} else {Write-Host $_.Na
me -ForegroundColor red}}

Get-Service | ConvertTo-Html -Property Name, Status | ForEach {if($_
-like “*<td>Running</td>*”) {$_ -replace “<tr>”, “<tr bgcolor=green>”} else {$_
-replace “<tr>”, “<tr bgcolor=red>”}} > .\get-service.html

Get-PSDrive | Sort-Object Used -Descendind

New-PSDrive -name FK -psprovider FileSystem -root C:\Temp\Powershell\Files

Set-Location FK:
Get-ChildItem * -Exclude *.tmp, *.temp | Select-Object name, length | Sort-Object Length, Name -Descending

Get-Alias | Sort-Object

Get-Service | Group-Object Status
Get-Service | Get-Member
Get-Service | where{$_.status -eq “stopped”}

Get-ChildItem | Group-Object Extension | Sort-Object Count -Descending
Get-ChildItem | Measure-Object length -average -sum -maximum -minimum
Get-ChildItem | where-object{$_.length -gt 2MB}
Get-ChildItem | where {$_.PSIsContainer}

$a=Get-ChildItem | Select-Object Extension | Sort-Object Extension -unique
$a | ForEach {“.\Neu”+$_.Extension} | ForEach {NewItem $_ -type directory}

$a=Get-ChildItem | where {$_.PsIsContainer -eq -0}
$a | foreach{Copy-Item $_.FullName (“.\Neu” + $_.Extension + “\” + $_.Name)}

Get-ChildItem | foreach{$_.IsReadOnly = -1}

Get-ADUser -Filter *
Get-Command *user*

admin on May 16th 2012 in PowerShell

No Comments »

Upgrade Problem with nagios from lenny to Squeeze in debian

Because lenny is no longer supported I had to upgrade our nagios monitor server from lenny to squeeze. After the upgrade the check_snmp commands timed out. After some research I found out because of a licensing issues snmpd with the mibs are no longer installed by default.

1. Edit Source List
First I had to change the /etc/apt/source.list and add “contrib non-free”.

It should look similar to this:
deb http://ftp.ch.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.ch.debian.org/debian/ squeeze main contrib non-free

2. Install SNMPD with the MIB List
#apt-get install snmpd
#apt-get install snmp-mibs-downloader

3. Download Mibs
#/usr/bin/download-mibs

4. Restart SNMPD
I’m not sure if this step is necessary. I actually even restarted the whole server.
#/etc/init.d/snmpd restart

admin on April 26th 2012 in IT, Linux

No Comments »

How to Shutdown Exchange 2007 Services

net stop msexchangeadtopology /y
net stop msftesql-exchange /y
net stop msexchangeis /y
net stop msexchangesa /y
net stop iisadmin /y

admin on April 2nd 2012 in Exchange Server, IT

No Comments »

Find old Computers/users in Active Directory

Easiest way is to use following query on your Domain Controller to find all computers which were inactive for 4 weeks:
dsquery computer –inactive 4

The same you could for users:
dsquery users – inactive 4

admin on March 22nd 2012 in Windows, Windows Server

No Comments »

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.

admin on February 18th 2012 in IT, Windows

No Comments »




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