Skip to content

Instantly share code, notes, and snippets.

View ulrischa's full-sized avatar

ulrischa ulrischa

View GitHub Profile
@ulrischa
ulrischa / sharer-urls.md
Created April 9, 2024 17:57 — forked from tZilTM/sharer-urls.md
Sharer (share) URLs (links) for sharing on LinkedIn, Twitter, Pinterest, Reddit and Facebook (2020-02-02)
@ulrischa
ulrischa / testjson.json
Created January 24, 2024 20:49
testjson.json
[
{
"name": "Alice",
"message": "Congratulations on your retirement! Wishing you a journey of happiness and adventure in the years ahead."
},
{
"name": "Bob",
"message": "Happy Retirement! It's time to enjoy your life to the fullest. Thank you for your years of hard work and dedication."
},
{
@ulrischa
ulrischa / Webserver.ps1
Created December 21, 2023 19:49
Powershell Webserver
# Einfacher PowerShell Webserver
$listener = New-Object System.Net.HttpListener
$listener.Prefixes.Add("http://+:8000/") # Port 8000
$listener.Start()
Write-Host "Listening on port 8000..."
while ($listener.IsListening) {
$context = $listener.GetContext()
$response = $context.Response
@ulrischa
ulrischa / archive_bookmarklet.js
Created November 2, 2023 16:07
Archive Bookmarklet
javascript:void(open('https://archive.is/?url=%27+location.href));
@ulrischa
ulrischa / did_you_mean.php
Created April 29, 2023 12:38
Did you mean
<?php
function didYouMean($query, $suggestions) {
$querySoundex = soundex($query);
$similarSuggestions = [];
foreach ($suggestions as $suggestion) {
if (soundex($suggestion) == $querySoundex) {
$similarSuggestions[] = $suggestion;
}
@ulrischa
ulrischa / neuronal_net.py
Created April 8, 2023 11:52
Neuronales Netzwerk
import numpy as np
# Eingabedaten
X = np.array([[0, 0, 1],
[0, 1, 1],
[1, 0, 1],
[1, 1, 1]])
# Erwartete Ausgabedaten
y = np.array([[0],
@ulrischa
ulrischa / check_links_curl.php
Last active March 26, 2023 19:29
PHP check dead links with cirl
@ulrischa
ulrischa / enviro_db.py
Last active April 8, 2021 06:53
Save Enviro Data to DB
import mysql.connector
def save_enviro_data_in_db(vals):
print ("save db")
try:
mydb = mysql.connector.connect(
host="",
user="",
password="",
database="",
#!/usr/bin/python
import yagmail
import sys
#initializing the server connection
yag = yagmail.SMTP(user='sender@sender', password='xxx')
#sending the email
yag.send(to='to@to', subject='Motion detected', contents=['Motion', sys.argv[1]])
print("Email sent successfully")
@ulrischa
ulrischa / motion.conf
Created September 5, 2020 22:07
Motion Configuration
# Rename this distribution example file to motion.conf
#
# This config file was generated by motion 4.1.1
# Documentation: /usr/share/doc/motion/motion_guide.html
############################################################
# Daemon
############################################################
# Start in daemon (background) mode and release terminal (default: off)