Skip to content

Instantly share code, notes, and snippets.

IFS=$'\n'
myUser=`whoami`
echo Local user is $myUser
SYNO_USER=`psql synofoto -t -c "select id from user_info where name='$myUser'"`
echo SYNO_USER is $SYNO_USER
echo Scanning for video files..
for i in `find . -iname \*.mov -type f | grep -v eaDir | grep -v "_3"`; do
#echo i is $i
fname=$(dirname ${i})/@eaDir/$(basename ${i})/SYNOPHOTO_FILM_H.mp4;
@kiler129
kiler129 / prevent-host-driver-in-pci-pass.md
Last active July 7, 2025 07:48
Definitely prevent stubborn devices from being bound by the host driver in PCI passthrough scenario

Scenario

You're running a KVM-based virtualization. You want to do PCI/PCIe passthrough of some device. You don't want it to attach to the host OS at all.

Your device looks like that:

00:1f.2 SATA controller [0106]: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller [8086:1c02] (rev 05)
	Subsystem: Hewlett-Packard Company 6 Series/C200 Series Chipset Family 6 port Desktop SATA AHCI Controller [103c:330d]
	Kernel driver in use: ahci
	Kernel modules: ahci
@BenjaminPoncet
BenjaminPoncet / ffmpeg-wrapper
Last active January 9, 2025 22:51
Synology VideoStation ffmpeg wrapper with DTS, EAC3 and TrueHD support. This project is no longer maintained: Please see the following projects: https://github.com/darknebular/Wrapper_VideoStation/ - https://github.com/AlexPresso/VideoStation-FFMPEG-Patcher
#!/bin/bash
rev="12"
_log(){
echo "$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - $1" >> /tmp/ffmpeg.log
}
_log_para(){
echo "$1" | fold -w 120 | sed "s/^.*$/$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - = &/" >> /tmp/ffmpeg.log
@ahacke
ahacke / Exiftool Cheats (for Synology Photostation).md
Last active March 22, 2025 08:04
Contains exiftool cheats and tricks, mostly used for Synology Photostation

Exiftool Cheats (for Synology Photostation).md

Contains scripts to modify exif metadata on media files. Generally, I used them for the synology photostation.

Another good reference with exif tricks: https://gist.github.com/rjames86/33b9af12548adf091a26

All of the commands or scripts require ExifTool by Phil Harvey.

Recommended Order of Running the Commands and Scripts

  1. Set CreateDate for Video-Media
  2. Set 'CreateDate' Based on FileName Supporting Different Formats
@Valyrox
Valyrox / proxmox-postinst.sh
Created August 30, 2018 22:44
OVH Proxmox post install
#!/bin/bash
################################################################################
# This is property of eXtremeSHOK.com
# You are free to use, modify and distribute, however you may not remove this notice.
# Copyright (c) Adrian Jon Kriel :: [email protected]
################################################################################
#
# Script updates can be found at: https://github.com/extremeshok/xshok-proxmox
#
# post-installation script for Proxmox
@mpryvkin
mpryvkin / beautify-html.js
Last active March 17, 2025 02:29 — forked from brnpimentel/beautify-html.js
JS Beautify hack to work with Blade directives (Laravel)
function Beautifier(html_source, options, js_beautify, css_beautify) {
//Wrapper function to invoke all the necessary constructors and deal with the output.
html_source = html_source || '';
// BEGIN
html_source = html_source.replace(/\{\{((?:(?!\}\}).)+)\}\}/g, function (m, c) {
if (c) {
c = c.replace(/(^[ \t]*|[ \t]*$)/g, '');
c = c.replace(/'/g, ''');
c = c.replace(/"/g, '"');
@rn
rn / LCOW-Linuxkit.md
Last active August 29, 2020 10:12
LCOW Linuxkit

Get latest build of dockerd and docker and run dockerd

Invoke-WebRequest -UseBasicParsing -OutFile dockerd.exe https://master.dockerproject.org/windows/x86_64/dockerd.exe
Invoke-WebRequest -UseBasicParsing -OutFile docker.exe https://master.dockerproject.org/windows/x86_64/docker.exe

Add LinuxKit images

@SmartFinn
SmartFinn / dhcp-leases-to-dns.rsc
Last active April 2, 2025 14:12
MikroTik (RouterOS) script for automatically setting DNS records for clients when they obtain a DHCP lease
# MikroTik (RouterOS) script for automatically setting DNS records
# for clients when they obtain a DHCP lease.
#
# author SmartFinn <https://gist.github.com/SmartFinn>
:local dnsTTL "00:15:00";
:local token "$leaseServerName-$leaseActMAC";
# Normalize hostname (e.g. "-= My Phone =-" -> "My-Phone")
# - truncate length to 63 chars
@hitapia
hitapia / scripts.sh
Last active December 27, 2015 13:03
Install PHP7, apache2 and mysql
## Install PHP 7
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php-7.0
sudo apt-get update
sudo apt-get install -y php7.0
## Install Apache2
sudo add-apt-repository ppa:ondrej/apache2
sudo apt-get update
sudo apt-get install apache2
@JeffreyWay
JeffreyWay / PjaxMiddleware.php
Last active November 6, 2024 14:26
Laravel middleware for working with pjax.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Symfony\Component\DomCrawler\Crawler;
class PjaxMiddleware