Skip to content

Instantly share code, notes, and snippets.

@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
@mattrasband
mattrasband / UserService.java
Created April 19, 2017 04:26
Example of Spring 4.2's @TransactionalEventListener
@Service
@Slf4j
public class UserService {
private final ApplicationEventPublisher applicationEventPublisher;
private final UserRepository userRepository;
UserService(ApplicationEventPublisher applicationEventPublisher,
UserRepository userRepository) {
this.applicationEventPublisher = applicationEventPublisher;
this.userRepository = userRepository;
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.philipphauer.blog</groupId>
<artifactId>versioning-continuous-delivery</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
@mshick
mshick / install.sh
Last active April 2, 2020 10:01
Installing Node.js with Homebrew and nvm
# Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install nvm
brew install nvm
# Export nvm environment
export NVM_DIR="$HOME/.nvm"
. "$(brew --prefix nvm)/nvm.sh"
@lukemadera
lukemadera / docker-create-swarm.sh
Created September 25, 2015 15:56
jwilder/nginx-proxy using Compose + Swarm + Machine attempt 1
#!/bin/bash
set -e
if [ -z "$DIGITALOCEAN_ACCESS_TOKEN" ]; then
echo >&2 "ERROR: You must export DIGITALOCEAN_ACCESS_TOKEN"
exit 1
fi
docker pull swarm > /dev/null
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
CREATE SCHEMA IF NOT EXISTS `survey_001_models_from_tables` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
USE `survey_001_models_from_tables` ;
-- -----------------------------------------------------
-- Table `survey_001_models_from_tables`.`organizations`
-- -----------------------------------------------------
@oldratlee
oldratlee / developer-reading-list.md
Last active August 12, 2023 17:03
关于我的“程序员必读书单”

@peng_gong程序员必读书单不错,核对了一下自己。

“读完”指从头到尾读完的;“读过”是指有读但中途放下了。
当然有些书是在自己年轻时读完的,当时阅历尚浅理解吸收有限,要再读! 😊

PS:
这里个人强调于区分“读完” vs. “读过”,是因为对于编程了解原则还远远不够,循环往复的理解操练是标配,按这个节奏打穿一本书的体系是开始也是过程。
个人觉得如果连“读完”好书建立书中的体系这样级别的磨练都不行,那路是不是走得着急了! 😄

PPS: 📚我的豆瓣读书

@v5tech
v5tech / ffmpeg.md
Last active October 14, 2024 19:57
ffmpeg视频合并、格式转换、截图

使用ffmpeg合并MP4文件

ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"
package com.sagedevices.platform.jersey.core;
import com.sagedevices.platform.api.util.StringUtil;
public class RequestId {
public static final String HEADER_NAME_ORIGIN = "X-Origin-Request-Id";
public static final String HEADER_NAME_LOCAL = "X-Local-Request-Id";
public static final String MDC_NAME_LOCAL = "LocalRequestId";
@anthavio
anthavio / spring-security-3.0.xml
Last active December 8, 2015 11:22
spring-security xml exploded configuration
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:ctx="http://www.springframework.org/schema/context"
xmlns:sec="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">