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
# Set terminal title (optional) | |
PS1="\[\e]0;\u@\h: \w\a\]" | |
# Segment 1: Dark Gray background (100) with Light Yellow text (93) | |
PS1+=$'\[\e[100;93m\] \u@\h ' | |
# Arrow from Segment 1 to Segment 2: | |
# Arrow's foreground is set to dark gray (90) | |
# Arrow's background is set to Light Blue (104) | |
PS1+=$'\[\e[90;104m\]\uE0B0' |
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
#!/usr/bin/env python3 | |
""" | |
vnc_single_window_wx_xlib_dbus.py | |
A Python script that: | |
- Uses python3-xlib (Xlib) to list available windows (plus a "root" option). | |
- Displays a wxPython GUI (ListBox) of windows. | |
- On selection, we run x11vnc on that window (passwordless + accept popup). | |
- Publishes the chosen window name via Avahi (Zeroconf) using python3-dbus instead of avahi-publish-service. |
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 re | |
import hashlib | |
import base58 # pip install base58 | |
import os | |
import sys | |
def hash256(data): | |
"""Perform SHA-256 hash twice.""" | |
return hashlib.sha256(hashlib.sha256(data).digest()).digest() |
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
#!/data/data/com.termux/files/usr/bin/python3 | |
import json | |
import os | |
import subprocess | |
import time | |
import logging | |
import signal | |
# Configuration |
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
# For users with read-only or otherwise unusable HOME directory | |
alias www='sudo -u www-data /bin/bash -c "mkdir -p /tmp/$(id -n -u)-home && cd /tmp/$(id -n -u)-home && (test -e realhome || ln -s $(getent passwd www-data|cut -d':' -f6) realhome) && HOME=/tmp/$(id -n -u)-home exec /bin/bash -l"' | |
# For users with writable HOME | |
alias uuu='cd $(getent passwd www-data|cut -d':' -f6) && sudo -u www-data -s /bin/bash' |
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
## IMPLICIT REPLYING RULES. FOLLOW THOSE RULES IN YOUR RESPONSES UNLESS ASKED TO DO OTHERWISE! | |
Completeness: Avoid stubs, placeholders or incomplete answers. No "// ... existing code" comments! | |
Conciseness: Respond briefly and directly (unless it leads to breaking completeness rule). | |
Language: Answer in English, unless otherwise directed. | |
Code Escaping: Use "~~~" for code in "```" to escape "```". | |
Assistance: Ask user to perform actions on PC/Internet if necessary. | |
Code Standards: Construct code that is clear, modular, and adheres to the chosen style guide. Follow SOLID, KISS, DRY, and YAGNI principles. Make code testable, error-handling, efficient, optimized, and sanitize user input. Highlight security risks, use recognized design patterns. | |
Code Review: Analyze code for improvements or flaws, compute metrics like cyclomatic complexity, duplication, lines of code. |
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
// ==UserScript== | |
// @name flibusta.is качать с названием | |
// @namespace Violentmonkey Scripts | |
// @match *://flibusta.is/a/* | |
// @match *://flibusta.is/s/* | |
// @match *://flibusta.is/sequence/* | |
// @grant GM_setClipboard | |
// @grant GM_download | |
// @version 1.4 | |
// @author - |
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
<?php | |
function compress_int_set($arr) { | |
if (count($arr) == 0) { | |
return ''; | |
} | |
sort($arr); | |
$prev = $arr[0]; |
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 | |
set -ex | |
# fail function to exit with error message | |
fail() { | |
echo "$@" 1>&2 | |
exit 1 | |
} |
NewerOlder