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 | |
set -euo pipefail | |
# Configuration | |
SCRIPT_NAME="./evil-process" | |
LOG_FILE="./process_monitor.log" | |
CHECK_INTERVAL=5 | |
# Target users to monitor | |
TARGET_USERS=("root" "admin") |
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
import os | |
import asyncio | |
import aiohttp | |
import argparse | |
from tqdm import tqdm | |
async def download_video(session, url, file_path): | |
if os.path.exists(file_path): | |
print(f"[!] Skipping: {file_path} (already downloaded)") | |
return |
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
(*Shanghai Composite Index*) | |
data1 = FinancialData[ | |
"^000001", {{2019, 12, 1}, {2021, 3, 22}, "Week"}]; | |
data2 = FinancialData[ | |
"^000001", {{2021, 3, 23}, {2022, 3, 5}, "Week"}]; | |
data3 = FinancialData[ | |
"^000001", {{2022, 3, 6}, {2022, 12, 4}, "Week"}]; | |
data4 = FinancialData[ | |
"^000001", {{2022, 12, 5}, {2023, 11, 1}, "Week"}]; | |
dataset = {data1, data2, data3, data4}; |
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 | |
# Tom Hale, 2016. MIT Licence. | |
# Print out 256 colours, with each number printed in its corresponding colour | |
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163 | |
set -eu # Fail on errors or undeclared variables | |
printable_colours=256 |
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 GH_RAW_URL='https://raw.githubusercontent.com' | |
install_completion(){ zinit for as'completion' nocompile id-as"$1" is-snippet "$GH_RAW_URL/$2"; } | |
local GHG_RAW_URL='https://gist.githubusercontent.com' | |
install_gist_snippet() { | |
local url="$2" | |
if [[ $url != $GHG_RAW_URL* ]]; then | |
url="$GHG_RAW_URL/$url" | |
fi | |
if [[ $url != *raw ]]; then |
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
# ZINIT_HOME="/home/username/.local/share/zinit/zinit.git" | |
zinit_remove() { | |
local target_dir | |
case "$1" in | |
-s|--snippets) | |
target_dir="${ZINIT_HOME:s/zinit\.git/snippets}" | |
;; | |
-p|--plugins) |
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
function ipinfo() { | |
ip_address=${1:-$(curl -s ipinfo.io/ip)} | |
while (( "$#" )); do | |
case $1 in | |
-h|--help) | |
echo "Command: ip-info IP_ADDRESS\n" | |
echo "Default: your ip address" | |
echo "Option -s or --simple" | |
echo "==>Print only Your address" |
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
load_func() { | |
local CMD_NAME="$1" | |
local SCRIPT_URL="$2" | |
local SAFETY_CHECK="${3:-true}" | |
local script=$(curl -fsSL $SCRIPT_URL) | |
if [[ "$SAFETY_CHECK" == "true" && $script =~ "rm " ]]; then | |
echo "Failed to load command $CMD_NAME: Harmful command detected in script." | |
return 1 | |
else |
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 | |
# Get the architecture of the machine | |
arch=$(uname -m) | |
os=$(uname -s) | |
# Download the Zellij binary | |
if [ "$os" == "Darwin" ]; then | |
filename="zellij-${arch}-apple-darwin.tar.gz" | |
url="https://github.com/zellij-org/zellij/releases/latest/download/$filename" |
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
function git_user_switcher() { | |
# Define an associative array to store the user settings | |
typeset -A -g git_users | |
# Add the users to the dictionary | |
# Format: username "name email gpg_key" | |
git_users=( | |
adam "adam [email protected]" | |
) |
NewerOlder