Skip to content

Instantly share code, notes, and snippets.

@g0053
g0053 / index.sh
Created March 16, 2020 23:43 — forked from max-mapper/index.sh
ffmpeg timelapse and rtsp streaming
# 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
@g0053
g0053 / unsplash_wallpaper.sh
Created December 1, 2020 09:13 — forked from fpgaminer/unsplash_wallpaper.sh
Downloads a random image from Unsplash and sets the wallpaper every so often (currently only works with Gnome/Unity/Cinnamon/etc)
#!/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
@g0053
g0053 / fetch_google_image.py
Created December 3, 2020 00:39 — forked from alkc/fetch_google_image.py
Download a random picture from Google image search, using Python 3.
#!/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
@g0053
g0053 / fetch_google_image.py
Created December 3, 2020 00:40 — forked from grifball/fetch_google_image.py
Download a random picture from Google image search.
#!/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
@g0053
g0053 / mysql-docker.sh
Created December 23, 2020 01:42 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# 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
@g0053
g0053 / download_flickr_image.py
Created June 7, 2021 21:51 — forked from yunjey/download_flickr_image.py
downloading images from flickr using python-flickr
# 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)
@g0053
g0053 / howToModifyOvaFile.md
Created July 22, 2021 17:59 — forked from goodjob1114/howToModifyOvaFile.md
how to modify .ova file on linux/Mac using terminal....export vm (OVF 1.0) from virtualbox, then modify some tag and hash value for import vm to ESXi

extract ova files from an archive

$ tar -xvf vmName.ova

modify ovf for some invalid tag

$ vi vmName.ovf

This is a work in progress, proceed with caution

Install Proxmox and a Ubuntu VM with Portainer to manage docker containers

Setup Proxmox

  1. Install Proxmox 6.X iso I selected 2 drives in Raid 1 mirror
  2. Console/SSH into Proxmox
  3. nano /etc/apt/sources.list
@g0053
g0053 / nagiosTelegram.py
Created November 30, 2021 11:34 — forked from hvanderlaan/nagiosTelegram.py
Nagios notifications via Telegrambot
#!/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