Skip to content

Instantly share code, notes, and snippets.

View sulincix's full-sized avatar
🇹🇷

​​ sulincix

🇹🇷
View GitHub Profile
@sulincix
sulincix / update.sh
Created September 25, 2024 13:55
Debian update firmware
#!/bin/bash
if [[ $UID -ne 0 ]] ; then
echo "You must be root!"
exit 1
fi
apt update
apt install git make rdfind -yq
if [[ ! -d firmware ]] ; then
git clone https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git firmware --depth=1
fi
@sulincix
sulincix / main.py
Last active July 17, 2024 08:32
python gtk async
#!/usr/bin/env python3
import gi
# gtk import
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GLib
# thread import
import threading
# for sleep
@sulincix
sulincix / parse.c
Created July 7, 2024 09:10
Simple parenthesis parser.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void parse(char* in);
void main(){
char* in="12+(13-22)+(2-4/(33-456))";
parse(in);
}
@sulincix
sulincix / pam_sandbox.c
Created June 11, 2024 11:27
Pam user session isolate
#define _GNU_SOURCE
#include <sched.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <security/pam_appl.h>
@sulincix
sulincix / trackers.txt
Last active May 24, 2024 11:00
Tracker Blocker hosts
0.0.0.0 0000a3-1.l.windowsupdate.com
0.0.0.0 000a55-1.l.windowsupdate.com
0.0.0.0 000a56-1.l.windowsupdate.com
0.0.0.0 000a60-1.l.windowsupdate.com
0.0.0.0 000afa-1.l.windowsupdate.com
0.0.0.0 000b3d-1.l.windowsupdate.com
0.0.0.0 000b25-1.l.windowsupdate.com
0.0.0.0 000b62-1.l.windowsupdate.com
0.0.0.0 0b66ee6159468fcd4bf15132fbbcc861.clo.footprintdns.com
0.0.0.0 000b78-1.l.windowsupdate.com
@sulincix
sulincix / stream.sh
Created April 30, 2024 11:05
http text stream using busybox netcat
#!/bin/bash
{
echo -ne "HTTP 1.1 200 OK\n\r"
echo -ne "Content-type: text/event-stream\n\n"
cat
} | busybox nc -l -p 8000
@sulincix
sulincix / wm.py
Created April 25, 2024 23:25
python window manager for kiosks
#!/usr/bin/python3
from Xlib import X, display
from Xlib import Xatom
class SimpleWindowManager:
def __init__(self):
self.display = display.Display()
self.root = self.display.screen().root
self.displayWidth = self.display.screen().width_in_pixels
@sulincix
sulincix / getty.sh
Created April 23, 2024 20:50
minimal getty but bash script
#!/bin/sh
# minimal getty like script
# speed ignored.
# bgetty 38400 tty1 /bin/login
if [ $# -lt 3 ] ; then
echo "Usage: $0 [speed] [tty] [command]"
exit 1
fi
exec >/dev/$2
exec </dev/$2
@sulincix
sulincix / tg.py
Created April 3, 2024 11:04
telegram-notify.py
#!/usr/bin/env python3
import sys
import gi
from gi.repository import GLib
import dbus
from dbus.mainloop.glib import DBusGMainLoop
token = ""
id = ""
@sulincix
sulincix / 31.py
Created March 28, 2024 18:27
31 power calculator
#!/usr/bin/env python3
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GLib
main = Gtk.Window()
button = Gtk.Button()
label = Gtk.Label()