SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/lib/ui.sh"
This file contains hidden or 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/sh | |
| # Terminal Ligature Test | |
| # This one-liner checks if the terminal (not the code editor) renders ligatures correctly. | |
| # It compiles a simple C++ program that prints common ligature-sensitive operators. | |
| echo -e '#include <cstdio>\nint main(){const char*s="-> <= >= != == && || << >>";while(*s)putchar(*s++);return 0;}' | gcc -x c++ - -o /tmp/a.out && /tmp/a.out; rm /tmp/a.out |
This file contains hidden or 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 | |
| # Script Name: merge_code.sh | |
| # Description: | |
| # This script searches for source code files in a specified directory and its subdirectories, | |
| # optionally excluding certain directories. It consolidates the contents of these files into a | |
| # single Markdown file named all_sources.md, organizing the code by its relative file path and | |
| # highlighting syntax according to the file type. | |
| # | |
| # Usage: | |
| # ./merge_code.sh search_directory [exclude_dir1] [exclude_dir2] [...] |
To set up the project and run the server, follow these steps:
-
Python Environment Setup:
- Ensure Python is installed on your system. You can download and install Python from the official website if needed.
-
Install Required Libraries:
- Install Flask, the web framework used for creating the HTTP server:
| Task Description | Command | GNU coreutils/POSIX utils/Unix utils |
|---|---|---|
Create tcsh Alias for readlink |
alias toclip 'readlink -f \!:1 | to_clipboard' |
alias, readlink, to_clipboard |
| Improving alias for copying a path to the clipboard |
This file contains hidden or 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
| """ | |
| This script extracts HTTP packet details from a pcap file, formats them | |
| with their respective HTTP verb, URI, and status code, and writes the | |
| hexadecimal content of each packet along with a descriptive header | |
| to a specified output file. | |
| """ | |
| import subprocess | |
| import sys | |
| from scapy.all import * |
This file contains hidden or 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
| """ | |
| This script implements a basic HTTP server that listens on port 8080 and responds to | |
| incoming HTTP requests with chunked transfer encoding as per the HTTP/1.1 standard. | |
| Upon receiving a request, the server sends a JSON payload as the response, broken | |
| down into a specified number of chunks to demonstrate the chunked transfer | |
| encoding mechanism. | |
| """ | |
| # HTTP 1 - Server | |
| import socket |
This file contains hidden or 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
| cmake_minimum_required(VERSION 3.25) | |
| set(CMAKE_CXX_STANDARD 11) | |
| project(c_cpp_snippet) | |
| set(CMAKE_BUILD_TYPE Debug) | |
| set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g") | |
| set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") | |
| set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | |
| # Find ccache |
This file contains hidden or 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
| build | |
| .vscode |
This file contains hidden or 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
| kubectl get pods --field-selector=status.phase!=Running,status.phase!=Succeeded -o custom-columns=NAME:.metadata.name,STATUS:.status.phase | |
| #!/bin/bash | |
| for i in {1..2300} | |
| do | |
| touch "file_${i}.txt" | |
| done |
NewerOlder