Skip to content

Instantly share code, notes, and snippets.

@azer
azer / 50x.html
Created October 27, 2024 07:40
50x.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Server Error</title>
<style>
:root {
--primary-color: #dc2626;
--text-primary: #1f2937;
@azer
azer / 404.html
Created October 27, 2024 07:40
404.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>404 - Page Not Found</title>
<style>
:root {
--primary-color: #3b82f6;
--text-primary: #1f2937;
@azer
azer / nginx_main.conf
Created October 27, 2024 07:36
nginx_main.conf
user www-data;
worker_processes auto;
worker_rlimit_nofile 65535;
pid /run/nginx.pid;
events {
multi_accept on;
worker_connections 65535;
}
@azer
azer / nginx_manage.sh
Created October 27, 2024 07:16
nginx_manage.sh
#!/bin/bash
command=$1
domain=$2
show_help() {
echo "Usage: $0 <command> <domain>"
echo ""
echo "Commands:"
echo " create <domain> Create a new website configuration"
@azer
azer / nginx_help.md
Created October 27, 2024 07:15
nginx_help.md

Ubuntu Server Management Guide

Website Management System

This guide explains how to manage websites on your Ubuntu server using the custom management system.

Directory Structure

~/dev/
├── help.md # This help file
@azer
azer / nginx_default.html
Created October 27, 2024 07:14
nginx_default.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Welcome</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
line-height: 1.6;
margin: 0;
@azer
azer / nginx_default.conf
Last active October 27, 2024 07:37
nginx_default.conf
# Rate limiting zones
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
limit_conn_zone $binary_remote_addr zone=addr:10m;
server {
listen 80 default_server;
listen [::]:80 default_server;
root /home/$USER/dev/www/default;
index index.html index.htm;
@azer
azer / fal.go
Last active October 14, 2024 20:53
Go Client for Fal.ai
package fal
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"time"
@azer
azer / Common-Keys-Mac-And-Windows.md
Last active February 10, 2023 14:57
All Command+<letter> combinations in OSX and Windows

Source: ChatGPT. There could be mistakes.

OSX

Key Combination Purpose
Command + A Select all (OSX, Chrome, Firefox, Safari)
Command + B Bold text (OSX, Chrome, Firefox, Safari)
Command + C Copy (OSX, Chrome, Firefox, Safari)
Command + D Dictionary (OSX), Add Bookmark (Chrome, Firefox, Safari)
defmodule HashID do
@coder Hashids.new(
salt: "HmPbtapoe1FGfTFbEEeZcWKuakIQp3L0",
min_en: 6
)
def encode(id, type) do
type =
type
|> to_string