Skip to content

Instantly share code, notes, and snippets.

View hasinhayder's full-sized avatar
🚀
Back on track, yayyyy!

Hasin Hayder hasinhayder

🚀
Back on track, yayyyy!
View GitHub Profile
sudo chown -R $(whoami) /usr/local
@hasinhayder
hasinhayder / nginx-tuning.md
Created September 28, 2016 13:03 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

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 400,000 to 500,000 requests per second (clustered), most what i saw is 50,000 to 80,000 (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.

@hasinhayder
hasinhayder / charlie-foxtrot.go
Last active May 20, 2020 19:16
converts a string to NATO phonetic alphabet equivalents
/* Charlie Foxtrot - If You Know What It Means ;) */
package main
import (
"fmt"
"strings"
"bufio"
"os"
)
@hasinhayder
hasinhayder / Migration.js
Created March 21, 2017 09:00 — forked from libsteve/Migration.js
A script for migrating the primary domain of a Google Apps account.
// migrate the script executer's primary domain
// domainName - the desired domain to migrate to
function migrateDomain(organizationName, domainName) {
var customerId = 'my_customer';
var customer = AdminDirectory.Customers.get(customerId);
customer.customerDomain = domainName;
customer.postalAddress.organizationName = organizationName;
customer.customerCreationTime = undefined; //
AdminDirectory.Customers.patch(customer, customerId);
@hasinhayder
hasinhayder / imgreplace.php
Created June 5, 2017 09:12
Replace images with Dummy Placeholder Image
<?php
/* Keep your images in a folder named 'img' in the same folder where this script resides*/
/* Run the command "php imagereplace.php */
/* ImageMagick PHP extension is required */
function getDirContents($dir, &$results = array()) {
$files = scandir($dir);
foreach ($files as $key => $value) {
$path = realpath($dir . DIRECTORY_SEPARATOR . $value);
@hasinhayder
hasinhayder / eid-mubarak.go
Last active February 16, 2018 05:50
Say eid mubarak in different ways :D
package main
// :D :D :D :D
import (
"fmt"
"math/rand"
"time"
)
@hasinhayder
hasinhayder / ytm.txt
Last active September 13, 2017 12:57
MP3 Download using Youtube DL
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 <youtube-url>
@hasinhayder
hasinhayder / .vimrc
Created August 8, 2017 08:50
Vim Auto Indent and Syntaxt Highlighting On
syntax on
set tabstop=4
set shiftwidth=4
set expandtab
set smarttab
set autoindent
@hasinhayder
hasinhayder / cmd.sh
Last active September 13, 2017 12:56
Delete all hidden files in current directory in mac
find . -mindepth 1 -name '.*' -delete
@hasinhayder
hasinhayder / ssh-config
Created August 24, 2017 13:12
Keep ssh connections alive in terminal
ServerAliveInterval 10
TCPKeepAlive yes