Skip to content

Instantly share code, notes, and snippets.

View scysys's full-sized avatar
💩
I may be slow to respond.

Sven scysys

💩
I may be slow to respond.
  • Germany
  • 02:23 (UTC +02:00)
View GitHub Profile
@marco79cgn
marco79cgn / dm-toilet-paper.js
Last active February 29, 2024 17:35
iOS Widget, das die Anzahl an Klopapier Packungen in deiner nächsten dm Drogerie anzeigt (für die scriptable.app)
// dm Klopapier Widget
//
// Copyright (C) 2020 by marco79 <marco79cgn@gmail.com>
//
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
// IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
@sanderdewijs
sanderdewijs / IceCastPlaylist.php
Created March 22, 2020 16:34
This is an idea to create a playlist from an Icecast server storing the songdata and cover image into a database.
<?php
/**
* Class IceCastPlaylist
* See https://stackoverflow.com/questions/60502076/how-to-get-icecast-server-songs-history/60798774#60798774 for context
*
* This class can be used as follows:
* global $wpdb
* $playlistClass = new IceCastPlaylist($wpdb);
* $playlistClass->fetchSongInfo();
@kfatehi
kfatehi / gist:07bdef95c132215598a23caf4ce7c2f5
Created January 6, 2019 03:02
hls to icecast with ffmpeg
set -exuo pipefail
LIVESTREAM_URL=$1
if [[ ! $# -eq 1 ]]; then
echo "usage: $0 <URL>"
exit 1
fi
# Referencing FFMpeg to Icecast2 Streaming Sample Gist: https://gist.github.com/keiya/c8a5cbd4fe2594ddbb3390d9cf7dcac9
URL=$(streamlink $LIVESTREAM_URL worst --stream-url)
channels=2
@highgain86j
highgain86j / nginx config for icecast2
Last active February 3, 2023 13:06
nginx configuration for reverse-proxying icecast2 streaming server.
server {
listen 80;
listen [::]:80;
server_name radio.example.com;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
location / {
@flyinprogrammer
flyinprogrammer / cloud-init.bash
Last active December 26, 2017 06:52
switch clocksource to tsc on boot - ubuntu 16.04
## Step 1) install/ensure sysfsutils is installed
sudo apt-get install sysfsutils
# ---------------------------------
# Manage /sys filesystem. Requires sysfsutils package
## Turn off THP
sudo tee -a /etc/sysfs.d/thp.conf <<-EOF
kernel/mm/transparent_hugepage/enabled = never
kernel/mm/transparent_hugepage/khugepaged/defrag = 0
@xgin
xgin / letsencrypt-hostname.sh
Created January 4, 2016 07:29
Secure plesk clean installation with hostname certificate by Let's Encrypt
#!/bin/bash -e
### Copyright 1999-2015. Parallels IP Holdings GmbH. All Rights Reserved.
### Secure plesk clean installation with hostname certificate by Let's Encrypt
export PYTHONWARNINGS="ignore:Non-standard path"
LE_HOME=${LE_HOME:-"/usr/local/psa/var/modules/letsencrypt"}
HOSTNAME=$(hostname)
# Use staging server for testing
# --server https://acme-staging.api.letsencrypt.org/directory
@rakeshtembhurne
rakeshtembhurne / import_export_gz.sql
Created July 15, 2013 08:40
MySQL: Import and export in gzip form
// Export database in gzip form
mysqldump -u user -p database | gzip > database.sql.gz
// Import database from gzip form
gunzip < database.sql.gz | mysql -u user -p database