Skip to content

Instantly share code, notes, and snippets.

View masoud-msk's full-sized avatar
🏠
Working from home

Masoud Salehi masoud-msk

🏠
Working from home
View GitHub Profile
@prasetiyohadi
prasetiyohadi / nginx.conf
Created December 23, 2015 08:17
Mitigating DDOS Attack with Nginx
# Source: https://www.nginx.com/blog/mitigating-ddos-attacks-with-nginx-and-nginx-plus/
# DDOS characteristics:
# - traffic originates from a fixed set of IP addresses, much higher than requests from forward proxies
# - traffic is much higher than a human user can generate
# - The User-Agent header is sometimes set to a non-standard value
# - The Referer header is sometimes set to a value you can associate with the attack
# Limiting the rate of requests (example: 30 connection per minute per IP or allow request only every 2 seconds)
limit_req_zone $binary_remote_addr zone=one:10m rate=30r/m;
@evantoli
evantoli / GitConfigHttpProxy.md
Last active June 19, 2024 00:17
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@samuelralak
samuelralak / solution.ex
Last active March 25, 2023 20:29
HackerRank 30 days of code. Day 0: Hello, World. Read from STDIN in Elixir
defmodule Solution do
#Enter your code here. Read input from STDIN. Print output to STDOUT
def read do
case IO.read(:stdio, :line) do
:eof -> :ok
{:error, reason} -> IO.puts "Error: #{reason}"
data ->
IO.write(:stdio, "Hello, World. \n")
IO.write(:stdio, data)
read()