Skip to content

Instantly share code, notes, and snippets.

@carry0987
carry0987 / RPi3-Auto-WiFi.md
Last active April 17, 2024 04:50
Raspberry Pi 3B+ Auto reconnect to wifi when lost connect

Auto reconnect to wifi when lost connection

Before you start, make sure ip command is available on your system. In modern Linux distributions, ip replaces older ifconfig command. If net-tools package (that includes ifconfig) is not installed and you prefer using it, you can install it via sudo apt-get install net-tools.

Create script file

Use touch /home/pi/wifi-reconnect.sh to create a shell script file, with the following content:

#!/bin/bash
@ZwodahS
ZwodahS / copy_redis_key.sh
Created March 1, 2016 06:07
copy a redis db key to another place (use MIGRATE COPY for v3.0<= redis)
#!/bin/bash
# source http://stackoverflow.com/questions/23222616/copy-all-keys-from-one-db-to-another-in-redis
#set connection data accordingly
source_host=localhost
source_port=6379
source_db=1
target_host=localhost
target_port=6379
target_db=2
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active March 15, 2024 15:56
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

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

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@twolfson
twolfson / .gitignore
Last active March 27, 2020 20:29
Proof of concept to explore media keys for https://github.com/twolfson/google-music-electron/issues/31
node_modules/
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
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
nishanths / main.js
Last active August 7, 2019 23:46
Electron tray: Drag and Drop events demo
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
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
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
@KonradIT
KonradIT / timelapse-assembler.sh
Created May 11, 2014 07:44
Timelapse assembler
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
KonradIT / autoexec.ash
Created January 26, 2014 09:41
Set custom exp, replace iris, gain, and shutter by your custom settings
sleep 2
t ia2 -exp set 1 iris gain shutter
@XueshiQiao
XueshiQiao / gource.sh
Last active November 10, 2019 15:56 — forked from cgoldberg/gource.sh
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://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install