Skip to content

Instantly share code, notes, and snippets.

carry0987 /
Last active Jun 24, 2022
Raspberry Pi 3B+ Auto reconnect to wifi when lost connect

Auto reconnect to wifi when lost connect

Create script file

Use touch /home/pi/ to create shell script file, with following content:

SSID=$(/sbin/iwgetid --raw) 
ZwodahS /
Created Mar 1, 2016
copy a redis db key to another place (use MIGRATE COPY for v3.0<= redis)
# source
#set connection data accordingly
drmalex07 /
Last active Aug 12, 2022
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward


Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

Description=Setup a secure tunnel to %I
spalladino /
Created Dec 22, 2015
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
nishanths / main.js
Last active Aug 7, 2019
Electron tray: Drag and Drop events demo
View main.js
var app = require('app');
var Menu = require('menu');
var Tray = require('tray');
var appIcon = null;
app.on('ready', function(){
// image is null, so image will not be shown in menu bar
// so click around on the system menu bar to locate the space where the tray icon is
appIcon = new Tray(null);
myusuf3 /
Created Nov 3, 2014
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
mkdir temp
cp *.JPG temp/.
mogrify -resize 200x200 temp/*.JPG
convert temp/*.JPG -delay 10 -morph 5 temp/%05d.jpg
ffmpeg -r 50 -qscale 2 -i temp/%05d.jpg output.mp4
KonradIT / autoexec.ash
Created Jan 26, 2014
Set custom exp, replace iris, gain, and shutter by your custom settings
View autoexec.ash
sleep 2
t ia2 -exp set 1 iris gain shutter
XueshiQiao /
Last active Nov 10, 2019 — forked from cgoldberg/
Generate a MP4 Video for your Git project commits using Gource!
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install