This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Note: This is experimental script. | |
rm -f *.c *.so* | |
genlib(){ | |
file="$1" | |
nm --dynamic $file | grep -v " U " | grep -v " w " | cut -f3 -d" " | sed "s/.*/void* &(){}/g" > "$(basename $file.c)" | |
gcc -o $(basename $file) "$(basename $file.c)" -shared -nostdlib | |
} | |
#genlib /usr/lib/libKUserFeedbackCore.so.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Compile: | |
gcc -o wait_for_x11 wait_for_x11.c -lX11 | |
Run: | |
./wait_for_x11 :0 | |
*/ | |
#include <X11/Xlib.h> | |
#include <unistd.h> | |
int main(int argc, char *argv[]){ | |
Display *dpy; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile with: | |
// gcc -o main main.c -nostdlib -O0 | |
int print(char* msg, int len){ | |
/* | |
rax = 1 (write) | |
rdi = 1 (stdout) | |
rsi = message | |
rdx = length | |
syscall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
modprobe bonding | |
ip link set eth0 down | |
ip link set eth1 down | |
ip link add bond0 type bond mode 802.3ad | |
ip link set eth0 master bond0 | |
ip link set eth1 master bond0 | |
ip link set bond0 up | |
ip addr add 42.42.42.5/24 dev bond0 | |
ip route add default via 42.42.42.1 dev bond0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qemu-system-aarch64 \ | |
-m 1024 \ | |
-M raspi3b \ | |
-kernel kernel8.img \ | |
-dtb bcm2710-rpi-3-b-plus.dtb \ | |
-sd devuan.img \ | |
-append "console=ttyAMA0 root=/dev/mmcblk0p2 rw rootwait rootfstype=ext4" \ | |
-device usb-net,netdev=net0 \ | |
-netdev user,id=net0,hostfwd=tcp::2222-:22 \ | |
-usb -device usb-mouse -device usb-kbd \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import gi | |
gi.require_version("Gtk","3.0") | |
from gi.repository import Gtk | |
icon = Gtk.StatusIcon.new_from_icon_name("gtk-yes") | |
Gtk.main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create rootfs directory | |
set -ex | |
mkdir /rootfs | |
cd /rootfs | |
# download rootfs | |
repo="https://dl-cdn.alpinelinux.org/alpine/edge/releases/$(uname -m)/" | |
archive=$(wget -O - $repo | grep "minirootfs" | grep "tar.gz<" | sort -V | tail -n1 | cut -f 2 -d "\"") | |
wget -O alpine-rootfs.tar.gz $repo/$archive | |
# extract rootfs | |
tar -xf alpine-rootfs.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set +e | |
f=$(mktemp) | |
red="\033[31;1m" | |
yellow="\033[33;1m" | |
reset="\033[;0m" | |
check_out_of_date(){ | |
link=$(curl https://archlinux.org/packages/?q=$1 | grep -v unstable | grep ">$1<" | grep "<td><a href=" | head -n1 | cut -f2 -d"\"") | |
if [[ $link == "" ]] ; then | |
return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// valac --pkg gtk+-3.0 main.vala -o main | |
int main(string[] args){ | |
double constant_screen = 50.95481424; | |
Gtk.init(ref args); | |
var display = Gdk.Display.get_default(); | |
for (var i = 0; i < display.get_n_monitors (); i++){ | |
var monitor = display.get_monitor(i); | |
var width_milimeter = monitor.get_width_mm(); | |
var height_milimeter = monitor.get_height_mm(); | |
var width_pixel = monitor.get_geometry().width; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IFNAME="wlp3s0" | |
CON_NAME="Pardus-Wifi" | |
PASSWD="1234567891" | |
nmcli c add type wifi \ | |
ifname "${IFNAME}" \ | |
con-name ${CON_NAME} \ | |
autoconnect yes \ | |
ssid "${CON_NAME}" \ | |
802-11-wireless.mode ap \ |