Skip to content

Instantly share code, notes, and snippets.

View naufdotal's full-sized avatar

Ariq Naufal naufdotal

View GitHub Profile
@naufdotal
naufdotal / compose.yaml
Created March 13, 2023 10:54
Protect Wordpress Login in Docker container with Fail2Ban
#taken from https://github.com/docker/awesome-compose/tree/master/wordpress-mysql
services:
db:
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
command: '--default-authentication-plugin=mysql_native_password'
volumes:
- db_data:/var/lib/mysql
@naufdotal
naufdotal / custom-tags.hbs
Created February 18, 2023 17:46
Custom Tags Page ghost blog
{{!< default}}
<header class="post-header {{#if feature_image}} has-cover {{/if}}">
<div class="inner">
<h1 class="post-title">{{{title}}}</h1>
{{#if feature_image}}
<div class="post-cover cover">
<img
srcset="{{img_url feature_image size="s"}} 320w,
{{img_url feature_image size="m"}} 640w,
@naufdotal
naufdotal / ghost.conf
Created July 28, 2020 22:54
nginx config ghost redirect www to non-www and HTTP to HTTPS
server {
listen 443 http2;
server_name namadomain.com www.namadomain.com;
set $my_var 0;
if ($host = 'www.namadomain.com') {
set $my_var 1;
}
if ($my_var = 1) {
rewrite ^/(.*)$ https://namadomain.com$request_uri permanent;
@naufdotal
naufdotal / ping-ks9.txt
Created February 20, 2020 17:47
PING Kimsufi 100mbps KS9
-------------------------------------------
Running ping tests...
-------------------------------------------
----------------------------------------------
Pings (cachefly.cachefly.net):
PING cachefly.cachefly.net (205.234.175.175) 56(84) bytes of data.
64 bytes from vip1.G-anycast1.cachefly.net (205.234.175.175): icmp_seq=1 ttl=59 time=6.14 ms
64 bytes from vip1.G-anycast1.cachefly.net (205.234.175.175): icmp_seq=2 ttl=59 time=6.14 ms
@naufdotal
naufdotal / bandwidth-ks9.txt
Created February 20, 2020 17:45
Bandwidth Benchmark 100 Mbps Kimsufi KS9
-------------------------------------------
Running bandwidth benchmark...
-------------------------------------------
----------------------------------------------
Download from Cachefly (http://cachefly.cachefly.net/100mb.test)
Download Cachefly: 11.2MB/s
-------------------------------------------
@naufdotal
naufdotal / 3d-fold-out-reveal.markdown
Last active January 25, 2020 15:55
3D Fold out reveal

3D Fold out reveal

Click to reveal more info. Info folds out beneath the card, while the rest of the grid recedes.

A Pen by Andrew Canham on CodePen.

License.

<?php
function my_customize_rest_cors() {
remove_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' );
add_filter( 'rest_pre_serve_request', function( $value ) {
header( 'Access-Control-Allow-Origin: *' );
header( 'Access-Control-Allow-Methods: GET' );
header( 'Access-Control-Allow-Credentials: true' );
header( 'Access-Control-Expose-Headers: Link', false );
<html>
<p style="width: 70%;margin: auto;margin-top: 5%;font-size:larger;text-align:center">
Download a file from any URL</p>
<form method="post" style="width: 70%;margin: auto;margin-top: 10%;">
<input name="url" size="50" placeholder="Source URL" style="width: 100%;height: 10%;font-size: 1.5em;padding:10px" required>
<input name="submit" type="submit" value="Download" style="width: 30%;height: 10%;margin: 5% auto; display: block;">
<p style="width: 70%;margin: auto;margin-top: 10%;font-size:larger;text-align:center">
To <?php echo getcwd(); ?></p>
<p style="width: 70%;margin: auto;font-size: smaller;text-align: center;position: fixed;bottom: 0;background: #fff;">
Powered by: <a href="https://karthikbhat.net/portfolio" target="_blank" style="color:#f60;text-decoration:none;">Karthik</a></p>
@naufdotal
naufdotal / Startup Command
Last active February 13, 2018 07:49
NGINX service file - startup
update-rc.d nginx defaults for Ubuntu 14.04
systemctl enable nginx.service for Centos 7
@naufdotal
naufdotal / interfaces
Last active February 6, 2018 16:20
networking kimsufi 1 ip NAT (/etc/network/)
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage part of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!