This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )" | |
PROMPT='%{$fg_bold[cyan]%}▲ %{$fg_bold[yellow]%}%t - %{$fg_bold[blue]%}%c $(git_prompt_info)% %{$reset_color%}' | |
ZSH_THEME_GIT_PROMPT_CLEAN=") %{$fg_bold[green]%}✔ " | |
ZSH_THEME_GIT_PROMPT_DIRTY=") %{$fg_bold[red]%}✘ " | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}(" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} | |
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 1️⃣ Adding Execution Permissions & Running as Root | |
touch setup-fail2ban.sh | |
chmod +x setup-fail2ban.sh | |
sudo vim ./setup-fail2ban.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
location /api/ { | |
deny 192.168.1.100; # Block specific IPs | |
error_page 403 /403.html; | |
access_log /var/log/nginx/api.log; # Log all requests | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
location /api/ { | |
if ($http_user_agent ~* (curl|wget|bot|crawler)) { | |
return 403; # Block known scrapers and bots | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
location /api/ { | |
proxy_cache cache_zone; # Enable caching for responses | |
proxy_cache_valid 200 10m; # Cache 200 OK responses for 10 min | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
location /api/ { | |
limit_req zone=req_limit burst=20 nodelay; # Limit to 10 req/sec per IP | |
limit_conn conn_limit 5; # Max 5 concurrent connections per IP | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
location /api/ { | |
deny 192.168.1.100; | |
allow 10.0.0.0/8; | |
deny all; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http { | |
limit_req_zone $binary_remote_addr zone=api_limit:10m rate=10r/s; | |
server { | |
location /api/ { | |
limit_req zone=api_limit burst=20 nodelay; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Nodemon launch", | |
"runtimeExecutable": "nodemon", | |
"program": "${workspaceFolder}/src/server.js", | |
"restart": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bitcoin = require('bitcoinjs-lib'); | |
const bip39 = require('bip39'); | |
const bip32 = require('bip32'); | |
// Generate a random mnemonic (12 words) | |
const mnemonic = bip39.generateMnemonic(); | |
console.log('Mnemonic:', mnemonic); | |
// Generate seed from mnemonic | |
const seed = bip39.mnemonicToSeedSync(mnemonic); |
NewerOlder