brain dump far away from /dev/null

28Feb/150

Debian: change MAC address

Temporarily:

ifconfig eth0 down
ifconfig eth0 hw ether 00-11-22-33-44-AA
ifconfig eth0 up

Permanently:

vi /etc/network/interfaces

iface eth0 inet dhcp
  hwaddress ether 00-11-22-33-44-AA

 

Got an error?

SIOCSIFHWADDR: Operation not permitted

Make sure you're root.

20Jan/123

Get a list of all disconnected mailboxes in Exchange 2010

The following script cleans up all your Exchange databases (necessary to get a fresh list of all disconnected mailboxes) and creates an HTML and CSV file containing:

  • DisplayName of the mailbox
  • ServerName, on which the mailbox is stored
  • DatabaseName, in which the mailbox is stored
  • DisconnectDate, when the mailbox was disconnected from the user account (the HTML output is also sorted by this column)
  • DisconnectReason, guess it: why the mailbox was disconnected (i.e. because the user account was disabled)

Just copy&paste these lines into a powershell script:

# ExportDisconnectedMailboxes.ps1
#
# This script runs "Clean-MailboxDatabase" on all
# available databases and creates an HTML report
# of all disconnected mailboxes.
#
# Revision History
# 2012-01-20 Christoph Holas    Initial Version
 
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
 
Get-MailboxDatabase | Clean-MailboxDatabase
 
$MailboxDatabases = Get-MailboxDatabase
 
$DiscMailboxes = $MailboxDatabases | ForEach-Object { Get-MailboxStatistics -Database $_.Name | Where-Object {$_.DisconnectDate -ne $null}} | select DisplayName,ServerName,DatabaseName,DisconnectDate,DisconnectReason | sort DisconnectDate
 
$a = "<style>"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 3px;border-style: solid;border-color: black;}"
$a = $a + "TD{border-width: 1px;padding: 3px;border-style: solid;border-color: black;}"
$a = $a + "</style>"
 
$DiscMailboxes | ConvertTo-Csv | Out-File DisconnectedMailboxes.csv
$DiscMailboxes | ConvertTo-Html -head $a | Out-File DisconnectedMailboxes.html

Don't hesitate to write a comment if this script was (not) helpful to you. 🙂

19Jan/121

How to determine your current logon server/domain controller on Windows 7/8/8.1

If you ever need to find your current logon server on Windows 7 (don't know by heart if it also works on XP), you can just run the following command on your command line:

1
echo %logonserver:*\\=%

UPDATE 2015-Jan-12: also works on Windows 8/8.1

%logonserver% is a local variable with a value that looks like \\domaincontroller. With :*\\= you can strip the leading backslashes and get only the hostname as a result. I have no clue about the value of the variable if you start your machine without a network connection or a connection to a domain controller. It's just a quick&dirty solution and in my case it does the job.

19Jan/120

Compatible WLAN adapters for WD TV Live HD and price comparison

A list of compatible devices for the awesome Western Digital TV HD Live Media player can be found here in the Knowledge Base of Western Digital.

To compare the prices of (most) of these wireless network adapters I have created a wishlist at the price comparision website Geizhals: http://geizhals.at/eu/?cat=WL-212383

Last update of this wishlist: Jan 19th, 2012.

Oh, and if you're interested in buying the media player itself: http://geizhals.at/458684

 

18Jan/120

Exchange 2010: count messages in local mail queue

Hi there. Here's just a little script before I leave the office for today. If you want to know how many email messages are in your local mail queue (no matter which Exchange role: Mailbox, CAS, HubTransport or Edge) just run the following command in your Exchange PowerShell:

1
Get-Queue | where {$_.MessageCount -ne "0"} | select messagecount | Measure-Object -Sum MessageCount | Select-Object -ExpandProperty Count

I have optimized the output to be easily interpreted by our monitoring system.

13Jan/122

How to enable a mailbox or distribution group to receive mail from external senders

In Exchange 2010 you can permit or deny that unauthenticated users (ie senders outside of the Exchange organisation) send mails to a mailbox or distribution group. This setting can be set either in the EMS (PowerShell) or in EMC (console).

4Oct/082

Visuals

Q: How many inhabitants does the Netherlands have per km2?

Bilder (und Videos) sagen mehr als 1000 Worte. Heute gibts einmal nur (bewegte) Bilder.

25Sep/080

Gallery2: changing language has no effect

I recently ran into the problem with Gallery2 2.2.6. Changing the language of Gallery2 to German in the settings didn't work; everything was still in English.
"gettext" was installed correctly (as suggested by the Gallery2 wiki).

I also looked through the following sites but there was no solution to my problem.

http://gallery.menalto.com/node/48522
http://gallery.menalto.com/node/49516
http://codex.gallery2.org/Gallery2:Language_Settings

In gallery2/modules/core/locale/de/LC_MESSAGES/modules_core.mo says:

X-Poedit-Country: GERMANY

The following command shows which locales are installed on the system:

$ locale -a
C
POSIX
de_AT
de_AT.iso88591
de_AT.iso885915@euro
de_AT.utf8
de_AT@euro
en_US
en_US.iso88591
en_US.iso885915
en_US.utf8

As you can see de_AT (German Austria) is installed but de_DE (German Germany) is not.
I ran "dpkg-reconfigure locales" as root and added the following locales:

de_DE.UTF-8
de_DE.ISO-8859-15@euro

After restarting Apache with "apache2ctl restart" Gallery2 was finally in German. 🙂

12Sep/081

Der Bikeshop is net bled… heast!

Heut is a richtiger Knotztag. In der Nachts hats zum Regnen angfangen und bis jetzt nimma richtig aufghört. Um halb 8 bin ich aufgstandn und hab mir dacht, wenns so weiterwaschlt, bleib ich heut daheim. Um 10 Uhr wars dann statt richtig grossen Regentropfen nurmehr ein schwaches Nieseln. Diese Chance hab ich genutzt, mich aufs Radl ghaut und gstrampelt, was die Pedale hergeben. 4 Minuten Radlzeit, aber knapp am Rekord 3m42s) vorbei.

Was mir unterwegs aufgfalln is, dass verdammt viele Glasscherben auf den Radwegen liegen. Vorallem in der Nähe von Radlgschäften. Net blöd von denen. Fahrst Dir a Glasscherbe (die dem Radlgschäft ghört) in den Reifen kannsts glei richten lassen; und des Radlgschäft hat natürlich nur gute Preise... eh kloa, hot jo Mitleid mit dem armen Radler.

Filed under: Internship Mexx 1 Comment