Skip to content

Instantly share code, notes, and snippets.

View pirafrank's full-sized avatar

Francesco Pira pirafrank

View GitHub Profile
@pirafrank
pirafrank / hetzner.sh
Created October 18, 2020 19:12 — forked from Knight1/hetzner.sh
Hetzner Cloud create temporary Windows Servers
#!/bin/bash
ID=`hcloud server list | tail -1 | grep Windoof | awk '{print $1;}'`
CONTEXT=`hcloud context active`
if [ "$CONTEXT" != "testing" ]; then
echo "[CRIT] Aborting, wrong context"
exit
fi
@pirafrank
pirafrank / curl.md
Created September 19, 2018 09:13 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@pirafrank
pirafrank / install_couchdb_jessie.sh
Created March 4, 2017 16:39 — forked from MatthieuLemoine/install_couchdb_jessie.sh
Install CouchDB from source on Debian Jessie
#!/bin/bash
# Inspired by http://verbally.flimzy.com/install-couchdb-1-6-1-debian-8-2-jessie/
# Erlang
echo -e "deb http://packages.erlang-solutions.com/debian jessie contrib" | sudo tee /etc/apt/sources.list.d/erlang-solutions.list
wget -qO - http://packages.erlang-solutions.com/debian/erlang_solutions.asc | sudo apt-key add -
# Update packages
sudo apt-get update

Last updated: 2015-08-11

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@pirafrank
pirafrank / .lftp.mockup.rc
Created December 10, 2016 12:05 — forked from gaubert/.lftp.mockup.rc
~/.lftp.rc parameters detailed
########## SETTINGS
# On startup, lftp executes ~/.lftprc and ~/.lftp/rc. You can place aliases and 'set' commands
# there. Some people prefer to see full protocol debug, use 'debug' to turn the debug on.
# Certain commands and settings take a time interval parameter. It has the format Nx[Nx...], where N is time amount
# (floating point) and x is time unit: d - days, h - hours, m - minutes, s - seconds. Default unit is second. E.g.
# 5h30m or 5.5h. Also the interval can be 'infinity', 'inf', 'never', 'forever' - it means infinite interval. E.g.
# 'sleep forever' or 'set dns:cache-expire never'.
@pirafrank
pirafrank / jekyll-and-liquid.md
Created August 31, 2016 12:50 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@pirafrank
pirafrank / search.html
Created August 19, 2016 00:52 — forked from flohei/search.html
An example search page for Jekyll running the jekyll-lunr-js-search plugin.
---
layout: default
permalink: /search/
---
<!--
http://10consulting.com/2013/03/06/jekyll-and-lunr-js-static-websites-with-powerful-full-text-search-using-javascript/
-->
<div class="home">
@pirafrank
pirafrank / version_compare.js
Created February 25, 2016 00:40 — forked from TheDistantSea/version_compare.js
Function to compare two version strings (e.g. "1.6.1" is smaller than "1.7"). Developed in order to answer http://stackoverflow.com/a/6832721/50079.
/**
* Compares two software version numbers (e.g. "1.7.1" or "1.2b").
*
* This function was born in http://stackoverflow.com/a/6832721.
*
* @param {string} v1 The first version to be compared.
* @param {string} v2 The second version to be compared.
* @param {object} [options] Optional flags that affect comparison behavior:
* <ul>
* <li>
@pirafrank
pirafrank / libvips-installer.sh
Created February 3, 2016 22:42 — forked from h2non/libvips-installer.sh
libvips 7.42.x cross-platform simple installer script (supports OSX, Debian, Ubuntu, CentOS, Fedora, Amazon Linux)
#!/bin/sh
#
# Orinally made by Lovell Fuller for sharp
# https://github.com/lovell/sharp
#
# Usage:
# curl -s https://gist.githubusercontent.com/h2non/89bb2f87c6499d0b25f1/raw/bf3d0743107f02f5db2b93c53f7f0e07a1c33112/libvips-installer.sh | sudo bash -
#
@pirafrank
pirafrank / post_to_GitHub.py
Created January 6, 2016 18:48 — forked from MalphasWats/post_to_GitHub.py
Post to GitHub Pages from Editorial
#coding: utf-8
import keychain
import console
import editor
import time
import re
import requests
import json