All posts by Michael Albert

Powershell: Some examples to use a MySQL Database

Hi,

sometimes it makes sence to write Data in a “real” Databasesystem instead of writing to a text- or xml file.

MySQL offers an native Windows .NET Connector to its Database. You can get it here.

Continue reading Powershell: Some examples to use a MySQL Database

Advertisment to support michlstechblog.info

Windows: Start a cmd.exe with system rights

Hi,

since Windows 2008 and Windows Vista it is no more possible to start a cmd.exe with system rights by using the (Task)Scheduler.
Continue reading Windows: Start a cmd.exe with system rights

Linux: Regenerate sshd host keys

Hi,

to generate sshd host keys, for example in case of cloning a virtual linux instance, do the following steps:

Checkout the key file names

root@debdevt:~# grep HostKey /etc/ssh/sshd_config
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key

Continue reading Linux: Regenerate sshd host keys

Windows: Remove a trigger from a service

Hi,

since Windows 7 respectively Windows 2008R2 it has the ability to start a windows service with a trigger. Some Services, like dnscache, starts or stops on demand.

A customer had the problem that sometimes, after an automatic restart (on idle) of the DNS Client Service, Windows won’t register its name in DNS anymore. A manual register with
C:\> ipconfig /registerdns
was necessary each time.
Continue reading Windows: Remove a trigger from a service

C#: Get description attribute from an enum value

Hi,

in this post I will show how to read a description attribute of an enum value by reflection. Let us assume we have a enum linke this

public enum MetalBands {
	[DescriptionAttribute("This is Metallica from CA")]
	Metallica,
	[DescriptionAttribute("This is Slayer from CA")]
	Slayer,
	[DescriptionAttribute("This is Overkill from NY")]
	Overkill
};

Continue reading C#: Get description attribute from an enum value