Skip to content

Instantly share code, notes, and snippets.

View gilangvperdana's full-sized avatar
🎓
Still Learning

Gilang Virga Perdana gilangvperdana

🎓
Still Learning
View GitHub Profile
@denji
denji / nginx-tuning.md
Last active April 26, 2024 11:21
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.

@sdmoko
sdmoko / OpenStack-instances-monitoring-with-Prometheus-Grafana.md
Created November 1, 2019 12:35
Step by step to Monitoring OpenStack Instances with Service Discovery Prometheus and Grafana

Create Instances for Prometheus Server and Grafana

Download Prometheus Server

cd /tmp
wget -c https://github.com/prometheus/prometheus/releases/download/v2.13.1/prometheus-2.13.1.linux-amd64.tar.gz

Extract Prometheus Server

@taoyuan
taoyuan / generate_self_signed_certification.md
Last active April 24, 2024 07:46
Generation of a Self Signed Certificate

Generation of a Self Signed Certificate

Generation of a self-signed SSL certificate involves a simple 3-step procedure:

STEP 1: Create the server private key

openssl genrsa -out cert.key 2048

STEP 2: Create the certificate signing request (CSR)

openssl req -new -key cert.key -out cert.csr
@cyberwani
cyberwani / .htaccess
Created August 10, 2018 09:39
Block the HTTRACK using HTACCESS files
Options All -Indexes
# Ultimate htaccess Blacklist 2 from Perishable Press
# Deny domain access to spammers and other scumbags
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ADSARobot|ah-ha|almaden|aktuelles|Anarchie|amzn_assoc|ASPSeek|ASSORT|ATHENS|Atomz|attach|attache|autoemailspider|BackWeb|Bandit|BatchFTP|bdfetch|big.brother|BlackWidow|bmclient|Boston\ Project|BravoBrian\ SpiderEngine\ MarcoPolo|Bot\ mailto:craftbot@yahoo.com|Buddy|Bullseye|bumblebee|capture|CherryPicker|ChinaClaw|CICC|clipping|Collector|Copier|Crescent|Crescent\ Internet\ ToolPak|Custo|cyberalert|DA$|Deweb|diagem|Digger|Digimarc|DIIbot|DISCo|DISCo\ Pump|DISCoFinder|Download\ Demon|Download\ Wonder|Downloader|Drip|DSurf15a|DTS.Agent|EasyDL|eCatch|ecollector|efp@gmx\.net|Email\ Extractor|EirGrabber|email|EmailCollector|EmailSiphon|EmailWolf|Express\ WebPictures|ExtractorPro|EyeNetIE|FavOrg|fastlwspider|Favorites\ Sweeper|Fetch|FEZhead|FileHound|FlashGet\ WebWasher|FlickBot|fluffy|FrontPage|GalaxyBot|Generic|Getleft|GetRight|
@mamonu
mamonu / qcow2vdi.sh
Last active April 22, 2024 09:39
convert a qcow2 vm to a VirtualBox vm format
qemu-img convert -O vdi gnome.qcow2 gnome.vdi
#if its a raw image then:
VBoxManage convertdd opnstk.raw VBox.vdi --format VDI
@jaskiratr
jaskiratr / chmod-400.cmd
Created June 29, 2018 01:03
Set permission of file equivalent to chmod 400 on Windows.
# Source: https://stackoverflow.com/a/43317244
$path = ".\aws-ec2-key.pem"
# Reset to remove explict permissions
icacls.exe $path /reset
# Give current user explicit read-permission
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
# Disable inheritance and remove inherited permissions
icacls.exe $path /inheritance:r
@phiberoptick
phiberoptick / pritunl-server-custom-ssl_manually
Last active April 20, 2024 21:51
Use custom SSL cert in Pritunl Server Community
Ignore all that craziness below. These can be set from the cli with the "pritunl" command.
The commands below can be used to get/set the values of the cert, key, port and if the :80 -> "app.server_port" redirect is active.
# Get current SSL server cert:
pritunl get app.server_cert
# Get current SSL server key:
pritunl get app.server_key
@chriswayg
chriswayg / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Last active April 20, 2024 00:05
Ubuntu and Debian Cloud images in Proxmox
@ChuckMichael
ChuckMichael / vcredistr.md
Last active April 19, 2024 21:47
Visual C++ Redistributable Packages
@dpino
dpino / ns-inet.sh
Last active April 19, 2024 18:12
Setup a network namespace with Internet access
#!/usr/bin/env bash
# set -x
if [[ $EUID -ne 0 ]]; then
echo "You must be root to run this script"
exit 1
fi
# Returns all available interfaces, except "lo" and "veth*".