Skip to content

Instantly share code, notes, and snippets.

View fuadarradhi's full-sized avatar
🔥
On Fire

Fuad Ar-Radhi fuadarradhi

🔥
On Fire
View GitHub Profile
@fuadarradhi
fuadarradhi / countries.geojson
Created September 19, 2023 07:33 — forked from ThomasG77/countries.geojson
Sample Leaflet with GeoJSON
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fuadarradhi
fuadarradhi / haproxy.cfg
Created August 16, 2023 15:44 — forked from T0MM0R/haproxy.cfg
Let's Encrypt Auto-Renewal script for HAProxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048
@fuadarradhi
fuadarradhi / rsa.go
Created February 4, 2023 07:44 — forked from soyart/rsa.go
RSA OAEP SHA256 encryption in Go
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"crypto/x509"
"encoding/base64"
"encoding/pem"
@fuadarradhi
fuadarradhi / main.dart
Created January 28, 2023 00:30 — forked from ben-xx/main.dart
stateful theme switcher
/// gist for https://stackoverflow.com/a/67714404/2301224
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
@fuadarradhi
fuadarradhi / network-tweak.md
Created January 24, 2023 15:16 — forked from mustafaturan/network-tweak.md
Linux Network Tweak for 2 million web socket connections

Sample config for 2 million web socket connection

    sysctl -w fs.file-max=12000500
    sysctl -w fs.nr_open=20000500
    # Set the maximum number of open file descriptors
    ulimit -n 20000000

    # Set the memory size for TCP with minimum, default and maximum thresholds 
 sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
@fuadarradhi
fuadarradhi / tuned.conf
Created January 17, 2022 15:31 — forked from kofemann/tuned.conf
Tuned profile for PostgreSQL server on CENTOS-7
#
# tuned configuration for PostgresSQL servers
# /usr/lib/tuned/postgres-db-server/tuned.conf
#
[cpu]
force_latency=1
governor=performance
energy_perf_bias=performance
min_perf_pct=100
@fuadarradhi
fuadarradhi / rsa_util.go
Created July 20, 2020 11:42 — forked from miguelmota/rsa_util.go
Golang RSA encrypt and decrypt example
package ciphers
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"log"
)
pip install watchdog
watchmedo auto-restart --directory=. ./manage.py -- run_gunicorn --workers=15
@fuadarradhi
fuadarradhi / main.dart
Created April 9, 2020 03:45 — forked from branflake2267/main.dart
Flutter - Using the Refresh Indicator
import 'dart:async';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
@fuadarradhi
fuadarradhi / cuter.py
Created July 26, 2019 05:33 — forked from gbaldera/cuter.py
Python PIL Example: get a thumbnail resizing and cropping an image.
# -*- coding: utf-8 -*-
import Image
def resize_and_crop(img_path, modified_path, size, crop_type='top'):
"""
Resize and crop an image to fit the specified size.
args:
img_path: path for the image to resize.