Skip to content

Instantly share code, notes, and snippets.

@aka-z
aka-z / App.java
Created December 5, 2018 08:11 — forked from thomasdarimont/App.java
Secure REST API Example with Spring Security, Spring Session, Spring Boot
package demo;
import java.io.Serializable;
import java.security.Principal;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@aka-z
aka-z / stream_to_youtube.sh
Created November 10, 2018 13:56 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@aka-z
aka-z / livestreamingyoutube
Created November 9, 2018 02:40 — forked from laurenarcher/livestreamingyoutube
Livestreaming to Youtube Live, Ubuntu, Linux FFMPEG
Terminal Commands:
One webcam:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE
Two webcam overlay:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -f v4l2 -s 320x240 -r 10 -i /dev/video0 -filter_complex "[1:v]setpts=PTS-STARTPTS[bg]; [2:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=shortest=1 [out]" -map "[out]" -map 0:a -vcodec libx264 -pix_fmt yuv420p -preset veryfast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE
@aka-z
aka-z / stream.sh
Created November 9, 2018 02:40 — forked from ulitiy/stream.sh
ffmpeg stream to youtube
#!/bin/bash
pid_file="/var/run/stream.pid"
case "$1" in
restart)
/etc/init.d/stream stop
/etc/init.d/stream start
;;
start)
rm $pid_file
@aka-z
aka-z / live-meta.sh
Created November 9, 2018 02:34 — forked from makoto1984/live-meta.sh
streaming music with generated video to youtube via ffmpeg
#!/bin/sh
# This script is a companion of the script youtube-music-live.sh. Assuming the MUSIC_PATH is an icecast2 stream, The script will fetch the metadata tag StreamTitle every 5 seconds and update the file /tmp/artist, /tmp/title. Generally, the StreamTitle should be like "artist - title", though sometimes there is only title. You may also update the files manually and ignore this script. Be sure to run this script after youtube-music-live.sh.
# You have to define music url.
MUSIC_PATH=
while [ `pgrep -x ffmpeg` ]
do
meta=`ffprobe -v error -show_format "$MUSIC_PATH" | grep StreamTitle | cut -d= -f2`
case "$meta" in
@aka-z
aka-z / youtube.sh
Created November 9, 2018 02:25 — forked from xurizaemon/youtube.sh
Streaming to YouTube from Raspberry Pi via avconv with a Microsoft HD-3000 LifeCam.
#!/bin/bash
KEY=YOUR.KEYG-OESR-IGHT-HERE
URL=rtmp://a.rtmp.youtube.com/live2
while true ; do
avconv -ar 44100 -ac 2 -f s16le -i /dev/zero -f video4linux2 -s 640x360 -r 10 -i /dev/video0 -f flv "$URL/$KEY"
sleep 3
done
@aka-z
aka-z / tomcat-service.sh
Created September 27, 2018 02:59 — forked from lesstif/tomcat-service.sh
RHEL/CentOS tomcat7 init.d service script.
#!/bin/bash
#
# tomcat
#
# chkconfig: 345 96 30
# description: Start up the Tomcat servlet engine.
#
# processname: java
# pidfile: /var/run/tomcat.pid
#
@aka-z
aka-z / tempandrain.html
Created August 30, 2018 07:16 — forked from codefactory/tempandrain.html
amCharts (http://www.amcharts.com/) 로 만든 평균 기온, 평균 강수량 차트입니다. [데모보기] http://codefactory.kr/demos/charts/tempandrain.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>각 지역 평균 기온과 평균 강수량</title>
<link rel="stylesheet" href="http://fonts.googleapis.com/earlyaccess/nanumgothic.css">
<style>
* {
font-family: 'Nanum Gothic';
}
@aka-z
aka-z / seoulweather_wundergorund.html
Created August 24, 2018 04:02 — forked from ChangJoo-Park/seoulweather_wundergorund.html
서울시 날씨 정보 예제
<!DOCTYPE html>
<html>
<head>
<title>서울시 날씨정보-wunderground API이용</title>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="utf-8">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
<script>
@aka-z
aka-z / wp-permissions-script
Created August 2, 2018 02:55 — forked from macbleser/wp-permissions-script
WordPress Permissions Configuration Script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro
#
WP_OWNER=changeme # &lt;-- wordpress owner
WP_GROUP=changeme # &lt;-- wordpress group
WP_ROOT=/home/changeme # &lt;-- wordpress root directory