Skip to content

Instantly share code, notes, and snippets.

View copyleftdev's full-sized avatar
🎯
Focusing

Don Johnson copyleftdev

🎯
Focusing
View GitHub Profile
@copyleftdev
copyleftdev / css.md
Created August 28, 2024 07:50
CSS Selector Cheat Sheet with Advanced Bitwise Operators

CSS Selector Cheat Sheet with Advanced Bitwise Operators

Basic Selectors

Selector Example Description
* * { } Selects all elements
elementname p { } Selects all <p> elements
.classname .intro { } Selects all elements with class="intro"
#idname #firstname { } Selects the element with id="firstname"
@copyleftdev
copyleftdev / crawler_spec.md
Created August 27, 2024 03:20
Rust-Based Web Crawler with Kafka and PostgreSQL Integration - Design Specification

Rust-Based Web Crawler with Kafka and PostgreSQL Integration - Design Specification

1. Introduction

1.1 Overview

This document outlines the design specification for a high-performance Rust-based web crawler integrated with Apache Kafka and PostgreSQL. The crawler will act as a worker within a distributed system, consuming URLs from Kafka topics, crawling the associated web pages, and storing the results in a PostgreSQL database. Docker Compose will be utilized to manage the infrastructure, ensuring seamless deployment and orchestration of the services.

1.2 Objectives

  • Develop a high-performance web crawler using Rust that integrates with Kafka and PostgreSQL.
  • Ensure scalable crawling of up to 10 million websites.
@copyleftdev
copyleftdev / sshkeys.md
Created August 24, 2024 07:03
The Ultimate Guide to Managing Multiple SSH Keys

πŸ” The Ultimate Guide to Managing Multiple SSH Keys

πŸš€ Basic Concepts

  • πŸ”‘ SSH keys consist of a public key and a private key
  • πŸ“‚ Keys are typically stored in ~/.ssh/
  • πŸ”’ Private keys should be kept secure and never shared
  • πŸ“€ Public keys are added to remote servers or services

πŸ“Š Creating SSH Keys

@copyleftdev
copyleftdev / grep.md
Created August 24, 2024 07:00
The Ultimate Grep Command Guide

πŸ” The Ultimate Grep Command Guide

πŸš€ Basic Usage

Command Description Example
grep pattern file πŸ”Ž Search for a pattern in a file grep error logfile.txt
grep -i pattern file πŸ”  Case-insensitive search grep -i ERROR logfile.txt
grep -w word file πŸ”€ Match whole words only grep -w error logfile.txt
grep -v pattern file ❌ Invert match (show lines that don't match) grep -v success logfile.txt
@copyleftdev
copyleftdev / tail.md
Created August 24, 2024 06:58
The Ultimate Tail Command Guide

πŸ“œ The Ultimate Tail Command Guide

πŸš€ Basic Usage

Command Description Example
tail file.txt πŸ“„ Display the last 10 lines of a file tail /var/log/syslog
tail -n 20 file.txt πŸ”’ Display the last 20 lines of a file tail -n 20 /var/log/auth.log
tail -c 100 file.txt πŸ“ Display the last 100 bytes of a file tail -c 100 /etc/passwd
@copyleftdev
copyleftdev / gist:be99c8be50e2119a979aa275fe165e8d
Created August 24, 2024 06:56
Linux Penetration Testing with GNU Utils: The Ultimate Cheat Sheet

🐧 Linux Penetration Testing with GNU Utils: The Ultimate Cheat Sheet

DISCLAIMER: This information is for educational purposes only. Always obtain proper authorization before performing any penetration testing activities. Unauthorized testing is illegal and unethical.

πŸ” Information Gathering

Command Description Example
netstat 🌐 Network connections, routing tables, interface statistics netstat -tuln
ss πŸ”Œ Socket statistics ss -tuln
@copyleftdev
copyleftdev / logs.md
Created August 24, 2024 06:53
Log Analysis Mastery: The Ultimate Cheat Sheet

πŸ“Š Log Analysis Mastery: The Ultimate Cheat Sheet

πŸ“œ Basic Log Viewing

Command Description Example
cat πŸ“„ Display entire log file cat /var/log/syslog
less πŸ“ƒ View log file with pagination less /var/log/auth.log
tail πŸ”š View end of log file tail /var/log/apache2/access.log
head πŸ” View beginning of log file head /var/log/mysql/error.log
@copyleftdev
copyleftdev / parallel.md
Created August 24, 2024 06:51
GNU Parallel Mastery: The Ultimate Cheat Sheet

πŸš€ GNU Parallel Mastery: The Ultimate Cheat Sheet

πŸ“Š Basic Usage

Command Description Example
parallel echo ::: A B C πŸ”€ Process items in parallel Output: A, B, C (in any order)
parallel echo {} ::: *.txt πŸ” Use {} as placeholder Echoes names of all .txt files
cat file.txt | parallel echo πŸ“₯ Read input from stdin Processes each line of file.txt
parallel -j4 command ::: item1 item2 item3 πŸ”’ Limit to 4 jobs at a time Runs 'command' on items, max 4 parallel
@copyleftdev
copyleftdev / chaining.md
Created August 24, 2024 06:49
Bash Command Chaining Mastery: The Ultimate Cheat Sheet

πŸ”— Bash Command Chaining Mastery: The Ultimate Cheat Sheet

πŸ”— Basic Command Chaining

Operator Description Example
; πŸ“Š Run commands sequentially echo "Hello"; echo "World"
&& βœ… Run next command only if previous succeeds mkdir dir && cd dir
|| ❌ Run next command only if previous fails ping -c1 google.com || echo "Offline"
| 🚿 Pipe output of one command to another ls -l | grep ".txt"
@copyleftdev
copyleftdev / ssh-mastery.md
Created August 24, 2024 06:47
SSH Mastery: The Ultimate Guide

πŸ” SSH Mastery: The Ultimate Guide

🌟 Basic SSH Commands

Command Description
ssh user@hostname πŸ”Œ Connect to a remote host
ssh -p 2222 user@hostname πŸ”’ Connect using a specific port
ssh -i ~/.ssh/id_rsa user@hostname πŸ”‘ Connect using a specific identity file
exit or logout πŸ‘‹ Terminate the SSH session