Skip to content

Instantly share code, notes, and snippets.

View dmpop's full-sized avatar
🇺🇦

Dmitri Popov dmpop

🇺🇦
View GitHub Profile
/*
* Hello world web server
* circuits4you.com
*/
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
//SSID and Password to your ESP Access Point
const char* ssid = "ESP8266";
@dmpop
dmpop / unsplash-random.sh
Last active September 18, 2017 21:31
Use random photos from Unsplash as a desktop background on Ubuntu
#!/bin/bash
uuser="unsplash_user_name"
path="path/to/dir"
size=$(xdpyinfo | grep dimensions | awk '{print $2}')
curl "https://source.unsplash.com/user/$uuser/$size" --location --output $path/unsplash-random.jpeg
gsettings set org.gnome.desktop.background picture-uri file://$path/unsplash-random.jpeg
@dmpop
dmpop / digikam_metadata.sh
Last active July 10, 2017 12:47
Bash shell script to extract camera and lense data from the digikam4.db database
#!/bin/bash
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@dmpop
dmpop / neonasms.txt
Last active May 18, 2017 12:26
THe doc team bEINg Crateive agiaN
abschnecken
nirgendwas
dement sprechend, dement schweigend
Nussschnecke - Frollein, das zwar nicht clever, aber dafür schön ist
bemitneiden
writearound
Schnexitus
Schnexit
Schneckopocalypse -> Schnec(k)olypse!
clusterfake - Sven's Raspberry Pi 3 Ceph cluster
#!/bin/bash
# DESCRIPTION
# -----------
# The xml2exif Bash shell script extracts aperture, shutter speed, and ISO from an XML file generated by
# the Photographer's Notebook app (https://play.google.com/store/apps/details?id=unisiegen.photographers.activity)
# and writes the obtained values into the specified photo.
# DEPENDENCIES
# ------------
@dmpop
dmpop / show-on-osm.sh
Last active January 13, 2017 15:52
Show geotagged photo on OpenStreetMap
#!/usr/bin/env bash
lat=`exiftool -n -p '$GPSlatitude' $1`
lon=`exiftool -n -p '$GPSlongitude' $1`
osm="http://www.openstreetmap.org/?mlat=$lat&mlon=$lon&zoom=18"
xdg-open $osm
@dmpop
dmpop / filedrop.py
Last active November 10, 2016 13:05
Simple file drop palette in Python
#!/usr/bin/python
# filedrop.py
# http://zetcode.com/wxpython/draganddrop/
import wx, os, shutil, ntpath
dest_dir = '/home/user/backup/'
if not os.path.exists(dest_dir):
@dmpop
dmpop / microbit-intervalometer.py
Last active August 3, 2016 11:57
BBC micro:bit-based intervalometer
from microbit import *
a = 0
b = 0
while True:
if button_a.is_pressed():
a = a + button_a.get_presses()
display.scroll(str(a))
if button_b.is_pressed():
b = b + button_b.get_presses()
display.scroll(str(b))
@dmpop
dmpop / exiftool-helper.sh
Created July 11, 2016 07:45
Helper script for using ExifTool
#!/bin/bash
#OPTIND=1
while getopts "h?sdyar" opt; do
case $opt in
s) exiftool -directory=%e .
;;
d) exiftool -d %Y%m%d-%H%M%S.%%e '-FileName<DateTimeOriginal' -r .
;;
y) exiftool '-Directory<CreateDate' -d %Y-%m-%d -r .
;;
@dmpop
dmpop / latlon.sh
Last active July 4, 2016 19:52
Convert latitude and longitude values to digiKam-compatible format
#!/bin/bash
latlon="geo:"$(xclip -o | tr -d ' ')
notify-send $latlon -i info
echo $latlon | xclip -selection c