Skip to content

Instantly share code, notes, and snippets.

View haxcop's full-sized avatar
🏠
Working from home

Carlos Lozada haxcop

🏠
Working from home
  • Ireland - Dublin
View GitHub Profile
#!/bin/bash
set -eu
error() {
local msg="$1"
echo $msg >&2
exit 1
}
<?php
/*
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2011 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
@Desani
Desani / ScanMedia.md
Last active May 27, 2024 00:39
3.6 - Corrected issues with determining terminal size in specific use cases. Added file encoding thanks to recommendation by LordKenmou. Fixed update script checker.

This script utilizes ffmpeg, the same tool Plex uses, to decode the video stream and captures the output for any errors during playback and sends the playback errors to a log file. So essentially it plays the video in the background faster than regular speed. It then checks the error output log file to see if there is anything inside. If ffmpeg was able to cleanly play the file, it counts as a passed file. If there is any error output, an error could be anything from a container issue, a missed frame issue, media corruption or more, it counts the file as failed. So if there would be an issue with playback and a video freezing, it would be caught by this method of checking for errors. Because of the nature of the error log, any errors that show up, even simple ones, will all count as a fail and the output is captured so you can view the error log. Some simple errors are easy to fix so I have included an auto-repair feature which attempts to re-encode the file which is able to correct some issues that would cau

@haxcop
haxcop / Automated_Telly_installation.ps1
Last active April 8, 2018 14:19
Powershell script to run M3U Editor & Telly on Windows using Powershell
######### Created by Carlos L. AKA: HAXCOP #############
######################### V1 ###########################
#and thanks to the creators of these tools used bellow#
# tombowditch = https://github.com/tombowditch/telly
# jjssoftware = https://github.com/jjssoftware/m3u-epg-editor
# ENJOY #
# $L Choose the Directory Path of your output Notice $home = c:\users\YOUrUser (This is a reserved Variable by default into Windows)
@haxcop
haxcop / sync_playlists_to_users.py
Created December 22, 2017 14:59 — forked from JonnyWong16/sync_playlists_to_users.py
Sync Plex playlists to shared users.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Sync Plex playlists to shared users.
# Author: /u/SwiftPanda16
# Requires: plexapi, requests, xmltodict
import requests
import xmltodict
@Vaduz
Vaduz / gist:5fbfd6ac651c371148bd9dc3a7a329b3
Created August 28, 2016 15:04
recursively convert iso file to mkv by using handbrakecli in windows
gci . *.ISO -R | ForEach-Object { $input = $_.FullName; $newfile = "E:\ISOs\" + $_.BaseName + ".mkv"; &"C:\Program Files\HandBrake\HandBrakeCLI.exe" -i "$input" -o "$newfile" --preset "High Profile" }
@Kostanos
Kostanos / json-to-csv.php
Created May 24, 2013 03:28
Convert JSON array file to CSV. Use the array keys as the first row. Command line using: json-to-csv.php json.filename > csv.filename
#!/usr/bin/php
<?php
/*
* Convert JSON file to CSV and output it.
*
* JSON should be an array of objects, dictionaries with simple data structure
* and the same keys in each object.
* The order of keys it took from the first element.
*
* Example: