Skip to content

Instantly share code, notes, and snippets.

View tzermias's full-sized avatar

Zacharias Tzermias tzermias

View GitHub Profile
@tzermias
tzermias / meme.sh
Created February 10, 2021 17:24
Meme Generator using ImageMagick
#!/bin/bash
# meme.sh
# Meme generator with ImageMagick
# https://www.it-cooking.com/technology/digital-image/image-processing/meme-generator-imagemagick/
usage() {
echo "Usage: $0 [ -t TOP_MSG ] [ -b BOTTOM_MSG ] SRC DST"
}
failure() {
ffmpeg -r 12 \
-pattern_type glob -i 'photos/*.jpg' \
-i audio.mp3 \
-filter:v 'tblend,fade=t=in:s=0:d=2,fade=out:675:24' \
-filter:a 'afade=in:ss=0:d=2,afade=t=out:st=56:d=3' \
-vcodec libx264 -acodec mp3 panorama.mp4
#!/bin/sh
# Collect photos from penteli.meteo.gr and save them to a directory.
# github.com/tzermias
DOWNLOAD_DIR="$(dirname $0)/photos"
FILENAME="panorama_$(date +%s).jpg"
URL="https://penteli.meteo.gr/stations/penteli/webcam/panorama.jpg"
# Create directory to save images, if non-existent.
@tzermias
tzermias / slack-df.py
Created January 16, 2018 12:34
Calculate file usage per user for shared files in Slack
#!/usr/bin/env python
import requests
import json
# Calculate file usage per user for shared files in Slack
# zacharias.tzermias@gmail.com
API_ENDPOINT="https://slack.com/api/%s"
TOKEN = "YOUR-TOKEN-HERE"
#!/bin/bash
CGI_URL="https://server/icinga/cgi-bin"
USERNAME=""
PASSWORD=""
out=$(curl --silent -u $USERNAME:$PASSWORD "$CGI_URL/status.cgi?jsonoutput&servicestatustypes=28" |jq .status.service_status[].status 2>&1)
echo $out | awk 'BEGIN {RS=" ";d=0;c=0;u=0;w=0}
@tzermias
tzermias / .tmux.conf
Last active October 15, 2020 20:42
My tmux config
# Set Ctrl+a as a prefix
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# Indexes
set -g base-index 1
set -g pane-base-index 1
# Split panes
@tzermias
tzermias / DHT22_BMP180.ino
Last active March 2, 2016 16:34
Sketch that combines measurements from DHT22 and BMP180 sensors
// Sketch that combines measurements from DHT22 and BMP180 sensors
// and prints them to serial.
// Aris Tzermias (github.com/tzermias)
// Pinout on Arduino Leonardo/Yun.
// Pin 2: SDA (BMP180)
// Pin 3: SCL (BMP180)
// Pin 4: DHT22
#include "DHT.h"
@tzermias
tzermias / Dockerfile
Last active December 7, 2015 22:46
Dockerfile from devstaff hack session
# This dockerfile clones github-analytics repository (https://github.com/kabitakis/github-analytics), installs prerequisites
# and runs the app.
# Start the container with `docker run -e TOKEN=test12345 <container>`
FROM node:latest
MAINTAINER tzermias
#Clone repository
RUN git clone https://github.com/kabitakis/github-analytics.git
@tzermias
tzermias / plesk.fact
Created September 3, 2015 14:09
Ansible fact for retrieving plesk version
#!/bin/bash
VERSION=$(awk '{print $1}' /usr/local/psa/version)
VERSION_MAJOR=$(echo $VERSION | cut -d'.' -f1)
cat <<EOF
{
"plesk_version" : "$VERSION",
"plesk_version_major" : "$VERSION_MAJOR"
}
@tzermias
tzermias / racktables.py
Created March 17, 2015 09:38
A simple script that parses data from the show "mac address-table" command of Dell Poweredge 5548 switch, and updates a specific network switch object in Racktables.
#! /usr/bin/env python
""" racktables.py
Simple script that parses data from 'show mac address-table' command of Dell
Poweredge 5548 switch, and updates the Racktables DB accordingly
a.tzermias@tophost.gr
"""