Skip to content

Instantly share code, notes, and snippets.

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

@MichaelBitard
MichaelBitard / 85-typematrix.rules
Last active September 27, 2017 09:22
TypeMatrix auto set dvorak mapping when usb is plugged in
ACTION=="add", ATTR{idProduct}=="2030", RUN+="/usr/bin/set_typematrix_dvorak_mapping"
@grimmdude
grimmdude / remove_doop_comments.php
Last active September 23, 2018 18:26
Small script to delete duplicate post comments from a Wordpress database. Backup first bud.
<?php
# First select all comments
$query = "SELECT `comment_ID`, `comment_post_ID`, `comment_content` FROM ".$wpdb->comments." WHERE 1";
$comments = $wpdb->get_results($query);
# Array to hold keeper comment IDs so we don't delete them if there are doops
$keeper_comments = array();
# Now check if each comment has any matching comments from the same post
foreach ($comments as $comment) {
MODULE IO; (*for Oberon0 NW 29.4.2017*)
IMPORT Texts,Oberon;
VAR S: Texts.Scanner; W: Texts.Writer;
PROCEDURE OpenInput*;
BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S)
END OpenInput;
PROCEDURE ReadInt*(VAR x: LONGINT);
BEGIN x := S.i; Texts.Scan(S)
@hSATAC
hSATAC / gist:3810421
Created October 1, 2012 08:56
vpn-ssh
#!/bin/sh
# /usr/local/bin/vpn-pppssh
#
# This script initiates a ppp-ssh vpn connection.
# see the VPN PPP-SSH HOWTO on http://www.linuxdoc.org for more information.
#
# revision history:
# 1.6 11-Nov-1996 miquels@cistron.nl
# 1.7 20-Dec-1999 bart@jukie.net
# 2.0 16-May-2001 bronson@trestle.com
@g7
g7 / sfos_backup.md
Last active June 8, 2021 09:41
Backup SailfishOS data

Transfer data to another SailfishOS phone

Recently I had to move my data between two SailfishOS phones.
I don't really like the new Backup application available since 2.0.2, so I mostly moved things by hand.

This document contains scattered thoughts about this process.

Dumping the image (from recovery)

@justinmeiners
justinmeiners / jonesforth.f.txt
Last active October 1, 2021 22:14
How to write a Forth compiler. Mirror of Jonesforth (I did not write this.)
\ -*- text -*-
\ A sometimes minimal FORTH compiler and tutorial for Linux / i386 systems. -*- asm -*-
\ By Richard W.M. Jones <rich@annexia.org> http://annexia.org/forth
\ This is PUBLIC DOMAIN (see public domain release statement below).
\ $Id: jonesforth.f,v 1.17 2007/10/12 20:07:44 rich Exp $
\
\ The first part of this tutorial is in jonesforth.S. Get if from http://annexia.org/forth
\
\ PUBLIC DOMAIN ----------------------------------------------------------------------
\
@GasparVardanyan
GasparVardanyan / fptr.c
Last active October 11, 2021 14:44
Something useful about function pointers in C.
# include <stdio.h>
# include <stddef.h>
// x: A function taking short and returning char.
char x (short); // Usage: char c = x ('H');
// x (); // A function
// x (short); // taking short
// char x (short); // and returning char.
// y: A pointer to a function taking short and returning char.
@EdoardoVignati
EdoardoVignati / read.s
Created October 25, 2018 07:24
Read from stdin and print input - AT&T assembly
#################
# How to run #
#################
# $ as --gstabs read.s -o read.o
# $ ld read.o -o read
# $ ./read
################
.text
@laurenarcher
laurenarcher / livestreamingyoutube
Created November 21, 2014 14:13
Livestreaming to Youtube Live, Ubuntu, Linux FFMPEG
Terminal Commands:
One webcam:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE
Two webcam overlay:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -f v4l2 -s 320x240 -r 10 -i /dev/video0 -filter_complex "[1:v]setpts=PTS-STARTPTS[bg]; [2:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=shortest=1 [out]" -map "[out]" -map 0:a -vcodec libx264 -pix_fmt yuv420p -preset veryfast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE