Skip to content

Instantly share code, notes, and snippets.

View clementlecorre's full-sized avatar
🤖
hhuhhh

Clément clementlecorre

🤖
hhuhhh
View GitHub Profile
@ceme
ceme / bash_curl_loop
Last active January 19, 2023 13:07
bash curl loop
while true; do sleep 1; curl http://www.google.com; echo -e '\n\n\n\n'$(date);done
@denji
denji / http-benchmark.md
Last active May 28, 2024 15:48
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@denji
denji / nginx-tuning.md
Last active June 13, 2024 14:05
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@hyg
hyg / gist:9c4afcd91fe24316cbf0
Created June 19, 2014 09:36
open browser in golang
func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@mattes
mattes / check.go
Last active June 12, 2024 19:31
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
}
@lalyos
lalyos / generate-compose.sh
Created April 5, 2015 18:59
generate docker-compose.yml by inspecting a running container
docker-yml() {
docker inspect -f $'
{{.Name}}
image: {{.Config.Image}}
entrypoint: {{json .Config.Entrypoint}}
environment: {{range .Config.Env}}
- {{.}}{{end}}
' $1
}
@sivel
sivel / inventory2json.py
Last active December 19, 2023 01:54
Ansible inventory to dynamic inventory JSON output, accepts all inventory input formats
import sys
import json
from ansible.parsing.dataloader import DataLoader
try:
from ansible.inventory.manager import InventoryManager
A24 = True
except ImportError:
from ansible.vars import VariableManager
@kizbitz
kizbitz / dockerhub-v2-api-organization.sh
Last active June 13, 2024 02:57
Get the list of images and tags for a Docker Hub organization account
#!/bin/bash
# Example for the Docker Hub V2 API
# Returns all images and tags associated with a Docker Hub organization account.
# Requires 'jq': https://stedolan.github.io/jq/
# set username, password, and organization
UNAME=""
UPASS=""
ORG=""
# Virtustream + RackHD use cases
Gabi, Rod, and I had a chance to sit down and go over a broad swath of feedback
related to their use of RackHD in deploying sites. To provide some background,
they've deployed 8 preliminary sites with RackHD, about 50 nodes each, with a
target of orchestrating a typical deployment of 200-250 physical compute servers.
Their configuration has a single RackHD instance per site, and her team (of which
you'll see Jamie, John & David on the Slack channel) is focused entirely on bare metal
verification and provisioning and standing up these sites as efficiently as possible.

Preview

Preview

Description

Displays the number of Bluecars available from an Autolib' station.

Dependencies