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 / 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
@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
@dmpop
dmpop / dweet-ip.sh
Created May 31, 2016 09:02
Send the current local IP address to dweet.io
#!/bin/bash
ping -c1 google.com &>/dev/null
if [ $? -eq 0 ]; then
IP=$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
curl "https://dweet.io/dweet/for/$THING?IP=$IP"
fi
@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 / node-red-twitter
Last active March 31, 2016 08:40
Twitter mentions Node-RED flow
[{"id":"19cbb03a.2ecd3","type":"twitter in","z":"4c5513ea.a4813c","twitter":"","tags":"","user":"false","name":"Mentions","topic":"tweets","x":177.16668701171875,"y":251.16665649414062,"wires":[["4bdfd1e1.404698"]]},{"id":"640bfbf0.4399d4","type":"e-mail","z":"4c5513ea.a4813c","server":"","port":"465","name":"Email","dname":"","x":756.1666870117188,"y":295.1666564941406,"wires":[]},{"id":"4bdfd1e1.404698","type":"function","z":"4c5513ea.a4813c","name":"Modify message","func":"msg.topic = msg.topic.replace(\"tweets/\", \"Twitter mention by \");\nreturn msg;","outputs":1,"noerr":0,"x":450,"y":201,"wires":[["640bfbf0.4399d4"]]}]