Skip to content

Instantly share code, notes, and snippets.

@subaddiction
subaddiction / ffmpeg_video_samples.sh
Last active August 29, 2015 14:23
FFmpeg video samples
#!/bin/bash
# Apple devices
ffmpeg -f lavfi -i testsrc -f alsa -i hw:0,0 -codec:video libx264 -b:v 2500k -strict experimental -codec:audio aac -b:a 192k -t 10 -s 1024x768 apple.mp4
# Events binding example
# <video src="apple.mp4" controls onplay="console.log('started')" onended="console.log('finished')"></video>
# Apple retina devices
ffmpeg -f lavfi -i testsrc -f alsa -i hw:0,0 -codec:video libx264 -b:v 2500k -strict experimental -codec:audio aac -b:a 192k -t 10 -s 2048X1536 apple-retina.mp4
@subaddiction
subaddiction / jessie.sh
Last active April 29, 2020 11:40
debian 8 live build
#!/bin/bash
# WARNING: to use "--binary-images hdd", see this bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=773833
# WARNING: to get persistence encryption working, apply this fix: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=767195
# Italian locale & keyboard, default boot with luks encrypted persistence
lb config --distribution jessie --debian-installer live --binary-images iso-hybrid --archive-areas "main contrib non-free" --bootappend-live "boot=live persistence persistence-encryption=luks locales=it_IT.UTF-8 keyboard-layouts=it username=utente hostname=D8"
# English locale & italian keyboard, default boot with luks encrypted persistence
#lb config --distribution jessie --debian-installer live --binary-images iso-hybrid --archive-areas "main contrib non-free" --bootappend-live "boot=live persistence persistence-encryption=luks keyboard-layouts=it username=user hostname=D8"
@subaddiction
subaddiction / logjam-various-software-ciphers.txt
Created May 22, 2015 15:52
Logjam ciphers for various server side software
Apache 2.2
SSLProtocol all -SSLv2 -SSLv3
SSLCompression off
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
SSLHonorCipherOrder on
@subaddiction
subaddiction / logjam-apache-2.2.conf
Created May 21, 2015 12:46
LOGJAM mitigation for Apache 2.2
# This mod_ssl configuration mitigates the LOGJAM attack on apache versions
# in which the "SSLOpenSSLConfCmd DHParameters" directive was not yet implemented. (< 2.4)
# This configuration mitigates the attack avoiding the use of DHE ciphers
# Test here: https://weakdh.org/sysadmin.html
<IfModule mod_ssl.c>
SSLProtocol all -SSLv2 -SSLv3
SSLCompression off
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
SSLHonorCipherOrder on
</IfModule>
@subaddiction
subaddiction / sid-chroot.sh
Last active August 29, 2015 14:03
Configure a sid basic environment
#!/bin/bash
# Configure a sid basic environment
# execute as root
cd
mkdir sid-chroot
debootstrap sid sid-chroot
# chroot sid-chroot
# apt-get install libqtgui4 libqt4-network qtcurves locales-all
Riferimenti per livecoding
Hands-on
http://livecodelab.net/
http://fluxus.fo.am/
Software
http://www.pawfal.org/fluxus/
http://www.pawfal.org/dave/blog/category/fluxus-hacking/
#!/bin/bash
UP=$(pgrep mysql | wc -l);
if [ "$UP" -ne 1 ];
then
echo "MySQL is down.";
sudo service mysql start
else
echo "All is well.";
fi