Skip to content

Instantly share code, notes, and snippets.

View hackerzhut's full-sized avatar

Sara hackerzhut

View GitHub Profile
@hackerzhut
hackerzhut / es_gist
Created February 28, 2013 05:39
[ERROR] elasticsearch mongodb river - filter is null
[2013-02-28 13:29:02,102][INFO ][cluster.metadata ] [Kl'rt] [_river] creating index, cause [auto(index api)], shards [1]/[1], mappings []
[2013-02-28 13:29:02,249][INFO ][cluster.metadata ] [Kl'rt] [_river] update_mapping [mongodb] (dynamic)
[2013-02-28 13:29:02,290][INFO ][river.mongodb ] [Kl'rt] [mongodb][mongodb] river name [org.elasticsearch.river.RiverName@35f80e40] monitoring namespace [profile.person]
[2013-02-28 13:29:02,290][INFO ][river.mongodb ] [Kl'rt] [mongodb][mongodb] starting mongodb stream: host [localhost], port [27017], gridfs [false], filter [null], db [profile], indexing to [mongoindex]/[person]
[2013-02-28 13:29:02,325][INFO ][cluster.metadata ] [Kl'rt] [mongoindex] creating index, cause [api], shards [5]/[1], mappings []
[2013-02-28 13:29:02,480][INFO ][river.mongodb ] [Kl'rt] [mongodb][mongodb] Start indexer thread.
[2013-02-28 13:29:02,482][INFO ][river.mongodb ] [Kl'rt] [mongodb][mongodb] Start tailer thread.
[2013-0
@hackerzhut
hackerzhut / imageResize.js
Created July 1, 2014 02:30
Resize image using Graphicsmagick and upload using S3
gm(request(url))
.resize("80^", "80^")
.stream(function (err, stdout, stderr) {
var chunks = [];
stdout.on('data', function (chunk) {
chunks.push(chunk);
});
stdout.on('end', function () {
var image = Buffer.concat(chunks);
var options = {
@hackerzhut
hackerzhut / README.md
Last active August 29, 2015 14:06 — forked from rantav/README.md

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...

@hackerzhut
hackerzhut / gist:0edfab8ad2c2563cb588
Created November 23, 2014 04:37
Stanford NLP Output
{
"annotations": [
{
"annotation": "This is the shit",
"coreMaps": [
{
"sentence": "This is the shit",
"tree": {
"0": {
"value": [
@hackerzhut
hackerzhut / index.md
Last active August 29, 2015 14:11 — forked from rstacruz/index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@hackerzhut
hackerzhut / 0_reuse_code.js
Created January 11, 2016 00:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hackerzhut
hackerzhut / nginxproxy.md
Created February 24, 2016 05:40 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@hackerzhut
hackerzhut / README.md
Created September 30, 2017 11:11 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed