Skip to content

Instantly share code, notes, and snippets.

View sulincix's full-sized avatar
🇹🇷

​​ sulincix

🇹🇷
View GitHub Profile
@sulincix
sulincix / parse.py
Last active February 14, 2025 14:40
Unsafe Username Lists
import subprocess
import json
users = []
with open("spammer.txt", "r") as f:
users += f.read().split("\n")
process = subprocess.Popen(
["journalctl", "-f"],
stdout=subprocess.PIPE,
@sulincix
sulincix / parse,sh
Created December 21, 2024 19:06
posix shell ini parser without command
#!/bin/sh
parse(){
section="$1"
value="$2"
found="false"
while read line ; do
case $line in
[*)
if [ "$line" == "[$section]" ] ; then
found="true"
@sulincix
sulincix / jq-lite.sh
Last active December 21, 2024 01:42
json formater in posix shell and just sed command
#!/bin/sh
i=0
sed \
"
s/^ *//g
s/^\t*//g
s/,/,\n/g
s/{/\n&\n/g
s/}/\n&/g
s/\[/&\n/g
@sulincix
sulincix / glade_loader.py
Created December 2, 2024 12:56
Automatically define all glade objects by id
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
import xml.etree.ElementTree as ET
def glade_loader(ctx, glade):
builder = Gtk.Builder()
builder.add_from_file(glade)
@sulincix
sulincix / fslist.c
Created December 1, 2024 00:33
List All Available filesystems in C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char** list_filesystems(size_t* len){
char buffer[1024];
FILE* fs = fopen("/proc/filesystems","r");
if(fs == NULL){
perror("Failed to open file");
}
@sulincix
sulincix / flathub-api.md
Last active January 4, 2025 16:32
flathub api v2

Flathub v2 API Documentation

Base URL: https://flathub.org/api/v2

Endpoints

Developers

  • GET /developer
    Returns a list of developers.
@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>