Skip to content

Instantly share code, notes, and snippets.

View ShineSmile's full-sized avatar
🍋
I may be slow to respond.

Shine ShineSmile

🍋
I may be slow to respond.
View GitHub Profile
@aessing
aessing / install-AzCopy.ps1
Last active January 30, 2024 12:59
Install AzCopy on Windows (PowerShell)
# =============================================================================
# Install AzCopy on Windows (PowerShell)
# https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10
# https://github.com/Azure/azure-storage-azcopy
# -----------------------------------------------------------------------------
# Developer.......: Andre Essing (https://www.andre-essing.de/)
# (https://github.com/aessing)
# (https://twitter.com/aessing)
# (https://www.linkedin.com/in/aessing/)
# -----------------------------------------------------------------------------
@avishayp
avishayp / Dockerfile
Created September 25, 2018 19:02
Add non-root user for alpine linux
# non root user example for alpine
#
# usage:
# $ docker build --build-arg "USER=someuser" --tag test .
# $ docker run --rm test
FROM alpine
ARG USER=default
ENV HOME /home/$USER
@yougg
yougg / proxy.md
Last active April 7, 2024 04:02
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@euyuil
euyuil / SetupWinRM.ps1
Created October 21, 2016 10:18
WinRM: Enable WinRM and create an HTTPS listener with self-signed certificate.
Param ($DnsName)
$Cert = New-SelfSignedCertificate -CertStoreLocation Cert:\LocalMachine\My -DnsName $DnsName -Verbose
$Password = ConvertTo-SecureString -String $DnsName -Force -AsPlainText -Verbose
Export-Certificate -Cert $Cert -FilePath .\$DnsName.cer -Verbose
Export-PfxCertificate -Cert $Cert -FilePath .\$DnsName.pfx -Password $Password -Verbose
$CertThumbprint = $Cert.Thumbprint
@sirsquidness
sirsquidness / proxy.conf
Created September 22, 2016 12:42
How to have nginx proxy_pass follow upstream 302 redirects (eg, when you're running a steam cache and you're behind Cox's layer 7 interception stuff)
# This config came around after a friend had problems with a Steam cache on his
# Cox internet connection. Cox would intercept any requests to Steam content
# servers and return a 302 to Cox's servers. The cache would return the 302
# to the Steam client, and the Steam client would go directly to Cox, bypassing
# the cache.
# This config makes nginx follow the 302 itself, and caches the result of the
# redirect as if it was the response to the original request. So subsequent
# requests to the URL that returned a 302 will get the file instead of a 302.
@JonCole
JonCole / Redis-BestPractices-General.md
Last active April 18, 2024 07:57
Redis Best Practices

Some of the Redis best practices content has moved

This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.

NOTE: Client specific guidance listed below is still valid and should still be considered. I will update this document once all content has been moved.

@JonCole
JonCole / AzureRedis-PatchingExplained.md
Last active October 22, 2019 17:28
AzureRedis-PatchingProces
@fipar
fipar / mongodb.json
Last active November 10, 2020 05:44
Basic Grafana dashboard for MongoDB metrics (data source: https://github.com/dcu/mongodb_exporter)
{
"id": 1,
"title": "MongoDB",
"originalTitle": "MongoDB",
"tags": [],
"style": "dark",
"timezone": "browser",
"editable": true,
"hideControls": false,
"sharedCrosshair": false,
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@denji
denji / nginx-tuning.md
Last active April 24, 2024 19:39
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.