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
@mvadu
mvadu / grafana custom.ini
Last active November 11, 2023 18:26
nginx config for using grafana, Influxdb via reverse proxy with authentication
# The full public facing url
#root_url = %(protocol)s://%(domain)s:%(http_port)s/
root_url = http://localhost:80/grafana/
@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
@lovellfelix
lovellfelix / gist:1571bb3ed2d08b8cca9e
Created September 10, 2015 16:58
Make Linux files Immutable. Prevent user from deleting or modifying authorized_keys file
cat ~/.ssh/id_rsa.pub > authorized_keys
chattr +i authorized_keys
rm authorized_keys
rm: remove write-protected regular file `file1'? y
rm: cannot remove `file1': Operation not permitted
# To revert to previous state
chattr -i authorized_keys
#Linux is pretty awesome :)
@chiraggude
chiraggude / nginx-logs.conf
Last active September 7, 2023 02:01
Rsyslog Client nginx conf
$ModLoad imfile
$InputFilePollInterval 10
$PrivDropToGroup adm
#NGINX access file:
# Path to the file which you want to monitor
$InputFileName /home/logs/nginx-access.log
@irazasyed
irazasyed / .htaccess
Created March 11, 2014 23:43
htaccess: Disable URL indexing by crawlers (FOR DEVELOPMENT/STAGE)
# -----------------------------------------------------------------------------------------
# Disable URL indexing by crawlers (FOR DEVELOPMENT/STAGE)
# -----------------------------------------------------------------------------------------
# Avoid search engines (Google, Yahoo, etc) indexing website's content
# http://yoast.com/prevent-site-being-indexed/
# http://code.google.com/web/controlcrawlindex/docs/robots_meta_tag.html
# Matt Cutt (from Google Webmaster Central) on this topic:
# http://www.youtube.com/watch?v=KBdEwpRQRD0
@denji
denji / nginx-tuning.md
Last active May 3, 2024 03:57
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.