$ tar -xvf vmName.ova
$ vi vmName.ovf
# rename jpegs to be datetime based | |
jhead -n%Y%m%d-%H%M%S **/**.jpg | |
# timelapse from jpegs. r = fps | |
ffmpeg -r 15 -pattern_type glob -i '*.jpg' -s hd720 -vcodec libx264 -crf 25 OUTPUT.MP4 | |
# rtsp stream to youtube |
#!/bin/sh | |
while : | |
do | |
wget -q -O unsplash_wallpaper.jpg https://unsplash.it/1920/1080/?random | |
gsettings set org.gnome.desktop.background picture-uri file://$PWD/unsplash_wallpaper.jpg | |
sleep 1h # Change this if you want a different update frequency (e.g. 30m, 12h, 24h, etc...). | |
done |
#!/usr/bin/env python3 | |
# coding: utf-8 | |
# Download a random picture from Google image search. | |
# | |
# Usage: | |
# $ fetch_google_image.py cat cute # Download a cute cat picture | |
import os | |
import json |
#!/usr/bin/env python | |
# coding: utf-8 | |
# Download a random picture from Google image search. | |
# | |
# Usage: | |
# $ fetch_google_image.py cat cute # Download a cute cat picture | |
import os | |
import sys |
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
# Let us consider the following typical mysql backup script: | |
mysqldump --routines --no-data -h $mysqlHost -P $mysqlPort -u $mysqlUser -p$mysqlPassword $database | |
# It succeeds but stderr will get: | |
# Warning: Using a password on the command line interface can be insecure. | |
# You can fix this with the below hack: | |
credentialsFile=/mysql-credentials.cnf | |
echo "[client]" > $credentialsFile | |
echo "user=$mysqlUser" >> $credentialsFile | |
echo "password=$mysqlPassword" >> $credentialsFile |
# First, you should install flickrapi | |
# pip install flickrapi | |
import flickrapi | |
import urllib | |
from PIL import Image | |
# Flickr api access key | |
flickr=flickrapi.FlickrAPI('c6a2c45591d4973ff525042472446ca2', '202ffe6f387ce29b', cache=True) |
#!/usr/bin/env python | |
# file : nagiosTelegram.py | |
# purpose : send nagion notifications via Telegram bot | |
''' nagiosTelegram.py - small python script for sending nagion messages via a telegram | |
bot. Please see BotFather for more info about telegram bots | |
https://core.telegram.org/bots | |