Exchange 2010 + Powershell + Restore permanently deleted items in mailbox (in a retention period)
There is the script: http://blogs.msdn.com/b/emeamsgdev/archive/2012/04/27/powershell-script-to-recover-all-deleted-items-in-a-mailbox.aspx There is the EWS Managment API (ver. 2.2): http://www.microsoft.com/en-us/download/details.aspx?id=42951 – it needs to run the script. Usage example: ./RecoverDeletedItems.ps1 -Mailbox john.smith@contoso.com I ran it as administrator on an Exchange server.
Openssl + generate a certificate
Example: openssl req -x509 -newkey rsa:2048 -keyout cert.key -out cert.pem -days 999 -nodes -config c:\Apache24\conf\openssl.cnf -nodes – to not ask for passprase
CMD + replace string in many files in subdirectories
Tool: link CMD-file: for /r %%a in (.) do pushd “%%a” & cd & nhrplc.exe %* & popd COMMAND: run.cmd -spt:”c:\Python25\Lib\site-packages\trac\conf\trac” -t:”C:\in\trac” conf\trac.ini
Windows + powershell + handles count
Just a .ps1 script to find handle eaters. $s = [WmiSearcher]’Select * from Win32_Process where Handlecount > 1000′ $s.Get() |sort handlecount |ft handlecount,__path,name -auto
Automatically disable or re-enable IPv6 or its components
http://support.microsoft.com/kb/929852/en-us Create DWORD (32) HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters \DisabledComponents 0x20 – Priority IPv4 over IPv6 0x10 – Disable IPv6 except tunnel interfaces
MSP430 + PIR Motion sensor HC-S501 + Relay Module + Beeper
A simple alarm system on MSP430 Launchpad based on http://blog.suspended-chord.info/2010/09/12/connecting-a-parallax-pir-sensor-module-to-the-launchpad/. Code for Energia: int calibrationTime = 30; //the time when the sensor outputs a low impulse long unsigned int lowIn; //the amount of milliseconds the sensor has to be low //before we assume all motion has stopped long unsigned int pause = 5000; boolean lockLow […]
Arduino Uno + Ubuntu + Firmware + command line
1. Install avrdude: sudo apt-get install avrdude 2. Run the command: avrdude -F -V -c arduino -p ATMEGA328P -P /dev/ttyUSB0 -b 115200 -U flash:w:firmware.hex
RRDTool script
Very usefull script for RRDTool. Was copy-pasted from someones blog (can’t recollect the link) – thanks to the author. #!/bin/bash # Путь к исполнимому файлу rrdtool RRDTOOL=/usr/bin/rrdtool # Путь к базе, в которой храниться температура DATABASE=/usr/local/rrd/space-temperature.rrd # Периодичность поступления данных в базу (сек) – соответственно должен быть настроен CRON PERIOD=60 # Команда для получения текущей […]
Arduino + Energy Monitoring
Recently I’ve built a device for monitoring power consuption from http://openenergymonitor.org/emon/buildingblocks/how-to-build-an-arduino-energy-monitor I used: Nokia 5110 display for Arduino, sensor SCT-013, power adapter AC-AC 9v. I bought a cheap current sensor with LCD to calibrate my device (emon1.current(5, 28);). I used Adafruit library because others didn’t work correctly. My sketch for it: #include “EmonLib.h” // Include […]