Skip to content

Instantly share code, notes, and snippets.

Avatar

Dmitri Popov dmpop

View GitHub Profile
@dmpop
dmpop / install-little-backup-box-linux-mint.sh
Created Jul 6, 2020
Little Backup Box installation script for Linux Mint
View install-little-backup-box-linux-mint.sh
#!/usr/bin/env bash
# Author: Dmitri Popov, dmpop@linux.com
#######################################################################
# 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.
@dmpop
dmpop / multi-file-upload.php
Created Feb 21, 2019
PHP script to upload multiple files
View multi-file-upload.php
<?php
if(isset($_POST['submit'])){
// Count total files
$countfiles = count($_FILES['file']['name']);
// Looping all files
for($i=0;$i<$countfiles;$i++){
$filename = $_FILES['file']['name'][$i];
View did
function did {
dir="$HOME/did/"
d="$dir"$(date '+%Y-%m-%d')".md"
emacs "$d" --eval "(goto-char (point-max))"
}
@dmpop
dmpop / ledctrl.ino
Created Mar 15, 2018
Control LED with NodeMCU in the AP mode
View ledctrl.ino
/*
* Sketch: ESP8266_LED_Control_02
* Control an LED from a web browser
* Intended to be run on an ESP8266
*
* connect to the ESP8266 AP then
* use web broswer to go to 192.168.4.1
*
*/
@dmpop
dmpop / flash-trigger.ino
Created Nov 10, 2017
NodeMCU optical flash trigger
View flash-trigger.ino
const int statusPin = LED_BUILTIN; // status LED pin
const int flashPin = D1; // flash pin
const int ldrPin = A0; // select the input pin for the LDR
//const int pwrPin = A3; // power pin
int sensorValue = 0; // variable to store the value coming from the LDR
void setup()
{
pinMode(ldrPin,INPUT);
pinMode(statusPin, OUTPUT);
View esp8266webserver
/*
* 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 / ap-setup.sh
Last active Oct 11, 2017 — forked from Lewiscowles1986/rPi3-ap-setup.sh
Setting up Raspberry Pi 3 as an access point
View ap-setup.sh
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "This script requires root privileges"
exit
fi
if [[ $# -lt 1 ]];
then echo "Please specify a password"
echo "Usage:"
@dmpop
dmpop / neonasms.txt
Last active May 18, 2017
THe doc team bEINg Crateive agiaN
View neonasms.txt
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 Jan 13, 2017
Show geotagged photo on OpenStreetMap
View show-on-osm.sh
#!/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 Nov 10, 2016
Simple file drop palette in Python
View filedrop.py
#!/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):
You can’t perform that action at this time.