Skip to content

Instantly share code, notes, and snippets.

View hackerzhut's full-sized avatar

Sara hackerzhut

View GitHub Profile
@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 / 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


@hackerzhut
hackerzhut / Dockerfile
Created March 28, 2018 04:53 — forked from profjsb/Dockerfile
Refreshing Materialized Views in Postgres using Docker
# Dockerfile to run the cron jobs in root, including python/psycopg2
FROM alpine:edge
RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing py-psycopg2
EXPOSE 6000
COPY refresh.py /refresh.py
COPY root /var/spool/cron/crontabs/root
CMD crond -l 2 -f
@hackerzhut
hackerzhut / Optimize_read_path.md
Created February 28, 2019 04:09 — forked from MakMukhi/Optimize_read_path.md
gRPC-Go: Optimize read path

gRPC-Go: Optimize read path

Status: (Final)

Authors: [email protected]

Reviewers: dfawley@, menghanl@, yuxuanli@, psrini@

Last Updated: 2018-02-25

@hackerzhut
hackerzhut / k8s-svc-annotations.md
Created March 4, 2019 07:32 — forked from mgoodness/k8s-svc-annotations.md
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)