Skip to content

Instantly share code, notes, and snippets.

@hexathos
hexathos / gist:a9a7f0e99b5ebf32afe5490789c2d775
Last active June 14, 2017 07:37
name parameters in sophos av not working
The following output is generated by savscan with hashs
md5 1bb08a3214461dcda0fcb3c7931c419b /opt/sophos-av/bin/savscan
sha512 193a8094f1eb1e3b6793e08194a85dda17faeed00e702b771a96bf5b1cb270d336b53036412b8b1d0006aa8adeb80651f117d2157c83b9a7534e193dd975037c /opt/sophos-av/bin/savscan
I would expect to get output of scanned files, according to -dn parameter and
file details, according to --show-file-details, but none of them seems to get
used by savscan
@hexathos
hexathos / evelog2speech.sh
Last active October 5, 2017 20:12
EVE GameLogs to speech on linux
## ONE logfile
tail -n1 -f logfilename | sed 's/.*)//' -u | sed 's/<[^>]\+>//g' -u | espeak -ven-us+f5 -s1600 --pho
## Multiple Logfiles with cachefile
#this must run in background, or any other console
tail -n1 -f * | grep -v "==" --line-buffered | sed 's/.*)//' -u | sed 's/<[^>]\+>//g' -u >>~/Documents/eve.log
#this is for text2speech conversion
tail -f ~/Documents/eve.log | espeak -ven-us+f5 -s1600 --pho
#!/bin/bash
jenkinsjobname=<INSERT>
jenkinsbuildtoken=<INSERT>
jenkinsusername=<INSERT>
jenkinspasswordhash=<INSERT>
jenkinsurl=<INSERT>
while read oldrev newrev refname
do
@hexathos
hexathos / hxfunctions-reduced.sh
Last active April 3, 2018 04:40
Morning Tweets
function checkForPid {
lockfile=${1}
if [ -f ${lockfile} ] ; then
runningpid=$(cat ${lockfile})
if ps -p${runningpid} >/dev/null
then
runningpid=$(cat ${lockfile})
echo "${0##*/} wird bereits ausgeführt (PID ${runningpid})"
ps -p${runningpid} -u
exit 1
@hexathos
hexathos / function_genUUID.php
Created November 18, 2012 01:15
Create UniqueID in php
<?php
function genUUID($prefix=null,$maxlength=36)
{
$s = strtoupper(
hash(
'whirlpool',hash('sha1',
microtime(true).crypt(
uniqid(
rand(),
true)
@hexathos
hexathos / gist:1f46149746f770ffddcde554b9b2d81c
Last active February 6, 2023 21:52
ip masking in nginx
map $remote_addr $remote_addr_anon {
~(?P<ip>\d+\.\d+)\. $ip.0.0;
~(?P<ip>[^:]+:[^:]+): $ip::;
default 0.0.0.0;
}
map $http_x_forwarded_for $http_x_forwarded_for_anon {
~(?P<ip>\d+\.\d+)\. $ip.0.0;
~(?P<ip>[^:]+:[^:]+): $ip::;
default 0.0.0.0;
}