Skip to content

Instantly share code, notes, and snippets.

View HoffmannP's full-sized avatar

Peter Hoffmann HoffmannP

View GitHub Profile
#!/usr/bin/env python
import re
IGNORE_BEGINNING = True
allUppercase = re.compile(r'[A-ZÄÜÖ][A-ZÄÜÖ]+')
matchLetters = re.compile(r'[a-zäüößA-ZÄÜÖ]')
matchUCLetters = re.compile(r'[A-ZÄÜÖ]')
#!/usr/bin/env python
import glob
import pathlib
import os
import os.path
import shutil
import sys
MCA_PATERN = 'r.*.*.mca'
@HoffmannP
HoffmannP / checkEmojis.html
Last active December 21, 2020 09:30
Test to check which emoji shortcodes can't be found
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<script type="module">
const ALL_SOURCES = {
'joypixels': 'https://cdn.jsdelivr.net/npm/emoji-picker-element-data@1.0.0/en/joypixels/data.json',
'iamcal': 'https://cdn.jsdelivr.net/npm/emoji-picker-element-data@1.0.0/en/iamcal/data.json',
'github': 'https://cdn.jsdelivr.net/npm/emoji-picker-element-data@1.0.0/en/github/data.json',
'emojibase-legacy': 'https://cdn.jsdelivr.net/npm/emoji-picker-element-data@1.0.0/en/emojibase-legacy/data.json',
@HoffmannP
HoffmannP / Serverstruktur.txt
Created March 21, 2020 12:04
Serverstruktur
Alles in Docker
* Buildserver für BE, FE (nodeJs)
* nginx für FE
* nginx + nodeJs für BE
* postgres für DB
#!/bin/bash
clear
echo "configure for my network settings"
netDev="wlp3s0"
netPrefix="192.168.0"
macNet="fritz"
shimDev="${macNet}0"
ipHost="35"
@HoffmannP
HoffmannP / pre-push.hook.sh
Created April 26, 2018 13:57
git-hook to prevent pushing php-errors
#!/bin/sh
# An example hook script to verify what is about to be pushed. Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
#
# This hook is called with the following parameters:
#
# $1 -- Name of the remote to which the push is being done
# $2 -- URL to which the push is being done
@HoffmannP
HoffmannP / gitea.log
Created April 23, 2018 15:59
Log of API call
$ curl -X GET "http://localhost:3000/api/v1/repos/ber/test/commits/master/statuses" -H "accept: application/json"
[Macaron] 2018-04-23 15:55:59: Started GET /api/v1/repos/ber/test/commits/master/statuses for 172.25.0.1
2018/04/23 15:55:59 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `description`, `num_teams`, `num_members`, `diff_view_style` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1}
2018/04/23 15:55:59 [I] [SQL] SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_
<?php
/* This pluing allows you to login via URZ-LDAP-authentication
{
//...
"AuthManagerAutoConfig": {
"primaryauth": {
"UrzLdap": {
"class": "UrzLdapPrimaryAuthenticationProvider",
@HoffmannP
HoffmannP / DieselPing.sh
Last active May 5, 2017 12:06
Scripte um zu untersuchen ob die Übertragungsrate nach einem Ping systematisch höher ist
### SERVER.sh
PORT=9876
DATA=/tmp/rand.data
SIZE=1M
while true
do
netcat -l $PORT < "$DATA"
dd if=/dev/urandom of="$DATA" bs=$SIZE count=1
const Soup = imports.gi.Soup;
const Json = imports.gi.Json;
function assert(assertion) {
if (!assertion) {
throw "Error";
}
}
/* Get the data using a HTTP GET */