Skip to content

Instantly share code, notes, and snippets.

View shuklaneerajdev's full-sized avatar
🎯
Focusing

Niraj Shukla shuklaneerajdev

🎯
Focusing
View GitHub Profile
@shuklaneerajdev
shuklaneerajdev / latency.txt
Created January 4, 2022 09:52 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@shuklaneerajdev
shuklaneerajdev / configmap.yaml
Created May 16, 2021 12:53 — forked from jferris/configmap.yaml
Rails Kubernetes Manifests
apiVersion: v1
kind: ConfigMap
metadata:
name: example
namespace: default
data:
APPLICATION_HOST: example.com
LANG: en_US.UTF-8
PIDFILE: /tmp/server.pid
PORT: "3000"
<video id="into-video" class="video-js vjs-default-skin" autoplay controls preload="auto" width="640"
poster="https://mycdn.cloudfront.net/myposter.png">
<source src="https://mycdn.cloudfront.net/video.webm" type='video/webm' />
<source src="https://mycdn.cloudfront.net/video.mp4" type='video/mp4' />
<p class="vjs-no-js">To view this video please enable JavaScript, or consider upgrading your browser.</p>
</video>
@shuklaneerajdev
shuklaneerajdev / 1. ELK.install
Created January 18, 2018 07:30 — forked from PavloBezpalov/1. ELK.install
ELK Stack with Rails (Elasticsearch, Logstash, Kibana) on Ubuntu VPS
INSTALL JAVA
$ sudo apt-get update && sudo apt-get install default-jre
INSTALL ELASTIC SEARCH https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html
$ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
$ echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
$ sudo apt-get update && sudo apt-get install elasticsearch
$ sudo update-rc.d elasticsearch defaults 95 10
$ sudo service elasticsearch restart
$ sudo service elasticsearch status
@shuklaneerajdev
shuklaneerajdev / nginx-config-rails4-with-puma-ssl-version.conf
Created January 17, 2018 17:49 — forked from rkjha/nginx-config-rails4-with-puma-ssl-version.conf
Nginx config for rails 4 application using puma [ssl and non-ssl version]
upstream myapp_puma {
server unix:/tmp/myapp_puma.sock fail_timeout=0;
}
# for redirecting to https version of the site
server {
listen 80;
rewrite ^(.*) https://$host$1 permanent;
}