Skip to content

Instantly share code, notes, and snippets.

@azer
azer / tidy.sh
Created February 25, 2025 10:03
Desktop tidier
#!/bin/bash
# Desktop Tidier
# A simple script to organize files on your macOS desktop
# Colors for prettier output
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
RED='\033[0;31m'
@azer
azer / gist:e8b05846f96ca2ba5d06faa9f96ae36a
Created February 18, 2025 09:14
Bookmarklet to auto scroll a web page
javascript:(function() {
// Prompt for scroll speed (pixels per second), default 75
const speed = prompt('Enter scroll speed (pixels per second):', '75');
if (!speed) return; // Exit if canceled
// Convert speed to pixels per frame (assuming 60fps)
const pixelsPerFrame = parseFloat(speed) / 60;
// Store initial scroll position
@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"