Skip to content

Instantly share code, notes, and snippets.

@bbinet
bbinet / pepper_format.py
Last active March 15, 2021 14:13
Use salt outputters to format pepper output, see https://github.com/saltstack/pepper/issues/3
#!/home/bruno/.virtualenvs/salt/bin/python
"""
This script formats pepper output using salt outputters.
It can both format sync and async jobs, and can be used in the following ways:
```
$ pepper \* state.sls core | pepper_format.py -o highstate
$ pepper --client=local_async \* state.highstate | pepper_format.py
$ pepper_format.py 20170504160400750792
```
@justjanne
justjanne / Price Breakdown.md
Last active April 11, 2024 22:21 — forked from kylemanna/price.txt
Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Permalink: git.io/vps

$5/mo

Provider Type RAM Cores Storage Transfer Network Price
@jsh2134
jsh2134 / gist:14027c69464498bc8ed2
Created July 12, 2015 21:24
HekaSockerHandler logging implementation
import traceback
import logging
from logging.handlers import SocketHandler
import heka
class HekaSocketHandler(SocketHandler):
SEVERITY_MAP = {
@sentinelt
sentinelt / gist:3f1a984533556cf890d9
Created February 6, 2015 18:44
Program to set arbitrary speed
/*
* Allows to set arbitrary speed for the serial device on Linux.
* stty allows to set only predefined values: 9600, 19200, 38400, 57600, 115200, 230400, 460800.
*/
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <asm/termios.h>
int main(int argc, char* argv[]) {

Last updated: 2017-03-18

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

#! /bin/bash
# certificates are valids during 365 days
VALID=365
TMPPASS="test"
while [[ -z "$password" ]]
do
read -s -p "Enter password for the Certificate Authority (CA) key: " password
echo
#!/usr/bin/env python3
"""Backs up data-only volumes to host backup directory using rdiff-backup.
First create a Docker image containing rdiff-backup (named rdiff-backup)
Dockerfile:
FROM ubuntu:precise
RUN apt-get update && apt-install -qy rdiff-backup
``docker build -rm -t rdiff-backup .``
@gnarf
gnarf / ..git-pr.md
Last active April 12, 2024 22:00
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@mathieue
mathieue / udp-multi-socat.sh
Created August 28, 2012 23:57
udp multiplexer with socat
socat - udp4-listen:8125,fork | tee >(socat - udp-sendto:127.0.0.1:8135) >(socat - udp-sendto:127.0.0.1:8140)
@tonio
tonio / mapping.vim
Created June 26, 2012 12:55
know vim mappings
:new
:redir @"
:verbose map
:map!
:redir END
p