throttle local e-mails (prevent alert floods)

/etc/postfix/ thrttl unix – – n – – smtp -o syslog_name=smtp-throttled /etc/postfix/ thrttl_destination_rate_delay = 10s thrttl_destination_concurrency_limit = 1 thrttl_destination_recipient_limit = 2 thrttl_initial_destination_concurrency=1 transport_maps = regexp:/etc/postfix/transport /etc/postfix/transport: /\@mydomain\.com$/ thrttl:

SaltStack for Windows updates

Set up WSUS to automatically approve security patches (because it’s the right thing to do), [void][reflection.assembly]::LoadWithPartialName(“Microsoft.UpdateServices.Administration”) $wsus = Get-WSUSServer $class = $wsus.GetUpdateClassifications() | ? {$_.Title -In (‘Critical Updates’,’Security Updates’)} $rule = $wsus.GetInstallApprovalRules() | Where {$_.Name -eq “Default Automatic Approval Rule”} $class_coll = New-Object Microsoft.UpdateServices.Administration.UpdateClassificationCollection $class_coll.AddRange($class); $rule.SetUpdateClassifications($class_coll); $rule.Enabled = $True; $rule.Save() $config = $wsus.GetConfiguration(); $config.TargetingMode = […]

convert DHCP IP to static

ESXi %pre –interpreter=busybox # extract network info from bootup VMK_INT=”vmk0″ VMK_LINE=$(localcli network ip interface ipv4 get | grep “${VMK_INT}”) IPADDR=$(echo “${VMK_LINE}” | awk ‘{print $2}’) NETMASK=$(echo “${VMK_LINE}” | awk ‘{print $3}’) GATEWAY=$(esxcfg-route | awk ‘{print $5}’) DNS=”″ HOSTNAME=$(nslookup “${IPADDR}” “${DNS}” | grep Address | grep “${IPADDR}” | awk ‘{print $4}’) echo “network –bootproto=static –addvmportgroup=true –device=vmnic0 […]

increase kvm guest disk

1. add DAG repo 2. yum install libguestfs-tools 3. virt-filesystems –long –parts –blkdevs -h -a w2k8.img (the Windows C: is usually /dev/sda2) 4. dd if=/dev/zero of=w2k8new.img seek=20000 bs=1M count=1 5. virt-resize –expand /dev/sda2 w2k8.img w2k8new.img

which java? (for applet security settings)

In Ubuntu: update-alternatives –list java the output should be something like There are 2 choices for the alternative java (providing /usr/bin/java). Selection    Path                       Priority   Status ———————————————————— * 0            /usr/bin/java-j2re1.6-ibm   1200      auto mode   1            /usr/bin/java-j2re1.6-ibm   1200      manual mode   2            /usr/bin/java-j2sdk1.6-ibm  1200      manual mode so JAVA_HOME is /usr/lib/j2re1.6-ibm/jre and the file to edit is $JAVA_HOME/lib/security/java.policy File syntax […]

How to restore Grub from a live CD

mkdir /zzz mount /dev/sda3 /zzz mount -t proc none /zzz/proc mount -o bind /dev /zzz/dev chroot /zzz /bin/bash grub find /boot/grub/stage1 root (hd0,2) setup (hd0) For /boot/grub/menu.lst, a minimal config would be default Linux timeout 2 title Linux root (hd0,2) kernel=/boot/vmlinuz root=/dev/sda3 ro also check /zzz/etc/fstab.

Running SLES from an USB key

This is a simple attempt to build an easily replaceable and cheap storage server. Cheap means a lot of SATA drives in RAID1 or 5 with both disks and controller expected to fail miserably at any time. Linux makes booting from a RAID array unnecessary difficult (even if it’s in a mirror config, c’mon Windows […]

Bad Behavior has blocked 122 access attempts in the last 7 days.