Skip to content

Instantly share code, notes, and snippets.

View ngoclamtran's full-sized avatar
🎯
Focusing

Lam Tran ngoclamtran

🎯
Focusing
  • Trusting Social
  • Saigon, Vietnam
View GitHub Profile
@tsumarios
tsumarios / revshell.go
Last active November 19, 2020 20:22
Simple TCP reverse shell written in Go. This program expects two arguments: IP address and the port of the remote host. Usage: "go run revshell.go <IP> <port>" or build a binary and run it with both arguments.
package main
import (
"fmt"
"net"
"os"
"os/exec"
)
func main() {
@slok
slok / pprof.md
Last active May 4, 2024 11:28
Go pprof cheat sheet

Enable profiling

Default http server

import (
    _ "net/http/pprof"
    "net/http"
)
@anson-vandoren
anson-vandoren / docker-compose.yml
Created May 21, 2019 01:25
Drone.io (v1.0) docker-compose
version: '3.7'
services:
drone-server:
container_name: drone_server
image: drone/drone:1
ports:
- 8080:80
volumes:
- /var/lib/drone:/data
@jakubigla
jakubigla / Dockerfile
Created December 10, 2018 14:36
Dockerfile for multistage build of spring boot application using maven with SonarQube and proxy support
ARG BUILD_IMAGE=maven:3.5-jdk-11
ARG RUNTIME_IMAGE=openjdk:11-jdk-slim
#############################################################################################
### Stage where Docker is pulling all maven dependencies ###
#############################################################################################
FROM ${BUILD_IMAGE} as dependencies
ARG PROXY_SET=false
ARG PROXY_HOST=
@nicholasjackson
nicholasjackson / Untitled-1
Created October 10, 2018 16:54
Example using Consul Connect and Nginx
# Consul connect and Nginx
## Example docker compose
```yaml
nginx:
image: nginx:latest
volumes:
- ./docker-compose-nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- "8181:80"
@danihodovic
danihodovic / app.js
Created June 25, 2018 17:36
Testing HAProxy backend DNS resolution
const http = require('http');
const os = require('os');
let num = 0;
setTimeout(() => {
console.log(os.hostname(), num);
process.exit(0);
}, 60000);
@merikan
merikan / Jenkinsfile
Last active April 27, 2024 03:58
Some Jenkinsfile examples
Some Jenkinsfile examples
@posener
posener / go-table-driven-tests-parallel.md
Last active April 30, 2024 20:34
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
@fralalonde
fralalonde / METRICS.md
Last active August 23, 2023 16:51
Metrics naming & standards

Metrics are a contract

An application's metrics names and types make up an implicit contract which consequences of ignoring can be serious.

Humans depend on Metrics

Metric are used by systems admins to configure monitoring systems. Good metric names accurately and consistently convey meaning of the associated metric data. Admins should not have to look at the application code to understand what each metric represents. The name of a metric is often the only documentation available. Critical human decisions may have to be quickly made based on metrics, in these situations, their names should be as helpful and trustable as possible.

Machines depend on Metrics

Dashboards and alerting systems entirely depend on the metrics applications provides them. Changing the identifiers or meaning of the metrics will break these downstream applications, negating the very reason to emit metrics in the first place :

  • Alarms that shouldn't have gone off will go off