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
| sudo echo $USER' ALL=(ALL) NOPASSWD: ALL' | sudo tee /etc/sudoers.d/$USER && sudo chmod 0440 /etc/sudoers.d/$USER |
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 | |
| ffmpeg \ | |
| -protocol_whitelist "file,http,https,tcp,tls" \ | |
| -user_agent "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:146.0) Gecko/20100101 Firefox/146.0" \ | |
| -referer "https://www.dw.com" \ | |
| -i "https://hlsvod.dw.com/i/dwtv_video/flv/she/she260108_ttn_,AVC_480x270,AVC_512x288,AVC_640x360,AVC_960x540,AVC_1280x720,AVC_1920x1080,.mp4.csmil/master.m3u8" \ | |
| -c copy \ | |
| aiprivacy.mp4 |
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
| import textwrap | |
| def format_string(data, chunk_size=73, indent=4, return_output=False): | |
| """ | |
| Format a string into chunks of specified size using textwrap, with optional indentation. | |
| Args: | |
| data: Input string to be formatted. | |
| chunk_size: Size of each chunk (default: 73). | |
| indent: Number of spaces for indentation (default: 4). | |
| return_output: If True, return the formatted string instead of printing (default: False). |
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
| python3 << 'EOF' | |
| import ast | |
| import sys | |
| file_path = "~/test_clinical_study.py" | |
| with open(file_path, 'r') as f: | |
| tree = ast.parse(f.read(), filename=file_path) | |
| imported = set() |
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
| import msgpack | |
| class Event: | |
| @staticmethod | |
| def pack(payload): | |
| return msgpack.packb(payload, use_bin_type=True) | |
| @staticmethod | |
| def unpack(blob): | |
| return msgpack.unpackb(blob, raw=False, strict_map_key=False) |
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
| https://discord.com/api/download/stable?platform=linux&format=deb |
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
| > docker save \ | |
| python:3.12.11-slim-bookworm \ | |
| zeromq:latest \ | |
| fanout/pushpin:1.40.1 \ | |
| redis:8.2.1-alpine3.22 \ | |
| mariadb:12.1.1-rc \ | |
| -o all_images.tar |
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
| > rsync -avP .ssh iam@bit.wise:~ | |
| # the above copies the .ssh folder from PC A and dumps the folder to the ~/.ssh on the PC B |
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
| mkdir -p ~/.npm-global | |
| npm config set prefix '~/.npm-global' | |
| echo 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.bashrc | |
| source ~/.bashrc |
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
| import time | |
| from datetime import datetime, timedelta, timezone | |
| import redis | |
| class RedisTimeTracker: | |
| def __init__(self): | |
| self.RD = redis.Redis( | |
| host="127.0.0.1", |
NewerOlder