x
Search Posts:

TXT BLOG: a pure txt weblog

Questo รจ un blog di puro testo dove gli utenti del sito possono condividere pubblicamente links, snippets di codice ed altre informazioni rigrosamente testuali.

Inkscape command-line export svg to png + resize

mkdir png
for file in *.svg
do
inkscape -C -w 256 -h 256 -f $file -e png/$file.png
done

Wordpress child theme directory url

<? get_stylesheet_directory_uri() ?>

New sqlite3 php library

https://github.com/subaddiction/php-sqlite3

Debian live-build howto/example [jessie]

#!/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"
 
echo "cryptsetup" > config/package-lists/encryption.list.chroot
 
echo task-gnome-desktop > config/package-lists/desktop.list.chroot
 
echo "vim byobu ssh-client gnupg seahorse gedit-plugins gnome-disk-utility gparted python inkscape python-libxml2 python-numpy blender gimp gimp-gap gimp-plugin-registry imagemagick create-resources pidgin pidgin-otr libav-tools vlc" > config/package-lists/custom.list.chroot
 
lb build

# Fork this script here: https://gist.github.com/subaddiction/bf328bdcb8a623ef7dec

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>


# Available here as gist:
# https://gist.github.com/subaddiction/d618d5f7f23ba0444f95

libvisual to v4l2sink

#!/bin/bash

#sudo modprobe v4l2loopback devices=4

#gst-inspect |grep libvisual
#libvisual:  libvisual_oinksie: libvisual oinksie plugin plugin v.0.1
#libvisual:  libvisual_lv_scope: libvisual libvisual scope plugin v.0.1
#libvisual:  libvisual_lv_analyzer: libvisual libvisual analyzer plugin v.1.0
#libvisual:  libvisual_jess: libvisual jess plugin plugin v.0.1
#libvisual:  libvisual_jakdaw: libvisual Jakdaw plugin plugin v.0.0.1
#libvisual:  libvisual_infinite: libvisual infinite plugin plugin v.0.1
#libvisual:  libvisual_corona: libvisual libvisual corona plugin plugin v.0.1
#libvisual:  libvisual_bumpscope: libvisual Bumpscope plugin plugin v.0.0.1


gst-launch jackaudiosrc ! queue ! audioconvert ! libvisual_lv_scope ! video/x-raw-rgb ! colorspace ! v4l2sink device=/dev/video1 sync=false

gst-launch jackaudiosrc ! queue ! audioconvert ! libvisual_oinksie ! video/x-raw-rgb ! colorspace ! v4l2sink device=/dev/video2 sync=false

gst-launch jackaudiosrc ! queue ! audioconvert ! libvisual_jess ! video/x-raw-rgb ! colorspace ! v4l2sink device=/dev/video3 sync=false


#########


#gst-launch pulsesrc device=0 ! queue ! audioconvert ! libvisual_infinite ! video/x-raw-rgb ! ffmpegcolorspace ! queue ! v4l2sink device=/dev/video1 sync=false


gst-launch pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor ! queue ! audioconvert ! libvisual_infinite ! video/x-raw-rgb ! ffmpegcolorspace ! queue ! v4l2sink device=/dev/video1 sync=false

gst-launch pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor ! queue ! audioconvert ! libvisual_infinite ! video/x-raw-rgb ! ffmpegcolorspace ! queue ! v4l2sink device=/dev/video2 sync=false

gst-launch pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor ! queue ! audioconvert ! libvisual_infinite ! video/x-raw-rgb ! ffmpegcolorspace ! queue ! v4l2sink device=/dev/video3 sync=false

gst-launch pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor ! queue ! audioconvert ! libvisual_infinite ! video/x-raw-rgb ! ffmpegcolorspace ! queue ! v4l2sink device=/dev/video4 sync=false

How to tweetstorm with a bunch of Perl code lines

Requirements:
- An unix-like shell with Perl
- A twitter account to retweet who mentions an hashtag
- TTYtter : http://www.floodgap.com/software/ttytter/

Steps:
1) Authenticate TTYtter

2) Create a file "tweetstorm.pl" and configure your search string in the "$track" variable:
----------------
die("I can't run anonymously") if ($anonymous);

$track = '#socialstrike'; # The search key to query twitter api with
$notimeline = 1;

$store->{'dontecho'} = $whoami; # this is the username

$handle = sub {
        my $ref = shift;
        my $sn = &descape($ref->{'user'}->{'screen_name'});
        
        return if ($sn eq $store->{'dontecho'});

        my $rtstring = "\/rt $ref->{'id_str'}";
        &ucommand($rtstring); # ReTweet all matching tweets

        my $favstring = "\/fav $ref->{'id_str'}";
        &ucommand($favstring); # Favorite all matching tweets

        my $tweettxt = &descape($ref->{'text'});
        &ucommand($tweettxt); # Tweet a new tweet copying any matching tweet
        
        &defaulthandle($ref);
        return 1;
};
----------------

3) Run in a terminal:
user@machine:~$ ttytter -exts=tweetstorm.pl -verbose=1


Perlæ di saggezzæ informaticæ #1

Fallo bello quanto ti pare, ma fallo funzionare anche in un terminale.
Pages:
0 1 2 3 4 5 6 7 8 9 10 11 12