Skip to content

Instantly share code, notes, and snippets.

View sulincix's full-sized avatar
🇹🇷

​​ sulincix

🇹🇷
View GitHub Profile
@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()
@sulincix
sulincix / zirlamican.patch
Last active March 13, 2024 23:14
go disable unused variable error
diff --git a/src/cmd/compile/internal/types2/stmt.go b/src/cmd/compile/internal/types2/stmt.go
index e79e4cd..e135c1d 100644
--- a/src/cmd/compile/internal/types2/stmt.go
+++ b/src/cmd/compile/internal/types2/stmt.go
@@ -63,9 +63,9 @@ func (check *Checker) usage(scope *Scope) {
sort.Slice(unused, func(i, j int) bool {
return cmpPos(unused[i].pos, unused[j].pos) < 0
})
- for _, v := range unused {
- check.softErrorf(v.pos, UnusedVar, "%s declared and not used", v.name)
@sulincix
sulincix / .bashrc
Last active March 28, 2024 18:31
Bashrc
# üşengeçlik
alias c='clear'
alias e='export'
alias a='alias'
alias t='touch'
alias m='mkdir -pv'
alias r='rm -rfv'
alias x='chmod +x -R'
alias h='history'
alias e='exit'
@sulincix
sulincix / scan.py
Created December 5, 2023 08:27
Port Scan using python
#!/usr/bin/env python3
import sys
import socket
def isReachable(ipOrName, port, timeout=2):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(timeout)
try:
s.connect((ipOrName, int(port)))
s.shutdown(socket.SHUT_RDWR)
@sulincix
sulincix / readme.md
Last active November 29, 2023 07:27
Android Tricks

Android 13 battery

adb shell device_config put activity_manager bg_auto_restrict_abusive_apps 1
adb shell device_config put activity_manager bg_current_drain_auto_restrict_abusive_apps_enabled 1

dexopt

adb shell cmd package bg-dexopt-job
@sulincix
sulincix / main.c
Last active November 22, 2023 12:09
C g_signal_connect Passing data
#include <gtk/gtk.h>
typedef struct _a {
gchar* msg;
gint num;
} data;
void button_event(GtkWidget *widget, gpointer f) {
data *d = f;
g_print("%s %d\n", d->msg, d->num);