Skip to content

Instantly share code, notes, and snippets.

View sulincix's full-sized avatar
🇹🇷

​​ sulincix

🇹🇷
View GitHub Profile
@sulincix
sulincix / build.sh
Last active March 22, 2022 12:35
archlinux vagrant images
### tool-init
set -ex
mkdir -p work
if [[ ! -f /bin/archstrap ]] ; then
wget https://gitlab.com/tearch-linux/applications-and-tools/archstrap/-/raw/master/archstrap.sh -O archstrap
mv archstrap /bin/archstrap
chmod +x /bin/archstrap
fi
### create archlinux chroot
archstrap work/rootfs
@sulincix
sulincix / android.sh
Last active November 14, 2022 15:32
Android Emulatörü
#!/bin/bash
set -e
self=$(realpath $0)
# Creating sdk directory
mkdir -p $HOME/.android-emulator/sdk
cd $HOME/.android-emulator/
# İnstalling java
if [[ ! -d $HOME/.android-emulator/jdk-18 ]] ; then
wget -c https://download.java.net/openjdk/jdk18/ri/openjdk-18+36_linux-x64_bin.tar.gz -O java.tar.gz
tar -xf java.tar.gz
@sulincix
sulincix / libadwaita-theming.patch
Created April 7, 2022 23:58
libadwaita theme support
diff --git a/src/adw-style-manager.c b/src/adw-style-manager.c
index ae1a858d..c5b5ac73 100644
--- a/src/adw-style-manager.c
+++ b/src/adw-style-manager.c
@@ -14,6 +14,8 @@
#include "adw-settings-private.h"
#include <gtk/gtk.h>
+int file_exists(const char *fname);
+
@sulincix
sulincix / debian-nosystemd.sh
Last active April 11, 2022 09:38
debian remove systemd
#!/bin/bash
if [[ $UID -ne 0 ]] ; then
echo "You must be root"
exit 1
fi
apt update
# Block service invoke
echo -e "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d
chmod +x /usr/sbin/policy-rc.d
# Remove systemd preremove script.
@sulincix
sulincix / archlinux-convert.sh
Last active April 19, 2022 07:48
replace your existing os with archlinux server
#!/bin/bash
# This script is experimental and may damage your system.
# Please backup files before run this script.
set -e -x
umount -lf /boot/efi || true
mkdir -p /work ; cd /work
wget -c https://gitlab.com/tearch-linux/applications-and-tools/archstrap/-/raw/master/archstrap.sh -O /bin/archstrap
chmod +x /bin/archstrap
apt update
apt install busybox-static zstd -y
@sulincix
sulincix / merge-input.sh
Last active June 4, 2022 20:05
Merge Input
#!/bin/bash
# Create merged input. Merged all input sources.
# Insert this script in /etc/X11/xinit/xinitrc.d/
if [ "$1" == "-u" ]; then
pactl unload-module module-loopback
pactl unload-module module-null-sink
else
# Exit if already loaded.
if pacmd list-sources | grep "combined" &>/dev/null ; then
@sulincix
sulincix / tinywm.c
Created June 10, 2022 22:04
my customized tinywm code
/* TinyWM is written by Nick Welch <nick@incise.org> in 2005 & 2011.
* Modified by Ali Rıza KESKİN in 2019-?
*
* This software is in the public domain
* and is provided AS IS, with NO WARRANTY. */
#include <X11/Xlib.h>
#include <stdlib.h>
#define MAX(a, b) ((a) > (b) ? (a) : (b))
@sulincix
sulincix / purge.sh
Last active February 26, 2024 11:20
nonfree-cleaner (debian)
#!/usr/bin/bash
dpkg-query -W -f='${Section}\t${Package}\n' | grep ^non-free | sed "s/.*\t//g" | xargs apt purge -y
pkg=""
set -e
export LANG=C
apt-cache policy $(apt list --installed | sed "s/\/.*//g") | while read line ; do
if echo "$line" | grep "^[a-zA-Z0-9-]*:$" >/dev/null ; then
pkg=$(echo $line | sed "s/://g")
elif echo $line | grep "non-free" >/dev/null ; then
echo $pkg
@sulincix
sulincix / shc.c
Created August 3, 2022 15:34
Sh compiler
#!/bin/bash
if [[ $# -ne 2 ]] ; then
echo "Usage shc (source.sh) (output.c)"
exit 2
fi
echo "#include <stdlib.h>" > "$2"
echo "int main(){" >> "$2"
echo " return system(\" \\" >> "$2"
cat $1 | sed 's/\\/\\\\/g;s/"/\\"/g;s/$/\\/g' >> "$2"
echo " \");" >> "$2"
@sulincix
sulincix / deepfreeze.sh
Created September 19, 2022 12:35
Universal deepfreeze linux
#!/bin/bash
if [[ -e /sbin/init-normal ]] ; then
exit
fi
mv /sbin/init /sbin/init-normal
cat > /sbin/init <<EOF
#!/bin/bash
mount -t tmpfs tmpfs /tmp || true
mkdir -p /tmp/work/source /tmp/work/a /tmp/work/b /tmp/work/target || true
mount --bind / /tmp/work/source