things – Telegram
things
37 subscribers
31 photos
13 videos
10 files
8 links
random 4 u
Download Telegram
archlinux yay hook using "--editor":

~ $ cat ~/.local/bin/yay-pkgbuild-editor.sh
#!/bin/bash
# AMD moment
PKGBUILD_PATH="$1"
PKGBUILD_DIR=$(dirname "$PKGBUILD_PATH")

sed -i \
-e 's/: "${_per_gov:=no}"/: "${_per_gov:=yes}"/' \
-e 's/: "${_tcp_bbr3:=no}"/: "${_tcp_bbr3:=yes}"/' \
-e 's/: "${_processor_opt:=}"/: "${_processor_opt:=native}"/' \
-e 's|"\${_patchsource}/all/0001-cachyos-base-all.patch")|"\${_patchsource}/all/0001-cachyos-base-all.patch"\n "0001-XXX-Restore-old-vblankoff-behavior-for-dgpu.patch")|' \
"$PKGBUILD_PATH"

cp ~/Downloads/0001-XXX-Restore-old-vblankoff-behavior-for-dgpu.patch "$PKGBUILD_DIR/"
cd "$PKGBUILD_DIR" && updpkgsums

exec subl "$PKGBUILD_PATH"
~ $ yay --editor ~/.local/bin/yay-pkgbuild-editor.sh --editmenu --answeredit A --answerclean A --answerdiff N --mflags --skipinteg linux-cachyos






UPD1:

Separate PKGBUILD noscript with all that extra crap I dont even need:
#!/bin/bash
set -e
# always build in yay dir
mkdir -p ~/.cache/yay/ && cd ~/.cache/yay/

# 1. Download the PKGBUILD (without calculating deps yet)
echo ":: [1/4] Downloading linux-cachyos..."
# cleaning

yay -Sccc --noconfirm
yay -G linux-cachyos # Download only
cd linux-cachyos

# 2. Apply Patches
echo ":: [2/4] Patching PKGBUILD (Removing Rust)..."

# Aggressive RUST dependency removal (Handles quotes, spaces, tabs)
sed -i -E '/^[[:space:]]*["'\'']?rust(-bindgen|-src)?([>=<].*)?["'\'']?([[:space:]]*#.*)?$/d' PKGBUILD

# Apply Kernel Options & Configs & rust purge
# breaking kexec
# and some obscure stuff
sed -i \
-e 's/: "${_per_gov:=no}"/: "${_per_gov:=yes}"/' \
-e 's/: "${_tcp_bbr3:=no}"/: "${_tcp_bbr3:=yes}"/' \
-e 's/: "${_processor_opt:=}"/: "${_processor_opt:=native}"/' \
-e 's/: "${_makenconfig:=yes}"/: "${_makenconfig:=no}"/' \
-e 's|"\${_patchsource}/all/0001-cachyos-base-all.patch")|"\${_patchsource}/all/0001-cachyos-base-all.patch"\n "0001-XXX-Restore-old-vblankoff-behavior-for-dgpu.patch")|' \
-e '/^prepare() {/a\ export RUSTC=no\n export BINDGEN=no\n export HOSTRUSTC=no' \
-e '/### Rewrite configuration/i\ # Force disable Rust and dependencies\n noscripts/config -d RUST -d SAMPLES_RUST -d DRM_PANIC_SCREEN_QR_CODE' \
-e '/### Rewrite configuration/i\ # Disable kexec\n noscripts/config -d KEXEC -d KEXEC_FILE -d KEXEC_SIG -d KEXEC_CORE -d CRASH_DUMP -d KEXEC_HANDOVER' \
-e '/### Rewrite configuration/i\ # Server / Enterprise\n noscripts/config -d LIVEPATCH -d INFINIBAND -d ISCSI_TCP' \
-e '/### Rewrite configuration/i\ # Unused network protocols\n noscripts/config -d AF_RXRPC -d TIPC -d ATM -d DECNET -d NFC -d HAMRADIO -d X25 -d LAPB' \
-e '/### Rewrite configuration/i\ # Unused filesystems\n noscripts/config -d OCFS2_FS -d GFS2_FS -d CEPH_FS -d AFS_FS -d CODA_FS -d 9P_FS -d JFS_FS -d REISERFS_FS -d NILFS2_FS -d MINIX_FS' \
-e '/### Rewrite configuration/i\ # Debugging\n noscripts/config -d SCHED_DEBUG' \
-e '/### Rewrite configuration/i\ # Unused hardware\n noscripts/config -d PCCARD -d FIREWIRE -d GNSS -d COMEDI -d GREYBUS' \
-e '/# Install .rmeta files/,/fi/d' \
-e '/# Install .so files/,/fi/d' \
-e 's/^pkgbase="linux-\$_pkgsuffix"/_pkgsuffix=cirnos\npkgbase="linux-\$_pkgsuffix"/' \
-e 's/^pkgdesc=.*/pkgdesc="Custom Kernel Build (Rust Free)"/' \
-e 's/^export KBUILD_BUILD_HOST=cachyos/export KBUILD_BUILD_HOST=build-pc/' \
-e 's/^# Maintainer: Peter Jung.*/# Maintainer: Name <me@example.com>/' \
PKGBUILD

# 3. Add custom patch
echo ":: [3/4] Adding custom patch..."
cp ~/Downloads/0001-XXX-Restore-old-vblankoff-behavior-for-dgpu.patch .

# 4. Build and Install
# This runs makepkg on the LOCALLY modified file.
# Since we patched it BEFORE this step, it will NOT ask for Rust.
echo ":: [4/4] Building and Installing..."
updpkgsums
makepkg -si
listing system wide standards configuration variables:

getconf -a
This media is not supported in your browser
VIEW IN TELEGRAM
ffmpeg, vibrant glitch with audio shift:

ffmpeg -stream_loop -1 -i "1.mp4" -stream_loop -1 -i "2.ogg" -filter_complex "[0:v]trim=duration=12,setpts=PTS-STARTPTS, \
hue=H='2*PI*t*3':s=3:enable='gte(t,5)', \
negate=enable='gte(t,5)'[v]; \
[1:a]atrim=start=9:duration=12,asetpts=PTS-STARTPTS,volume=2.8,bass=g=12:f=100[a]" -map "[v]" -map "[a]" -c:v libx264 -c:a aac -t 12 "vibrant_glitch.mp4"
1
This media is not supported in your browser
VIEW IN TELEGRAM
ffmpeg glow effect glitch:

ffmpeg -stream_loop -1 -i "1.mp4" -stream_loop -1 -i "2.ogg" -filter_complex "[0:v]trim=duration=12,setpts=PTS-STARTPTS,split=2[base][glitch]; \
[glitch]gblur=sigma=20:enable='gte(t,5)', \
hue=H='2*PI*t*2':s=2:enable='gte(t,5)'[glitcheffect]; \
[base][glitcheffect]blend=all_mode=screen:all_opacity=0.7:enable='gte(t,5)'[v]; \
[1:a]atrim=start=9:duration=12,asetpts=PTS-STARTPTS,volume=2.7,bass=g=12:f=100[a]" -map "[v]" -map "[a]" -c:v libx264 -c:a aac -t 12 "happy_glitch_original_audio.mp4"
Media is too big
VIEW IN TELEGRAM
freaked interfaces №47

seems modern UWP/XAML notepad adding garbage to the buffer
List progs startup times:
ps -eo pid,lstart,cmd
discover all domains/subdomains a company uses by cert & form proper list:

curl -s "https://crt.sh/?q=google.com&output=json" | jq -r '.[] | .common_name, .name_value' | sed 's/^\*\.//' | sort -u | grep -E '^[a-zA-Z0-9.-]+$'


Useful for generating DNS PBR lists for sites.
👏1
This media is not supported in your browser
VIEW IN TELEGRAM
Run clean temp chromium in docker native under X11:


upd2 (more clean command):
XDG="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
XA="${XAUTHORITY:-$HOME/.Xauthority}"

docker run --rm -it --name "chromium-$(date +%s)" \
--security-opt apparmor:unconfined --security-opt no-new-privileges=false \
--cap-add=SYS_ADMIN --net host --device /dev/input --device /dev/snd --device /dev/dri \
-v ~/Downloads:/downloads -v /tmp/chromium-docker:/data \
-e PUID=$(id -u) -e PGID=$(id -g) -e DISPLAY -e XAUTHORITY=$XA \
-v $XA:$XA:ro -v /tmp/.X11-unix:/tmp/.X11-unix:ro -v /dev/shm:/dev/shm \
-v ~/.config/pulse:/home/ubuntu/.config/pulse:ro \
-v /etc/machine-id:/etc/machine-id:ro \
-v $XDG/pulse:$XDG/pulse:ro -v $XDG/bus:$XDG/bus:ro \
-v /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:ro \
-v /run/dbus:/run/dbus:ro -v /run/udev/data:/run/udev/data:ro \
-v /etc/localtime:/etc/localtime:ro \
andrewmackrodt/chromium-x11


there also firefox version laying around internet, just use search
🤮2
sniff DNS queries on localhost:

tshark -i lo -T fields -e dns.qry.name
Sys progs debugging Tips & Tricks:

strace is very handy dynamic analysis tool, but extremely verbose.
There how you can tame strace filtering using trace= param:

For example, if you have a program like:

#include <stdlib.h>

int main() { system( " ls /usr " ); };


which executing some programs inside and you're curious about what it's actually trying to do with which argument?

cc this example and try this:


cc 1.c

strace -f -e trace=execve,execveat,fork,vfork,clone,clone3,exit_group ./a.out


Output will be like so:
...
[pid 27862] execve("/bin/sh", ["sh", "-c", "--", " ls /usr "], 0x7ffd668ba8e8 /* 64 vars */) = 0
...
[pid 26344] execve("/usr/bin/ls", ["ls", "/usr"], 0x55edbcf792b0 /* 64 vars */) = 0
...


telling us that the "./a.out" prog actually made 2 execve calls, the "/usr/bin/ls" program with "/usr" as its argument was running using shell "/bin/sh".



-- Be careful when making inferences about the user/kernel boundary if only a subset of system calls are being monitored. The default is trace=all. strace(1) man.



----
Also, there multiple ways to search|list syscalls:

0.
grep exec /usr/include/sys/syscall.h /usr/include/bits/syscall.h /usr/include/asm/unistd*.h


1.
echo '#include <sys/syscall.h>' | cpp -dM | grep exec


2.
ausyscall --dump | grep exec





----
👍1🤔1
bash users can check current time in UTC+00:00 using:

cat < /dev/tcp/time.nist.gov/13


just in case
things
me channels also: just some random links/netstalking: t.me/WebsiteToday and random music: t.me/tuneToday
upd about https://news.1rj.ru/str/tuneToday

Just made this channel live at:

https://tunetoday.duckdns.org:10000

Same songs available there in shuffle mode 24\7.

SSL certificates may be broken; sorry for this.
Have no much time to maintain it properly.
Thx for understanding.
Top 10 funniest linux moments
№10: no space
ps way to view memory used by process:

ps --ppid 2 -N k-rss -o rss,comm


Output in MiB:

ps --ppid 2 -N k-rss -o rss=,comm=|while read r c; do printf "%dM %s\n" "$((r>>10))" "$c"; done


Colors !!!
ps --ppid 2 -N k-rss -o rss=,comm=|while read r c; do printf "\e[32m%4dM\e[0m %s\n" "$((r>>10))" "$c"; done
Ladies and gentlemen, let me introduce you to the:

all clock


watch -n1 'date +"%% %a %A %b %B %c %C %d %D %e %F %g %G %h %H %I %j %k %l %m %M %N %p %P %q %r %R %s %S %t %T %u %U %V %w %W %x %X %y %Y %z %:z %::z %:::z %Z %^a %^A %^b %^B %^h %^c %^p %^P %^r %^x %^X %^Z %#a %#A %#b %#B %#h %#c %#p %#P %#r %#x %#X %#Z %-C %-d %-e %-g %-G %-H %-I %-j %-k %-l %-m %-M %-N %-q %-s %-S %-u %-U %-V %-w %-W %-y %-Y %-z %-:z %-::z %-:::z %_C %_d %_e %_g %_G %_H %_I %_j %_k %_l %_m %_M %_N %_q %_s %_S %_u %_U %_V %_w %_W %_y %_Y %_z %_:z %_::z %_:::z %0C %0d %0e %0g %0G %0H %0I %0j %0k %0l %0m %0M %0N %0q %0s %0S %0u %0U %0V %0w %0W %0y %0Y %0z %0:z %0::z %0:::z %+4C %+4d %+4g %+4G %+4j %+4m %+4s %+4Y %Ec %EC %Ex %EX %Ey %EY %Od %Oe %OH %OI %Om %OM %OS %Ou %OU %OV %Ow %OW %Oy"'
🏆1
simple HEX tricks

Encode HEX:
printf '%02X' $(sed "s/./'& /g;s/' /32 /g"<<<"hello chat"); echo


Decode HEX:
printf $(sed 's/ //g;s/../\\x&/g'<<<"68656C6C6F2063686174"); echo
for faking uptime you can hook every function calling CLOCK_BOOTTIME, for example (from kallsyms):
"ktime_get_with_offset",       
"ktime_get_coarse_with_offset",
"ktime_get_boottime",
"ktime_get_boottime_ns",
"ktime_get_boot_fast_ns",



some funny observations:
they didnt expect more than 2147483647 seconds of uptime.

it looks not perfect, but it can successfully fake it in /usr/bin/uptime or htop.
funny while:

x=42
while (( x --\
\
\
\
> 0 )); do
echo "$x"
done