Skip to content

Instantly share code, notes, and snippets.

View elpatron68's full-sized avatar

Markus Busche elpatron68

View GitHub Profile
@elpatron68
elpatron68 / update_wikijs.sh
Last active October 6, 2020 18:52
Update shell script for wiki.js (Linux install in ~/wiki)
#!/bin/bash
#
# Upgrade guide: https://docs.requarks.io/install/upgrade
# Prerequisite: Wiki.js installed in ~/wiki, this script saved in ~
cd ~
# Remove former downloaded file
rm wiki-js.tar.gz
rm ~/config.yml.bak
# Save config.yml
cp wiki/config.yml ~/config.yml.bak
@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, [email protected]
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 [email protected]
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')