Skip to content

Instantly share code, notes, and snippets.

View arush-sal's full-sized avatar
🏍️
riding

Arush Salil arush-sal

🏍️
riding
View GitHub Profile
@arush-sal
arush-sal / gist:332d9910cadbd89f0e0f49f6d274520f
Last active August 16, 2016 13:37
fail2ban basic config for port 22
#
# WARNING: heavily refactored in 0.9.0 release. Please review and
# customize settings for your setup.
#
# Changes: in most of the cases you should not modify this
# file, but provide customizations in jail.local file,
# or separate .conf files under jail.d/ directory, e.g.:
#
# HOW TO ACTIVATE JAILS:
#

Keybase proof

I hereby claim:

  • I am arush-sal on github.
  • I am salil (https://keybase.io/salil) on keybase.
  • I have a public key ASDaIXog3sq8M35iH5JaLgdez3d2WzkiT1-KyS-s2u1MrAo

To claim this, I am signing this object:

@arush-sal
arush-sal / HelloWorld.java
Created June 16, 2018 21:39
As found in github.com/kubernauts/prometheus_example/tree/master/springboot/uninstrumented
// Define code's package
package com.github.kubernauts.prometheus_example.springboot.uninstrumented;
// import the default Spring Boot packages
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.web.bind.annotation.*;
// Declare the Standard Spring boot annotation for instantiation
@SpringBootApplication
@arush-sal
arush-sal / pom.xml
Created June 16, 2018 22:38
As found in prometheus_example/springboot/instrumented/
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.kubernauts</groupId>
<artifactId>prometheus_example</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
@arush-sal
arush-sal / HelloWorld.java
Created June 16, 2018 22:59
As found at kubernauts/prometheus_example/springboot/instrumented/
package com.github.kubernauts.prometheus_example.springboot.instrumented;
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.web.bind.annotation.*;
// import the Prometheus packages.
import io.prometheus.client.spring.boot.EnablePrometheusEndpoint;
import io.prometheus.client.spring.boot.EnableSpringBootMetricsCollector;
// Prometheus counter package.
import io.prometheus.client.Counter;
@arush-sal
arush-sal / pom.xml
Last active June 17, 2018 01:54
As found at github.com/kubernauts/prometheus_example/springboot/uninstrumented/pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.kubernauts</groupId>
<artifactId>prometheus_example</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
@arush-sal
arush-sal / go-cross-compiler.sh
Created June 28, 2018 10:32
A simple bash script from cross compiling Go binaries by Marko Mudrinić. As found at: https://do.co/2yPiw9b
#!/usr/bin/env bash
package=$1
if [[ -z "$package" ]]; then
echo "usage: $0 <package-name>"
exit 1
fi
package_split=(${package//\// })
package_name=${package_split[-1]}
@arush-sal
arush-sal / latency.txt
Created November 4, 2018 18:42 — 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
apiVersion: v1
data:
tls.crt: base64 encoded cert
tls.key: base64 encoded key
kind: Secret
metadata:
name: testsecret
namespace: default
type: Opaque
apiVersion: extensions/v1beta1
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test
spec:
rules:
- host: foo.bar.com
http:
paths:
- backend: