Skip to content

Instantly share code, notes, and snippets.

@Filip62
Filip62 / sunset.sh
Created June 17, 2025 14:44 — forked from Dregu/sunset.sh
Control hyprsunset from waybar through IPC socket
#!/bin/bash
CMD=$1
DELTA=$2
TOGGLE=$3
if [ -z "$CMD" ]; then
echo "Set or get gamma and color temperature through hyprsunset IPC socket"
echo "Usage: sunset.sh <gamma/temperature> [+-][value] [toggle]"
exit 1
fi
if [[ ! -z "$TOGGLE" ]]; then
@Filip62
Filip62 / find_runs.py
Created April 22, 2025 20:47 — forked from alimanfoo/find_runs.py
Find runs of consecutive items in a numpy array.
import numpy as np
def find_runs(x):
"""Find runs of consecutive items in an array."""
# ensure array
x = np.asanyarray(x)
if x.ndim != 1:
raise ValueError('only 1D array supported')
@Filip62
Filip62 / p0f-ssl-2012-05-17.diff
Created January 14, 2024 19:19 — forked from majek/p0f-ssl-2012-05-17.diff
p0f-ssl-2012-05-17.diff
diff --git a/build.sh b/build.sh
index 112e404..2974fdc 100755
--- a/build.sh
+++ b/build.sh
@@ -31,7 +31,7 @@ else
USE_LIBS="-lpcap $LIBS"
fi
-OBJFILES="api.c process.c fp_tcp.c fp_mtu.c fp_http.c readfp.c"
+OBJFILES="api.c process.c fp_tcp.c fp_mtu.c fp_http.c fp_ssl.c readfp.c"
@Filip62
Filip62 / Fix_MCLK_Clock_Stuck_Arch_Linux_Guide.md
Created September 7, 2023 08:57 — forked from Rend0e/Fix_MCLK_Clock_Stuck_Arch_Linux_Guide.md
Fix AMD GPU high idle power MCLK (vram / memory clock) stuck at 96 MHz / 1000 MHz for high refresh rates on Arch Linux Wayland & Xorg

Fix AMD GPU high idle power MCLK (vram / memory clock) stuck at 96 MHz / 1000 MHz for high refresh rates on Arch Linux Wayland & Xorg

On certain resolutions & refresh rates or multi-monitor setups, you might have noticed that your GPU MCLK (vram / memory clock) is stuck at the highest clock frequency (1000 MHz) [1] [2] causing higher GPU idle power draw. On Linux kernel 6.4.x, AMDGPU MCLK (vram/memory) clocks at the lowest, causing major FPS drops while gaming [1] [2]. This is likely due to a monitor not using Coordinated Video Timings (CVT) with a low V-Blank value for the affected resolutions & refresh rates. The higher clocking behavior is due to:

[Well, the reason the clocks get forced to max in some cases is to avoid the flickering you are seeing. There is a certain latency r

@Filip62
Filip62 / sniff_main_thread.py
Created April 24, 2023 12:05 — forked from SkypLabs/sniff_main_thread.py
Multiple code examples used to demonstrate some issues and a solution to sniff network packets inside a thread using Scapy
from scapy.all import *
interface = "eth0"
def print_packet(packet):
ip_layer = packet.getlayer(IP)
print("[!] New Packet: {src} -> {dst}".format(src=ip_layer.src, dst=ip_layer.dst))
print("[*] Start sniffing...")
sniff(iface=interface, filter="ip", prn=print_packet)
@Filip62
Filip62 / rc.lua
Last active November 27, 2022 11:59
Broke clinetkey binding
-- awesome_mode: api-level=4:screen=on
-- If LuaRocks is installed, make sure that packages installed through it are
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall(require, "luarocks.loader")
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library