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
# Based on https://github.com/iphoneintosh/ubuntu-docker | |
FROM debian:12 | |
# prevent interactive prompts | |
ENV DEBIAN_FRONTEND=noninteractive | |
# update dependencies | |
RUN apt update | |
RUN apt upgrade -y |
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
# Use https://github.com/sreedevk/deduplicator then use | |
# jq 'map(. + {key: (.hash + (.size | tostring))}) | group_by(.key) | map([.[] | .path[22:]])' dup.json | |
# to get the changed.json file. | |
# The script must be ran as admin. | |
$a = cat changed.json | ConvertFrom-Json | |
foreach ($duplicate_files in $a) | |
{ | |
foreach ($file in ($duplicate_files | Select-Object -Skip 1)) { | |
Write-Host "Deleting", $file | |
Remove-Item $file |
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 | |
DESTINATION="$1/" | |
if [[ "$DESTINATION" == "" ]]; then | |
echo "Please provide destination in arguments." | |
exit 1 | |
fi | |
echo "Compressing files from $PWD to $DESTINATION" | |
true > errors.txt | |
# Iterate in folders | |
find . -type d | while read -r directory; do |
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 | |
# Put it in crontab: */5 * * * * /bin/bash /root/scripts/ipv6-rotate.sh | |
# Get the next IPv6 | |
CURRENT_IP=$(cat ~/.config/rotate-ip) | |
NEXT_IP=$(((CURRENT_IP+1)%65534)) | |
echo "$NEXT_IP" > ~/.config/rotate-ip | |
CURRENT_IP=$(printf "%x" "$CURRENT_IP") | |
NEXT_IP=$(printf "%x" "$NEXT_IP") | |
CURRENT_IP="x:x:x::$CURRENT_IP" | |
NEXT_IP="x:x:x::$NEXT_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
# Place this file as $CARGO_HOME/config.toml | |
# Run this command before compiling anything to install compilers | |
# apt install apt install gcc-x86-64-linux-gnu gcc-aarch64-linux-gnu gcc-mingw-w64 | |
[target.x86_64-unknown-linux-musl] | |
linker = "rust-lld" | |
[target.aarch64-unknown-linux-musl] | |
linker = "rust-lld" |
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
from socket import * | |
import struct | |
import random | |
def get_checksum(data: bytes) -> int: | |
sum = 0 | |
for index in range(0, len(data), 2): | |
word = (data[index] << 8) + (data[index+1]) | |
sum = sum + word | |
sum = (sum >> 16) + (sum & 0xffff) |
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 networkx as nx | |
import matplotlib.pyplot as plt | |
EPSILON = "e" | |
class NFA: | |
def __init__(self, alphabet: list[str], adjacency_list: list[dict[str, list[int]]]): | |
""" |
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/sh | |
mount -t devtmpfs none /dev | |
mount -t proc none /proc | |
mount -t sysfs none /sys | |
dmesg -n 1 | |
echo "Welcome to CrowOS Live Linux (64-bit)!" | |
# Mount live CD to reallocate to it | |
echo "Mounting live volume..." | |
mkdir /livecd | |
mount UUID=6e422120-13ad-4a4d-b75e-02ab7757b3ae /livecd |
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
typedef struct { | |
int reader; | |
int writer; | |
} semaphore; | |
semaphore make_semaphore(int n) { | |
int pipe_fd[2]; | |
pipe(pipe_fd); | |
semaphore result = { | |
.reader = pipe_fd[0], |
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 | |
# A manifest file generated from https://github.com/SteamRE/DepotDownloader must be passed to the script. | |
# It should contain only the file lines. | |
# Use this script like bash depot-downloader-splitter.sh mainfest.txt 40000000000 | |
rm part*.txt # remove old files | |
MAX_SIZE=$2 # maximum size of each part | |
CURRENT_SIZE=0 | |
COUNTER=1 | |
while read -r line; do | |
line=$(echo $line) # trim each column |
NewerOlder