Rexxer

Some tips for me and other

My python 2.7 script to parse wheather data and speak it

# -*- coding: utf8 ## encoding=utf8 import urllib import re from bs4 import BeautifulSoup import os import subprocess import codecs import sys from setupcon import setup_console setup_console(‘cp866’) sys.getdefaultencoding() reload(sys) sys.setdefaultencoding(“cp866”) # Get the page sock = urllib.urlopen(“http://tvoj.kharkov.ua/help/weather/”) htmlSource = sock.read() sock.close() #print htmlSource # soup = BeautifulSoup(htmlSource, “html5lib”) string = soup.h1 results = soup.find_all(‘span’, limit=10) […]

Exchange 2010 + Changes in renewing certificates 2016

Copy-pasted from: http://brattex.blogspot.com/2012/09/renew-exchange-2010-certificate.html Renew Exchange 2010 Certificate generates a binary file – conversion to base64 tips When renewing an SSL certificate for Exchange 2010, the process is fairly straightforward and there are plenty of sites to give advice on how to do this. Two sites to consider would be Technet and Go Daddy and the steps are summarised as […]

Script for Mikrotik to monitor VPN IPSEC

:if ([/ping 192.168.0.149 interval=3 count=3]<2) do={ :log warning “IPSec KO, flushing SAs” /ip ipsec installed-sa flush sa-type=all } else={ :log info “IPSec OK” }

Script to fix issues with Windows updates

net stop wuauserv rmdir /s /q %windir%\SoftwareDistribution net start wuauserv wuauclt /detectnow

Script for W2k12 server to redial VPN

:start ping -n 2 192.168.0.1 | Find /I “TTL=” || goto next echo OK goto start :next echo Not OK rasdial “Office2” /disconnect rem ping 192.168.0.1 -n 5 rasdial “Office2” server password goto start

VPN autostart as a service

sc create VPNstart start= auto binPath= “rasdial vpn admin password” DisplayName= “VPNstart” depend= lanmanworkstation obj= “NT AUTHORITY\LocalService”

Allow users to restart a service

sc sdset audiosrv O:BAG:BAD:(A;;GA;;;WD)

ESP8266 + temp/humidity + parse data for monitoring

My script to parse the data: #!/bin/sh #Temp S0=`/usr/local/bin/curl -v –silent –stderr – http://192.168.0.57/ | awk ‘/Temperature/{print $18}’` #Humidity #S1=`curl -v –silent –stderr – http://192.168.0.57/ | awk ‘/Humidity/{print substr($21,1,2) + 0}’ | bc -l` S1=`/usr/local/bin/curl -v –silent –stderr – http://192.168.0.57/ | awk ‘/Humidity/{print $21}’` /usr/local/bin/rrdtool update /var/rrdtool/db/esp.rrd N:$S0:$S1 WWWPREFIX=/usr/local/www/apache22/data/images RRDPREFIX=/var/rrdtool/db /usr/local/bin/rrdtool graph $WWWPREFIX/esp.png \ –width […]

JMX for Tomcat and Zabbix

Edit registry for each node: HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Procrun 2.0\node1\Parameters\Java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=1092 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

Replace or add a file into MSI

http://msi2xml.sourceforge.net/ The command extracts the MSI files: msi2xml -c OutputDir your.msi Open OutputDir and modify the file. To rebuild the MSI run: xml2msi.exe -m yourmsi.xml  

Previous Posts Next posts