Skip to content

Instantly share code, notes, and snippets.

View elpatron68's full-sized avatar

Markus Busche elpatron68

View GitHub Profile
@elpatron68
elpatron68 / cod-sats.txt
Created March 24, 2020 09:16
CoD API Stats
accuracy
assists
bestAssists
bestCaptures
bestConfirmed
bestDamage
bestDeaths
bestDefends
bestDefuses
bestDenied
@echo off
rem (c) 2019 M. Busche, elpatron@mailbox.org
echo " _ _ _ "
echo " | | | | | | "
echo " __ _ __| |_ _ _ __ __| | __ _| |_ ___ "
echo " / _` |/ _` | | | | '_ \ / _` |/ _` | __/ _ \"
echo "| (_| | (_| | |_| | |_) | (_| | (_| | || __/"
echo " \__,_|\__,_|\__,_| .__/ \__,_|\__,_|\__\___|"
echo " | | "
@elpatron68
elpatron68 / mm_update.sh
Created August 28, 2019 13:38
Mattermost update script
#!/bin/sh
# export URL before launch: eg. `export URL=https://releases.mattermost.com/5.14.0/mattermost-5.14.0-linux-amd64.tar.gz`
# The script assumes, that Mattermost is installed in ~/mattermost
cd /tmp
wget $URL
tar -xf mattermost*.gz --transform='s,^[^/]\+,\0-upgrade,'
sudo systemctl stop mattermost
cd ~/
cp -ra mattermost/ mattermost-back-$(date +'%F-%H-%M')/
find mattermost/ mattermost/client/ -mindepth 1 -maxdepth 1 \! \( -type d \( -path mattermost/client -o -path mattermost/client/plugins -o -path mattermost/config -o -path mattermost/logs -o -path mattermost/plugins -o -path mattermost/data \) -prune \) | sort | sudo xargs rm -r
@elpatron68
elpatron68 / export_latest_mattermost_download_url.py
Created July 18, 2019 14:40
Parse latest Mattermost download url and launch update process.
import re
import os
import io
import requests
import subprocess
try:
os.remove('index.html')
except:
pass
#!/platform/python/bin/python
import datetime
from dateutil.parser import parse as parse_date
import sys
import cachetclient.cachet as cachet
import json
ENDPOINT = 'http://status/api/v1'
API_TOKEN = '<%= @cachethq_key %>'
@elpatron68
elpatron68 / convert_iso2utf8.py
Last active March 18, 2019 08:24
Convert ISO8859 to UFT8
# converts iso encoded text file to utf-8
import codecs
def convertfromiso(iso_filename, uft8_filename):
data = codecs.open(iso_filename, 'r', 'iso-8859-1').read()
codecs.open(uft8_filename, 'w', 'utf-8').write(data)
def main():
convertfromiso('isofile.txt', 'uft8file.txt')
@elpatron68
elpatron68 / CSV_to_2-dim-array.vb
Created February 11, 2019 11:57
Read csv file into 2-dim arry
Imports System.IO
Imports Microsoft.VisualBasic.FileIO
Module csv2array
Public Function _csv2array(ByVal sFilename As String) As Object
Dim dest As List(Of String) = New List(Of String)
Dim src As List(Of String) = New List(Of String)
Using csvParser As TextFieldParser = New TextFieldParser(sFilename)
csvParser.CommentTokens = New String() {"#"}
@elpatron68
elpatron68 / Monitor_LANCOM_Mem_Heap.cmd
Last active November 23, 2018 08:48
Monitor LANCOM Memory And Heap
@echo off
SETLOCAL
set PLINK="C:\Program Files (x86)\PuTTY\plink.exe"
set LCMS_TARGET=root@X.Y.Z.A
set LCMS_TARGET_PASS=
set PAUSE_TIMEOUT=60
:START
FOR /F "skip=1" %%D IN ('WMIC OS GET LocalDateTime') DO ( SET LDATE=%%D & GOTO GOT_LDATE )
# converts iso encoded text file to utf-8
import codecs
def convertfromiso(iso_filename, uft8_filename):
data = codecs.open(iso_filename, 'r', 'iso-8859-1').read()
codecs.open(uft8_filename, 'w', 'utf-8').write(data)
def main():
convertfromiso('isofile.txt', 'new-utf8-file.txt')
; See https://gist.github.com/elpatron68/cb1f9f69577e33998df7b4fbf2e1f8c7
#pragma compile(Out, ..\SaveConnectedDrivesList.exe)
#pragma compile(LegalCopyright, "© Markus Busche elpatron@mailbox.org")
#pragma compile(Icon, configure-2.ico)
#include <AutoItConstants.au3>
#include <MsgBoxConstants.au3>
#include <File.au3>
$mAnswer = MsgBox (4, "ReCoNe" ,"Are all network drives connected at this moment?")