Skip to content

Instantly share code, notes, and snippets.

@jonathan-kosgei
jonathan-kosgei / docker_clean_ci.sh
Last active July 15, 2017 07:18
Delete all images in order of dependency excluding selected base images for faster builds
#!/bin/bash
function list_include_item { local list="$1"; local item="$2"; if [[ $list =~ (^|[[:space:]])"$item"($|[[:space:]]) ]] ; then result=0; else result=1; fi; return $result;};
bases="alpine:latest nginx:1.11.3-alpine"
delete=
# append latest tag to each image
for item in $(docker images --format "{{.Repository}}:{{.Tag}}@{{.ID}}")
do
export IFS=' '
IFS='@'; arr=($item); unset IFS;
@thaJeztah
thaJeztah / whiteboardCleaner.md
Created August 5, 2016 11:02 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

const mailgun = require('mailgun-js')({apiKey: api_key, domain: domain});
const twilio = new require('twilio')(accountSid, authToken);
export default function notify (to, msg, options) {
if (Array.isArray(to)) {
to.forEach((toSingle) => notify(toSingle, msg, options));
return;
}
if (to.includes("@")) {
@marckohlbrugge
marckohlbrugge / unread_only.js
Created May 3, 2018 11:42
Hides all read chats so you only see unread chats. Save this as a bookmarklet with https://mrcoles.com/bookmarklet/ and run on https://web.telegram.org/#/im
$(".im_dialog_wrap .im_dialog_badge.ng-hide").each(function(index, el){$(el).parents("li.im_dialog_wrap").addClass("ng-hide");});
@hawkup
hawkup / Install etcd On Ubuntu 14.04.md
Created July 4, 2015 22:06
Install etcd On Ubuntu 14.04
  • Install
curl -L  https://github.com/coreos/etcd/releases/download/v2.1.0-rc.0/etcd-v2.1.0-rc.0-linux-amd64.tar.gz -o etcd-v2.1.0-rc.0-linux-amd64.tar.gz
tar xzvf etcd-v2.1.0-rc.0-linux-amd64.tar.gz
cd etcd-v2.1.0-rc.0-linux-amd64
./etcd
  • by default etcd listening on port 2379 for client communication and on port 2380 for server to server communication

  • Test

@mattsornson
mattsornson / geckoboard_madkudu_points_based
Created April 4, 2017 12:42
Geckboard's Point Based Lead Score
CASE
WHEN employees >= 500 THEN 50
WHEN employees >= 100 THEN 40
WHEN employees >= 50 THEN 10
WHEN employees >= 25 THEN 5
WHEN employees >= 10 THEN 3
ELSE -2
END
+
CASE
@mediaupstream
mediaupstream / ltc-mining.sh
Last active October 12, 2020 11:49
Litecoin CPU Mining setup on Ubuntu Server
#!/bin/bash
#
# Litecoin CPU Mining setup on Ubuntu Server
#
sudo apt-get update;
# install prerequisit software/libs
sudo apt-get -y install make automake build-essential libcurl4-openssl-dev htop
@phinze
phinze / main.tf.js
Last active June 14, 2021 23:20
Terraform Example: ebs_block_device that remains after instance termination
resource "aws_instance" "web" {
ami = "ami-7f89a64f"
instance_type = "t1.micro"
ebs_block_device {
device_name = "/dev/sdg"
volume_size = 5
volume_type = "gp2"
delete_on_termination = false
}
}
@lcherone
lcherone / disposable-email-provider-domains
Last active December 26, 2021 19:02
List of disposable email provider domains
0815.ru
0815.ru0clickemail.com
0815.ry
0815.su
0845.ru
0clickemail.com
0-mail.com
0wnd.net
0wnd.org
10mail.com
@eugenehp
eugenehp / reverse-ip-lookup.js
Created July 8, 2012 14:58
node.js IP reverse lookup
var dns = require('dns');
function reverseLookup(ip) {
dns.reverse(ip,function(err,domains){
if(err!=null) callback(err);
domains.forEach(function(domain){
dns.lookup(domain,function(err, address, family){
console.log(domain,'[',address,']');
console.log('reverse:',ip==address);