How to remove duplicated VMs in VMM console

  1.  Move machine to another hyper-v host via Failover Cluster Manager Console
  2.  Get ID of duplicated VM
    Get-SCVirtualMachine -Name "VMName" |fl id,vmid, virtualmachinestate, hostname
  3. Double check working and duplicated machine
    get-vm   -id "ID" | fl id,vmid, virtualmachinestate, hostname
  4. Delete duplicated VM configuration
    get-vm   -id "ID" |Remove-SCVirtualMachine -Force

    Note the -Force option! You are risking to delete your data If you do NOT put -Force.

Exchange mailbox statistics in MB

Get-Mailbox -ignoredefaultscope|Get-MailboxStatistics| select DisplayName,MailboxGuid, Database, StorageLimitStatus,itemcount,LastLogonTime , @{expression = {$_.TotalItemSize.Value.ToMB()}; label="TotalItemSizeMB"},@{expression = {$_.TotalDeletedItemSize.Value.ToMB()}; label="TotalDeletedItemSizeMB"}|export-csv C:\tmp\export.csv -encoding Unicode

 

exchange_stats

Daewoo Lanos SRS/Airbag test

What you will need:
1. K-Line adapter connected to pin ” J”
2. Chevrolet Explorer 1.7 (free to use)

Procedure overview:
1. Get (or solder) a K-Line adapter.
2. Download Chevrolet Explorer (CE).
3. Connect to ALDL pins:Ground, +12V, J.
4. Turn on ignition. Do not start engine.
4. Start CE, set up COM Port, test adapter.
5. Double click “SRS” button (in orange).
6. Read Errors, clear errors.
7. Remove car key for 10 seconds.
8. Turn on ignition again.

Electric schematic:
l0

Chevrolet Explorer:
ce1

Port setup:
ce2

Adapter test:
ce3

Airbag reset:
CE9

CE10
CE11

K-Line adapter schematic (can’t find original link):
k-line

Postfix tips

Fast and dirty parsing of /var/log/mail.log.

#!/bin/bash
cat /var/log/mail.log|grep "> -> <"|awk '{print $1," "$2," "$3," "$13," "$15," "$17}'|tr -d ','|while read p; do
  mid=$(echo $p|awk '{print $6}')
  sender=$(echo $p|awk '{print $4}')
  if [ $sender != "Message-ID:" -a $sender != "->" ]
  then
        status=$(cat /var/log/mail.log|grep $mid |grep -Eo "status=\w+")
        echo $p $status
  fi
done

It shows: date, sender, recipient, mail id, status

Oct 31 00:34:14 <noreplay@sender.com> <sibbbbl@icccon.bg> EBE5640D38 status=sent
Oct 31 00:34:24 <noreplay@sender.com> <sbbbbt@mariccc.org> 1396F40D39 status=sent
Oct 31 00:34:24 <noreplay@sender.com> <m.gbbbbieva@cccumen.bg> 3094940D3A status=sent
Oct 31 00:34:33 <noreplay@sender.com> <fibbbbi@dicccr.bg> 3957640D3B status=sent
Oct 31 00:34:34 <noreplay@sender.com> <sbbbbtli@mccc.bg> 47FE840D3C status=sent
Oct 31 00:34:43 <noreplay@sender.com> <bbbbitly@maccc.bg> 61C3440D3D status=sent
Oct 31 00:34:44 <noreplay@sender.com> <sitobbbbsi@maccc.bg> 724F340D3E status=sent

 

Qmail abracadabras

Sent emails from: sender@example.com

cat ./var/log/qmail/smtpd/current |grep -i "rcpt: from <sender@example.com" |awk '{print $1" "$6 " "$7 " "$8 " " $9 " " $10}' |tai64nlocal > ../workresult/sender\@example.com-emails.txt

Sent emails from: 10.11.12.13

cat /var/log/qmail/smtpd/current|grep "CHKUSER relaying rcpt:" |tai64nlocal |more |awk '{print $9;}'|awk '{match($0,/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/); ip = substr($0,RSTART,RLENGTH); print ip}'|grep -v "10.11.12.13"

Ubuntu 12.04 Stuck at “Stopping Userspace bootsplash”

Virtual machine downloaded from windows azure

bootsplash0

1. Edit /etc/default/grub

#GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0 earlyprintk=ttyS0 rootdelay=300"
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_GFXMODE=640x480

2. Remove bloatware

aptitude remove --auto-remove cloud-init
aptitude remove --auto-remove plymouth-theme-ubuntu-text

If you are unable to enter rescue mode – use SystemRescueCd
bootsplash1