Skip to content

Instantly share code, notes, and snippets.

View emhaye's full-sized avatar

Mahyuddin emhaye

View GitHub Profile
@emhaye
emhaye / 00_etc-hosts.md
Created April 19, 2022 17:57 — forked from mul14/00_etc-hosts.md
/etc/hosts for Vimeo, Reddit, Imgur, GitHub, DigitalOcean, dll

Unblock Vimeo, Reddit, Imgur, GitHub, DigitalOcean, NPM, dll

Saya support Internet Positif untuk memblokir porn, situs judi, dan hal-hal ilegal lainnya. Tapi pemerintah dan ISP sangat konyol karena tidak mengizinkan akses ke Vimeo, Reddit, Imgur, Netflix--yang mana bukanlah situs dengan konten utama ilegal.

Linux / BSD / macOS

Tambahkan list di bawah ke /etc/hosts.

Windows

@emhaye
emhaye / .htaccess
Created October 3, 2018 07:49 — forked from vielhuber/.htaccess
Apache: htaccess force www and https ssl #server
# force HTTPS and www.
RewriteEngine On
RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]
# alternative way
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
@emhaye
emhaye / nginx-tuning.md
Created July 25, 2018 13:31 — forked from denji/nginx-tuning.md
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.

Expect auto task to enter password

example: my password bojong dev

#!/usr/bin/expect -f

set force_conservative 0  ;# set to 1 to force conservative mode even if
                          ;# script wasn’t run conservatively originally      
Expect auto task enter password
example: my password `bojong dev`
```
#!/usr/bin/expect -f
set force_conservative 0 ;# set to 1 to force conservative mode even if
;# script wasn’t run conservatively originally
if {$force_conservative} {
set send_slow {1 .1}
@emhaye
emhaye / telnet-imap
Created May 31, 2017 15:15 — forked from gustavohenrique/telnet-imap
playing with gmail via telnet
openssl s_client -crlf -connect imap.gmail.com:993
tag login [email protected] passwordhere
tag list "" "*"
tag select "inbox"
tag fetch 1:3 body[header]
tag fetch 3 body[header]
tag fetch 3 body[text]
tag fetch 2 all
tag fetch 2 fast
tag fetch 2 full
@emhaye
emhaye / autopgsqlbackup
Created March 17, 2017 03:42 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <[email protected]>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
### Keybase proof
I hereby claim:
* I am emhaye on github.
* I am mhy (https://keybase.io/mhy) on keybase.
* I have a public key whose fingerprint is 5A7F 5A0C 0E7F 6E7A 7D83 30BF A515 4FF0 3ACF C4DF
To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am dotovr on github.
  • I am mhy (https://keybase.io/mhy) on keybase.
  • I have a public key whose fingerprint is 5A7F 5A0C 0E7F 6E7A 7D83 30BF A515 4FF0 3ACF C4DF

To claim this, I am signing this object:

@emhaye
emhaye / makeauthority.sh
Created July 11, 2016 12:30 — forked from richieforeman/makeauthority.sh
Issue Your Own Self-Signed S/MIME Certs with OpenSSL
# Run this once
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt