NOTE -
- Remove -h option if you are doing operation on same machine
- Remove -u , -p option if your database don't have username and password
Import database
mongorestore -h IP:port -d DB_Name -u user_name -p password <input db directory>
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<title>Enterprisify your Java Class Names! (by Hay Kranen)</title> | |
<style> | |
body { | |
background: white; | |
text-align: center; |
from multiprocessing.process import Process | |
import time | |
import redis | |
def pub(myredis): | |
for n in range(10): | |
myredis.publish('channel','blah %d' % n) | |
time.sleep(5) | |
def sub(myredis, name): |
-- a quick LUA access script for nginx to check IP addresses against an | |
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403. | |
-- | |
-- allows for a common blacklist to be shared between a bunch of nginx | |
-- web servers using a remote redis instance. lookups are cached for a | |
-- configurable period of time. | |
-- | |
-- block an ip: | |
-- redis-cli SADD ip_blacklist 10.1.1.1 | |
-- remove an ip: |
import android.app.Activity; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.drawable.AnimationDrawable; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.ImageView; |
import android.graphics.Bitmap; | |
/** | |
* Created by paveld on 3/6/14. | |
*/ | |
public class FastBlur { | |
public static Bitmap doBlur(Bitmap sentBitmap, int radius, boolean canReuseInBitmap) { | |
// Stack Blur v1.0 from |
# Ask for the user password | |
# Script only works if sudo caches the password for a few minutes | |
sudo true | |
# Install kernel extra's to enable docker aufs support | |
# sudo apt-get -y install linux-image-extra-$(uname -r) | |
# Add Docker PPA and install latest version | |
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
#!/usr/bin/env python | |
# | |
# DNS Result Comparison Utility | |
# Author: https://twitter.com/chair6 | |
# | |
import argparse | |
import dns.resolver | |
import dns.rdatatype | |
from collections import defaultdict |
#!/usr/bin/env python | |
import dns.resolver | |
import dns.name | |
#import netaddr | |
from urlparse import urlparse | |
INFO = "\033[1m\033[36m[*]\033[0m " |
# http://www.idiotinside.com/2015/02/13/get-number-of-likes-of-a-facebook-page-using-graph-api-in-python/ | |
import urllib2 | |
import json | |
def get_page_data(page_id,access_token): | |
api_endpoint = "https://graph.facebook.com/v2.4/" | |
fb_graph_url = api_endpoint+page_id+"?fields=id,name,likes,link&access_token="+access_token | |
try: | |
api_request = urllib2.Request(fb_graph_url) |