Skip to content

Instantly share code, notes, and snippets.

View ManUtopiK's full-sized avatar
:octocat:
Ready to code.

Emmanuel Salomon ManUtopiK

:octocat:
Ready to code.
View GitHub Profile
@ncatallo
ncatallo / vps-setup-ssh-key.sh
Created May 8, 2025 10:48
This script setup ssh key to connect to server (to run on your local machine)
#!/bin/bash
# Default values
PORT=22
WITH_PASSPHRASE=false
# Parse CLI arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--server-name)
@ncatallo
ncatallo / vps-setup-firewall-fail2ban.sh
Last active May 9, 2025 16:50
This script setup UFW on your server to allow only 80 and 443 ports / SSH port if specified
#!/bin/bash
# Default values
SSH_ENABLE=false
SSH_PORT=22
SSH_ALLOW_FROM=""
RESET=false
# Args parsing
while [[ "$#" -gt 0 ]]; do
@ncatallo
ncatallo / vps-user-ssh-setup.sh
Last active May 8, 2025 11:46
This bash script setup a new user 'myuser' on your linux server and secure the SSH access.
#!/bin/bash
# Variables
USERNAME="myuser"
SSH_PORT=22
EDIT_SSH_PORT=false
SSHD_CONFIG="/etc/ssh/sshd_config"
BACKUP_CONFIG="${SSHD_CONFIG}.bak_$(date +%Y%m%d%H%M%S)"
# Args parsing
@kirankunigiri
kirankunigiri / uno.config.ts
Created April 5, 2025 02:17
UnoCSS config with autocomplete for cn() utility function
import {
defineConfig,
presetIcons,
presetTypography,
presetWind3,
transformerDirectives,
transformerVariantGroup,
} from 'unocss';
export default defineConfig({
@ipenywis
ipenywis / cursor-memory-bank-rules.md
Last active June 27, 2025 02:17
Cursor Memory Bank

Cursor's Memory Bank

I am Cursor, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.

Memory Bank Structure

The Memory Bank consists of required core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:

flowchart TD
@jlia0
jlia0 / agent loop
Last active June 27, 2025 04:42
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@deepfates
deepfates / convert_archive.py
Created November 17, 2024 19:33
Convert your twitter archive into a training dataset and markdown files
import argparse
import json
import logging
import os
import re
import shutil
from concurrent.futures import ProcessPoolExecutor, as_completed
from dataclasses import dataclass
from datetime import datetime
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple
@danielkellyio
danielkellyio / currentDate.ts
Created October 30, 2024 14:53
serialize nuxt api endpoint data with devalue
// server/api/currentDate
import { stringify } from "devalue"
export default defineEventHandler(async (event) => {
const data = {
createAt: new Date(),
}
if (getHeader(event, 'Content-Type') === 'application/devalue') {
const dataToJSON = {
@andrasbacsai
andrasbacsai / firewall.sh
Last active April 19, 2025 14:31
Update a Hetzner Firewall rule with your IP address
#!/bin/bash
# Script to update a firewall rule in a Hetzner Firewall with your current IP address.
# Good if you would like to restrict SSH access only for your current IP address (secure).
#################
# WARNING: This script will overwrite all rules in the firewall rules, so make sure you
# added all the required rules.
# I use a separate firewall rule just for SSH access.
#################
@vitaly-t
vitaly-t / chain-arrays.ts
Last active October 2, 2024 13:45
Logically concatenates arrays
/**
* Iterable arrays chain, extended for "getLength" and "at" accessor.
*/
export interface IArraysChain<T> extends RelativeIndexable<T>, Iterable<T> {
/**
* Calculates total length of all input arrays combined.
*/
getLength(): number;
}