Skip to content

Instantly share code, notes, and snippets.

View josy1024's full-sized avatar

josef lahmer josy1024

View GitHub Profile
@josy1024
josy1024 / reboot_at_0500.sh
Created January 25, 2016 12:27
#relaxedIT reboot at night
#/bin/bash
#author: josef lahmer
#
echo "/sbin/init 6" | at 05:00
@josy1024
josy1024 / top-taskmanager-remote.cmd
Last active January 27, 2016 15:49
remote prozess explorer tasklist
pc=computername
:: prozesse mit mehr als einer minute cpu zeit
:: /v zeigt auch die cpuzeit an!
tasklist /FI "CPUTIME gt 00:01:00" /v /S %pc%
:: prozesse mit mehr als 30 minuten cpu zeit
tasklist /FI "CPUTIME gt 00:30:00" /v /S %pc%
:: prozesse mit mehr als 100mb ram
@josy1024
josy1024 / topclients.bashrc.sh
Created February 1, 2016 10:16
topclients snipplet command for bash.rc
# list tcpip network conncections for apache (port 80 + https 443)
alias topclients80="netstat -plan | grep :80 | awk {'print $5'} | cut -d: -f 1 | sort | uniq -c | sort -n"
alias topclients443="netstat -plan | grep :443 | awk {'print $5'} | cut -d: -f 1 | sort | uniq -c | sort -n"
# not so pretty, all ip connection...
alias topclients="netstat -plan | awk {'print $5'} | cut -d: -f 1 | sort | uniq -c | sort -n"
# change order with "sort -rn"
@josy1024
josy1024 / logger.vbs
Created February 12, 2016 18:52
relaxed universal logging script windows
Set WshShell = Wscript.CreateObject("Wscript.Shell")
set env = WshShell.Environment("PROCESS")
code = WScript.Arguments(0)
id = ENV ("COMPUTERNAME") & "_" & ENV ("USERNAME")
call logme( code, id)
function logme (code, id)
@josy1024
josy1024 / logger.sh
Created February 12, 2016 18:55
relaxed universal logging script linux
#!/bin/bash
# das pzs "functions.sh" file
# logging function
# parameter 1: OK ERROR OK_START, OK_DONE
# parameter 2: code
logstats="https://logurl.domain.com/api/rw/l.php"
http_user="user"
http_pass='pass'
@josy1024
josy1024 / nach_fehlern_suchen.sh
Created February 12, 2016 19:01
relaxed log analyse from logfiles
#!/bin/bash
# nach_fehlern_suchen.sh logfile
if cat $1 | grep "Fehler" ; then
gstatslog ERROR_DONE "$code $logfile"
elif cat $1 | grep "Error" ; then
gstatslog ERROR_DONE "$code $logfile"
elif cat $1 | grep "Warnung" ; then
gstatslog WARN_DONE "$code $logfile"
else
@josy1024
josy1024 / raspberrypi_DS1820.sh
Last active June 6, 2016 21:12
der raspberrypi_temperatursensor mit 1-wire :-)
## author: josef lahmer (collected infos)
# https://plus.google.com/collection/IiyTgB
# PHASE1 tempsensor working
# PHASE2 RRD GRAPHS (reboot SAFE!!)
# PHASE3 WEBSERVER RRD
# PHASE4 GOOGLE SPREADSHEAT
@josy1024
josy1024 / synology_temp_monitoring_from_osmc.sh
Last active April 4, 2016 20:36
synology NAS temperature monitoring with SNMP
rrdtool create nas.rrd --step 900 \
DS:disk1:GAUGE:1200:-40:80 \
DS:disk2:GAUGE:1200:-40:80 \
RRA:AVERAGE:0.5:1:960 \
RRA:MIN:0.5:96:3600 \
RRA:MAX:0.5:96:3600 \
RRA:AVERAGE:0.5:96:3600
http://exchange.nagios.org/directory/Plugins/Network-and-Systems-Management/Others/Synology-status/details
plugin
@josy1024
josy1024 / mirror.cmd
Last active April 24, 2018 15:22
robocopy mirror script best practice
:: Author: josef lahmer
:: http://josy1024.blogspot.co.at/2011/12/robocopy-mirror-script.html
mirror.cmd script (runas admin)
set log=syncjob_%date:~0,2%.log.log
set source=e:\
set target=h:\
set OPTSALL=/MIR /MT /R:2 /W:10 /XF "thumbs.db" /XF "._*" /XF ".DS_Store" /NP /NFL /NDL /XD "system volume information" "$recycle.bin" "recycler" "DfsrPrivate" ".Trashes" ".TemporaryItems"
@josy1024
josy1024 / tracking_url_links.html
Created April 14, 2016 07:19
tracking urls? DPD primetime, gebrüder weiss