fbpx

Enable Internal SMTP Relay Exchange 2010

Open up the Exchange Management Console, go down to Server Configuration, select Hub Transport.

Click New Receive Connector fill out all the important name values and network values.

Create NEW RX

Double check your work,

Ensure that Anonymous users has a check box:

Make Anonymous

Ensure that only your local network has access to the Exchange Server.

new recieve connector

Fix Software RAID Windows 2k3

If you’ve intentionally – or unintentionally lost your primary drive in Windows 2003 Software RAID, here’s how you’d get it back.

Load up the 2k3 Install disk

Press “r” for recovery mode

Select your installation

Enter your password

chkdsk /p

bootcfg /rebuild

VMware image customization is in progress at every reboot

VMware image customization is in progress … at every reboot

When rebooting a virtual machine (server 2008 R2 x64 in this example) in vSphere 5 you see the following:

loading:

loading

followed by:

in-progress

To resolve this open regedit and browse to HKLM, System, CurrentControlSet, Control, Session Manager:

session-manager

Open the BootExecute key:

bootexecute

Change the BootExecute key from this:

before

to this:

after

Reboot.

Adding Disk to Centos LVM

While you can just create a pv out of raw block device I normally try to avoid it as it can cause confusion as to what the block device is being used for. It may also break some of the auto discover routines that LVM can use if it’s missing it’s configuration files.

Here’s an example of using parted to create a GPT with 1 partition that is the whole drive and set the partition flag to be lvm. The mkpart requires that you specify a file system but it doesn’t create the file system. Seems to be a long standing bug in parted. Also the start offset of 1M is to ensure that you get proper alignment.

parted /dev/sdb
mklabel GPT
mkpart primary ext2 1M 100%
set 1 lvm on
quit
pvcreate /dev/sdb1
pvdisplay
vgcreate vg_*name* /dev/sdb1 /dev/sdc1 /dev/sdd1
vgdisplay
lvcreate –extents 100%FREE -n lv_*name* vg_*name*
lvdisplay
mkfs.xfs -f /dev/mapper/vg_*name*-lv_*name*
df -ah

Putty Timeout After Idle Time

Check if your system is setting the environment variable TMOUT. To check this you can just do:

env | grep TMOUT

or

echo $TMOUT

If it is set, you could change it or unset it. To change the value:

export TMOUT=3600

Where the number is the number of seconds until you get logged out. Otherwise unset it to turn off the feature:

unset TMOUT

Note, it may be that your system administrator has set this for security reasons. So if you are not the system administrator you may want to check this before changing anything yourself.

Nagios Password Change on Windows Boxes

In the NSC*.ini file you will find a password parameter and you need to put your SNMP community string. Mine seemed to need it here.

NSC*.ini excerpt

; ;# PASSWORD ; This is the password (-s) that is required to access NSClient remotely. If you leave this blank everyone will be able to access the daemon remotly. password=public ;

Fiberchannel “Round and Round”

So yet another issue with HBAs this time with an older QLogic qle2462 and a set of 12TB Promise Arrays. Save your self some trouble and download the driver from VMware, qla2xxx-934.5.4.0 and inject it into your Update Manager…

APD VMware Storage Issues

So I had this issue with dead paths:

~ # esxcli storage vmfs extent list
Volume Name VMFS UUID Extent Number Device Name Partition
———– ———————————– ————- ———————————— ———
BackupSAN 50eb10a0-4f1a9256-5434-90e2ba22c340 0 naa.6842b2b000687ee500002a4850ea9934 1
Operations 5053a326-370b5095-739a-00137234e92a 0 naa.68b7b2acf4b8d12b3a051502000020ca 1
Templates 506204f5-fe667464-c1b1-90e2ba22c340 0 naa.68b7b2acf4b80148200615353227e7f3 1
CorpStor01 5053a1e4-e68f6227-0e8a-001ec9fd0643 0 naa.68b7b2acf4b8b1163a05e5010000c0a2 1
~ # esxcli storage core device detached list
Device UID State
———————————————————— —–
naa.6090a058e015725f990965020000a09e off
naa.68b7b2acf4b8f10e0d0585010000004c off
t10.FreeBSD_iSCSI_Disk______100000010_______________________ off
~ #
~ # esxcli storage core device detached remove -d naa.6090a058e015725f990965020000a09e
~ # esxcli storage core device detached remove -d naa.68b7b2acf4b8f10e0d0585010000004c
~ # esxcli storage core device detached remove -d t10.FreeBSD_iSCSI_Disk______100000010_______________________

How to SSH Between Two Linux Computers Without Needing a Password

1. ssh to server1

Connect to server1 and generate a public/private key pair.

1
2
3
ssh myusername@server1
password:
ssh-keygen -t rsa

When you run this command you will be prompted to answer several questions. Just hit enter each time until you are returned to a prompt.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Generating public/private rsa key pair.
Enter file in which to save the key (/home/local/myusername/.ssh/id_rsa):
Created directory '/home/local/myusername/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/local/myusername/.ssh/id_rsa.
Your public key has been saved in /home/local/myusername/.ssh/id_rsa.pub.
The key fingerprint is:
15:68:47:67:0d:40:e1:7c:9a:1c:25:18:be:ab:f1:3a myusername@server1
The key's randomart image is:
+--[ RSA 2048]----+
|        .*Bo=o   |
|       .+o.*  .  |
|       ...= .    |
|         + =     |
|        S +      |
|         .       |
|      . .        |
|      E+         |
|      oo.        |
+-----------------+

Now you will need to copy the public key you just generated and save it somewhere, you will need it later. Also ensure when you copy the key that the text is all on one line, if there are line breaks in the text, it will cause problems later when you try and use the key.

1
2
3
4
5
6
7
cd .ssh
cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyFS7YkakcjdyCDOKpE4RrBecRUWShgmwWnxhbVNHmDtJtK
PqdiLcsVG5PO94hv3A0QqlB1MX33vnP6HzPPS7L4Bq+5plSTyNHiDBIqmZqVVxRbRUKbP44BaA9RsW2ROu
8qdzmXRPupkyFBBOLa23RJJojBieFGygR2OwjS8cq0kpZh1I3c1fbU9I5j38baUK0naTBe2v7s/C8allnJ
hwkfds+Q9/kjaV55pMZIh+9jhoA8acCA6B55DYrgPSycW6fEyV/1PIER+a5lOXp1QCn0U+XFTb85dp5fW0
/rUnu0F9nBJFlo7Rvc1cMuSUiul/wvJ8tzlOhU8FUlHvHqoUUw== myusername@server1

2. ssh to server2

Now we will copy the public key from server1 to server2.

1
2
3
4
5
6
7
ssh myusername@server2
password:
mkdir .ssh
cd .ssh
vi authorized_keys
# paste the public key
chmod 600 authorized_keys

3. Test that your setup is working

1
2
3
4
ssh myusername@server1
password:
ssh myusername@server2
# you should not be prompted for a password!

Autologin for Windows Server

(From the Microsoft Site) To use Registry Editor (Regedt32.exe) to turn on automatic logon, follow these steps:

Click Start, and then click Run.
In the Open box, type Regedt32.exe, and then press ENTER.
Locate the following subkey in the registry:
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogon
Double-click the DefaultUserName entry, type your user name, and then click OK.
Double-click the DefaultPassword entry, type your password, and then click OK.NOTE: If the DefaultPassword value does not exist, it must be added. To add the value, follow these steps:
On the Edit menu, click New, and then point to String Value.
Type DefaultPassword, and then press ENTER.
Double-click DefaultPassword.
In the Edit String dialog, type your password and then click OK.
NOTE: If no DefaultPassword string is specified, Windows automatically changes the value of the AutoAdminLogon key from 1 (true) to 0 (false), disabling the AutoAdminLogon feature.

On the Edit menu, click New, and then point to String Value.
Type AutoAdminLogon, and then press ENTER.
Double-click AutoAdminLogon.
In the Edit String dialog box, type 1 and then click OK.
Quit Registry Editor.
Click Start, click Shutdown, and then type a reason in the Comment text box.
Click OK to turn off your computer.
Restart your computer. You can now log on automatically.
Notes To bypass the AutoAdminLogon process and to log on as a different user, hold down the SHIFT key after you log off or after Windows restarts.

Registry change will not work if the “Logon Banner” is defined on the server either by a Group Policy object (GPO) or by a local policy. When policy is changed to not impact server, the feature works as expected.

An interactive console logon that has a different user on the server changes the DefaultUserName registry entry as the last logged on user indicator. AutoAdminLogon relies on the DefaultUserName entry to match the user and the password. Therefore, AutoAdminLogon may fail. You may configure a shutdown script to set the correct DefaultUserName entry for AutoAdminLogonAs. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

119364
(http://support.microsoft.com/kb/119364/ )
AutoAdminLogon loses DefaultUserName