Skip to content

Instantly share code, notes, and snippets.

View naufdotal's full-sized avatar

Ariq Naufal naufdotal

View GitHub Profile
@joepie91
joepie91 / vpn.md
Last active May 1, 2024 01:04
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@denji
denji / http-benchmark.md
Last active April 29, 2024 19:08
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@chriswayg
chriswayg / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Last active April 26, 2024 23:32
Ubuntu and Debian Cloud images in Proxmox
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@nginx-gists
nginx-gists / api_backends.conf
Last active April 21, 2024 09:19 — forked from lcrilly/api_backends.conf
Deploying NGINX Plus as an API Gateway, Part 1
upstream warehouse_inventory {
zone inventory_service 64k;
server 10.0.0.1:80;
server 10.0.0.2:80;
server 10.0.0.3:80;
}
upstream warehouse_pricing {
zone pricing_service 64k;
server 10.0.0.7:80;
@fideloper
fideloper / update_curl.sh
Last active January 11, 2024 15:23
Update curl on Ubuntu 14.04
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2
tar -xvjf curl-7.50.2.tar.bz2
@ianmustafa
ianmustafa / imageoptim.php
Last active February 23, 2023 06:20
Optimalisasi Gambar dalam PHP menggunakan Imagick.
<?php
/* Maafkan kalo penamaan variabelnya berantakan 😁
Ini juga agak lambat karena kompleksitasnya, terutama
di baris 61-95 (pembuatan gambar latar yang di-blur
untuk mengisi ruang kosong / menghindari crop)
*/
function imageoptim($imagepath, $savename) {
// Set imagepath default
$imagepath = "upload/source/{$savename}";
@pulsar256
pulsar256 / my_hetzner_xen_setup.md
Last active February 9, 2023 22:20
Hetzner Xen + v4 Subnet + v6 Subnet Setup HowTo

Hetzner Primary IPv4 IP + IPv4/2x Subnet + "Non-Routed" IPv6/64 Subnet HowTo

... so I do not forget the next time I have to figure this stuff out. And perhaps to help other poor souls fiddling with v6/v4 xen setups in a Hetzner network environment.

Basic setup

You can basically follow along the Xen Project Beginners Guide.

The short version

Install Debian Wheezy via Hetzner's installimage on the rescue system, the only important part about partitioning is that you have an LVM volume group named vg0 with enough space for your guests' disks.

@miya0001
miya0001 / cors-for-the-wordpress-rest-api.php
Last active January 31, 2023 07:42
CORS for the WordPress REST API
<?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 );
@karthikax
karthikax / dosu.php
Last active December 31, 2022 06:16
PHP Download file to server from URL
<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>