Skip to content

Instantly share code, notes, and snippets.

@yblee85
yblee85 / ubuntu - daily backup setup.txt
Created May 23, 2021 01:56
ubuntu / daily backup setup
View ubuntu - daily backup setup.txt
1. /usr/local/bin/mybackup.sh
#!/bin/bash
#
# couchdb Backup Script
# VER. 0.1
#If it takes a while, Diamond will grab this file and send it to Graphite to graph the duration of the backup.
date > /tmp/backup-couchdb
BASEDIR="/data/couchdb"
BACKUPDIR="/bkp/couchdb"
EXCLUDES="/data/shared/my_excludes.txt"
@yblee85
yblee85 / distance.js
Created January 30, 2020 20:53 — forked from mattpowell/distance.js
Get the distance between two (world) coordinates - a nodejs module
View distance.js
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* */
/* Simple node js module to get distance between two coordinates. */
/* */
/* Code transformed from Chris Veness example code - please refer to his website for licensing */
/* questions. */
/* */
/* */
/* Latitude/longitude spherical geodesy formulae & scripts (c) Chris Veness 2002-2011 */
/* - www.movable-type.co.uk/scripts/latlong.html */
@yblee85
yblee85 / temporary-email-address-domains
Created September 26, 2017 14:52 — forked from adamloving/temporary-email-address-domains
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
View temporary-email-address-domains
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@yblee85
yblee85 / redis_delete_keys_pattern.sh
Created June 7, 2017 20:53 — forked from JeromeParadis/redis_delete_keys_pattern.sh
Redis: How delete keys matching a pattern?
View redis_delete_keys_pattern.sh
redis-cli KEYS "prefix:*" | xargs redis-cli DEL
View gist:a8c8bfafe8853515b32972160e5a00d9
NOTE : First commit your current changes, or you will lose them.
Then run the following commands from the top folder of your git repo:
git rm -r --cached .
git add .
git commit -m "fixed untracked files"
source : http://stackoverflow.com/questions/11451535/gitignore-is-not-working
@yblee85
yblee85 / git_replace_master_with_a_branch.txt
Created April 27, 2016 14:38
Git (replace master with a branch)
View git_replace_master_with_a_branch.txt
// sometimes accidently you switched to a branch and working on it
// and forgot to merge with master for a long long time
// now it would be really difficult to merge with master
// this will basically replace master with a branch
// say, you have a master and a branch named "branch1"
git checkout branch1
git merge -s ours master
git checkout master
git merge branch1
@yblee85
yblee85 / readme.txt
Created October 22, 2015 17:24
Create Bootable USB from directory in Windows
View readme.txt
//command line
diskpart
//diskpart command line
list disk
//it will show disk
// disk0, 1, 2
select disk 2
clean
@yblee85
yblee85 / updateFavicon.js
Created September 23, 2015 21:48
update favicon dynamically
View updateFavicon.js
function updateFavicon(faviconURL) {
var src = faviconURL;
var head_node = document.head || document.getElementsByTagName('head')[0];
var link = document.createElement('link'),
oldLink = document.getElementById('favicon');
link.id = 'favicon';
link.rel = 'shortcut icon';
link.href = src;
if (oldLink) {
head_node.removeChild(oldLink);
@yblee85
yblee85 / includeCSS.js
Created September 23, 2015 21:47
include CSS file / add new CSS
View includeCSS.js
function includeCSSfile(href) {
var head_node = document.head || document.getElementsByTagName('head')[0];
var link_tag = document.createElement('link');
link_tag.setAttribute('rel', 'stylesheet');
link_tag.setAttribute('type', 'text/css');
link_tag.setAttribute('href', href);
head_node.appendChild(link_tag);
}
@yblee85
yblee85 / gist:50da5b708b7c7470762c
Created September 17, 2015 16:20
Bootable USB from directory in Windows
View gist:50da5b708b7c7470762c
//command line
diskpart
//diskpart command line
list disk
//it will show disk
// disk0, 1, 2
select disk 2
clean