Skip to content

Instantly share code, notes, and snippets.

View philcrump's full-sized avatar

Phil Crump philcrump

View GitHub Profile
@philcrump
philcrump / cx123xx-no-blue-screen.patch
Created November 22, 2012 09:42
A kernel patch for the cx231xx Composite Video => USB Dongle V4L driver that removes the blue screen normally visible when the device can't detect a SYNC signal.
--- a/drivers/media/video/cx231xx/cx231xx-avcore.c 2011-11-06 22:53:31.610479790 +0000
+++ b/drivers/media/video/cx231xx/cx231xx-avcore.c 2011-11-06 22:55:18.235967499 +0000
@@ -654,7 +654,7 @@
status = vid_blk_write_word(dev, AFE_CTRL, value);
status = vid_blk_read_word(dev, OUT_CTRL1, &value);
- value |= (1 << 7);
+ value |= (0 << 7);
status = vid_blk_write_word(dev, OUT_CTRL1, value);
@philcrump
philcrump / stream.sh
Last active December 15, 2015 00:39
BATC.tv streaming with ffmpeg
#!/bin/bash
# video: ~300kbps flv 720x560 10fps
# audio: 32kbps aac mono 11.025KHz
while true; do
ffmpeg -f video4linux2 -i /dev/video1 -itsoffset 1.0 -f alsa -i pulse -acodec libfdk_aac -ac 1 -b:a 32k -ar 11025 -f flv -s 720x560 -r 10 -b:v 256k "rtmp://fms.batc.tv/live/xxxxxxx/xxxxxxx flashver=FMLE/3.0\20(compatible;\20FMSc/1.0)"
sleep 1;
done
@philcrump
philcrump / gist:5408270
Created April 17, 2013 22:25
Custom Mediawiki Vector CollapsibleNav Menus.
Edit of 'extensions/Vector/modules/ext.vector.collapsibleNav.js' to customise collapsed/expanded nav-menus.
============================================================ -
if (
state === 'true' ||
( state === null && i < 1 ) ||
( state === null && version === 1 && id === 'p-lang' )
) {
@philcrump
philcrump / gist:6662048
Created September 22, 2013 17:29
picam_stream.sh
#!/bin/bash
raspivid -n -hf -w 720 -h 405 -fps 25 -vf -t 86400000 -b 180000 -o - | ffmpeg -f h264 -i - -f flv -vcodec copy -acodec null "rtmp://fms.batc.tv/live/M0DNY/M0DNY"
@philcrump
philcrump / gist:7384154
Created November 9, 2013 10:37
Wordpress Nginx Config
server {
listen 80;
listen [::]:80;
server_name dottyprojects.com;
rewrite ^(.*) http://www.dottyprojects.com permanent;
}
server {
listen 80;
listen [::]:80;
server_name www.dottyprojects.com;
@philcrump
philcrump / display.sh
Last active August 27, 2015 22:16
Force native mode for Acer Monitor
#!/bin/bash
sudo xrandr --newmode "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync
sudo xrandr --addmode DVI-0 1440x900_60.00
sudo xrandr -s 1440x900
@philcrump
philcrump / setup.sh
Last active August 27, 2015 22:21
Ubuntu Trusty Setup
sudo apt-get update && sudo apt-get dist-upgrade
## Move menu bar to bottom of the screen
## Remove Whiskers menu, add applications menu
sudo apt-get remove --purge pidgin mousepad xfce4-notes firefox xchat simple-scan gnome-mines gnome-sudoku abiword gnumeric orage gmusicbrowser parole
sudo apt-get autoremove
sudo apt-get install chromium-browser chromium-codecs-ffmpeg-extra vlc htop ssh pepperflashplugin-nonfree gedit vlc git mosh
sudo ufw allow ssh
sudo ufw logging off
sudo ufw enable
@philcrump
philcrump / fr24-csv.py
Created August 27, 2015 23:31
FlightRadar24 Stats => CSV
#!/usr/bin/python3
import urllib.request
import json
import datetime
import csv
url=''
req = urllib.request.Request(url,headers={'User-Agent' : "Magic Browser"})
#!/bin/bash
sudo apt-get update && sudo apt-get -y dist-upgrade
sudo apt-get -y --force-yes install autoconf automake build-essential libasound2-dev libass-dev libfreetype6-dev libtool pkg-config texinfo zlib1g-dev
mkdir /home/pi/ffmpeg_sources
cd /home/pi/ffmpeg_sources/
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar -xf yasm-1.3.0.tar.gz
cd /home/pi/ffmpeg_sources/yasm-1.3.0/
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
make
;=====================================================================
[Language]
;=====================================================================
; Français ou/or English
Langue=English
;Langue=Français
;=====================================================================
[TSbuffer]
;=====================================================================
; Nombre de buffers de 1316 octets pour le transfert du TS --- mettre valeur 2 à 30