Skip to content

Instantly share code, notes, and snippets.

View rewida17's full-sized avatar
💭
Hard working 😄

rewida17

💭
Hard working 😄
  • Poland
View GitHub Profile
@bluvertigo
bluvertigo / download_podcast.sh
Last active July 31, 2022 18:50 — forked from hrwgc/validate.sh
bash wget - check if file exists at url before downloading
#!/bin/bash
# simple function to check http response code before downloading a remote file
# example usage:
# if `validate_url $url >/dev/null`; then dosomething; else echo "does not exist"; fi
function validate_url () {
if [[ `curl -s --head "$1" | head -n 1 | grep "HTTP/[1-3].[0-9] [23].."` ]]
then
# 0 = true
@s4y
s4y / capture_hls.md
Last active February 3, 2024 12:39
Capture an HLS stream from the beginning with ffmpeg
ffmpeg -live_start_index -99999 -i 'https://….m3u8' -c copy something.ts
@mdonkers
mdonkers / server.py
Last active May 6, 2024 23:32
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@jtuttas
jtuttas / mqtt.ps1
Created April 6, 2018 09:27
MQTT mit der Powershell
Add-Type -Path 'C:\Users\jtutt\OneDrive\bin\NuGet\M2Mqtt.4.3.0.0\lib\net45\M2Mqtt.Net.dll'
$MqttClient = [uPLibrary.Networking.M2Mqtt.MqttClient]("service.joerg-tuttas.de")
#
# Verbinden
$mqttclient.Connect([guid]::NewGuid())
Register-ObjectEvent -inputObject $MqttClient -EventName MqttMsgPublishReceived -Action {Write-host "Event Found Topic: $($args[1].topic) Message $([System.Text.Encoding]::ASCII.GetString($args[1].Message))"}
$mqttClient.Subscribe("esp32/temp",0)
$MqttClient.Publish("esp32/temp", [System.Text.Encoding]::UTF8.GetBytes("{temp:17}"))
@dmadisetti
dmadisetti / generate-wildcard-certificate.sh
Last active January 4, 2024 08:07 — forked from PowerKiKi/generate-wildcard-certificate.sh
Generate self-signed wildcard SSL certificate for development environment
#!/usr/bin/env bash
# print usage
DOMAIN=$1
if [ -z "$1" ]; then
echo "USAGE: $0 tld"
echo ""
echo "This will generate a non-secure self-signed wildcard certificate for "
echo "a given development tld."
echo "This should only be used in a development environment."