Rexxer

Some tips for me and other

News

Ubuntu 14.04 + grey screen in VNC

Fix: # apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal Use this ~/.vnc/xstartup file: #!/bin/sh export XKL_XMODMAP_DISABLE=1 unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & gnome-panel & gnome-settings-daemon & metacity & nautilus & gnome-terminal & # or you can use […]

IPSEC between PFSence and Mikrotik + NAT like remote host is in the LAN

The PFSence side: Allow all traffic from the remote host. Create the IPSEC connection. Allow all traffic on the IPSEC interface. Create a Virtual IP for internal host (it is remote host now). Create the NAT rule for this host. The Mikrotik side: Allow all traffic from the remote host. Create the IPSEC connection. Create […]

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) […]

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

Previous Posts Next posts