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 / 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 / tracking_url_links.html
Created April 14, 2016 07:19
tracking urls? DPD primetime, gebrüder weiss
body {
background-color: #fff;
font-family: Roboto, sans-serif;
color: #000;
font-size: 14px;
line-height: 20px;
}
h1 {
margin: 10px 0px;
@josy1024
josy1024 / raspberrypi_DHT22_AM2302.sh
Last active April 21, 2016 18:22
raspberrypi DHT22 AM2302 temperatur und humidity sensor
# on osmc
# PRETTY_NAME="Open Source Media Center"
# NAME="OSMC"
# VERSION="February 2016"
# VERSION_ID="2016.02-3"
# ID=osmc
# ID_LIKE=debian
sudo apt-get install git-core
sudo apt-get install make gcc autoconf gawk libc6 libc6-dev