Skip to content

Instantly share code, notes, and snippets.

View salehi's full-sized avatar

SS Salehi salehi

View GitHub Profile
@jirutka
jirutka / rules-both.iptables
Created September 18, 2012 12:42
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@alexjs
alexjs / cors-nginx.conf
Created November 28, 2012 22:42 — forked from michiel/cors-nginx.conf
Slightly tighter CORS config for nginx
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#
@fuzzmz
fuzzmz / email.sh
Created March 30, 2013 22:55
Script to send email on Debian based server at shutdown and restart.
#!/bin/sh
### BEGIN INIT INFO
# Provides: SystemEmail
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Send email
# Description: Sends an email at system start and shutdown
### END INIT INFO
@trey
trey / gist:5373343
Last active September 18, 2019 21:20
Free Marvel #1s
15-Love #1
5 Ronin #1 (of 5)
A + X #1
A-Babies vs. X-Babies #1
AVX: Consequences #1 (of 5)
AVX: VS. #1 (of 6)
Age of Apocalypse #1
Age of Apocalypse: Sinister Bloodlines
Age of X Universe #1 (of 2)
Age of X: Alpha #1
@denji
denji / nginx-tuning.md
Last active July 3, 2024 22:18
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.

@spectra
spectra / qemu-debian-create-image
Last active June 30, 2017 13:18
Debian qemu image creation using debootstrap (automated from http://diogogomes.com/2012/07/13/debootstrap-kvm-image/ by Kamil Trzcinski (http://ayufan.eu) with some modifications by me)
#!/bin/bash
# Configs
VSYSTEM=qemu # Either 'qemu' or 'kvm'
INCLUDES='less,vim,sudo,openssh-server,acpid'
MIRROR="http://ftp.br.debian.org/debian"
ARCH=686
clean_debian() {
[ "$MNT_DIR" != "" ] && chroot $MNT_DIR umount /proc/ /sys/ /dev/ /boot/
@bonsaiviking
bonsaiviking / NmapHeartbleed.md
Last active September 20, 2021 23:31
Guide to using Nmap to scan for the Heartbleed bug.

Requirements

  1. Nmap. The script requires version 6.25 or newer. The latest version, 6.47, already includes the next 3 dependencies, so you can skip directly to the Scanning section below.
    • An easy way to get the latest Nmap release is to use Kali Linux.
    • Binary installers are available for Windows.
    • RPM installer available for Linux, or install from source.
    • .dmg installer available for Mac OS X.
  2. tls.lua. The script requires this Lua library for TLS handshaking.
  3. ssl-heartbleed.nse. This is the script itself.
@arkadijs
arkadijs / install.md
Last active January 6, 2022 17:10
GitLab in LXC on Ubuntu and openSUSE

Ubuntu host and container

Install LXC:

apt-get install linux-hwe-generic # update to 3.13 on Precise
apt-add-repository ppa:ubuntu-lxc/stable
apt-get update
apt-get install lxc lxc-templates cgmanager cgroup-lite
reboot
@nWidart
nWidart / info.md
Last active January 11, 2022 11:37
Adding pre-push git hook to run php-cs-fixer
@RobertShippey
RobertShippey / MCU.csv
Last active July 3, 2022 00:38
Marvel Cinematic Universe - List of all TV shows and movies
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
See https://github.com/RobertShippey/MCU/blob/master/MCU.csv