Skip to content

Instantly share code, notes, and snippets.

View akhwan90's full-sized avatar
🏠
Working from home. Hire me..

Nur Akhwan akhwan90

🏠
Working from home. Hire me..
View GitHub Profile
@akhwan90
akhwan90 / elasticsearch.md
Created April 24, 2020 14:10 — forked from dominicsayers/elasticsearch.md
Configuring ElasticSearch to use less memory

What I actually did

/etc/security/limits.conf

elasticsearch hard memlock 100000

/etc/default/elasticsearch

@akhwan90
akhwan90 / jwtRS256.sh
Created December 23, 2019 13:00 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@akhwan90
akhwan90 / .htaccess
Created September 8, 2019 08:48 — forked from shakee93/.htaccess
Laravel Apache hide .env and several security settings via .htaccess
# Disable Directory listing
Options -Indexes
# block files which needs to be hidden // in here specify .example extension of the file
<Files ~ "\.(env|json|config.js|md|gitignore|gitattributes|lock)$">
Order allow,deny
Deny from all
</Files>
# in here specify full file name sperator '|'
@akhwan90
akhwan90 / index.html
Created November 19, 2018 23:53 — forked from umidjons/index.html
Upload File using jQuery.ajax() with progress support
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Upload File using jQuery.ajax() with progress support</title>
</head>
<body>
<input type="file" name="file" id="sel-file"/>
@akhwan90
akhwan90 / php-pdo-mysql-crud.md
Created August 16, 2018 04:33 — forked from odan/php-pdo-mysql-crud.md
Basic CRUD operations with PDO and MySQL

Basic CRUD operations with PDO

CRUD = Create, Read, Update, Delete

Open a database connection

$host = '127.0.0.1';
$dbname = 'test';
$username = 'root';