Skip to content

Instantly share code, notes, and snippets.

View nikp123's full-sized avatar
🎯
university does like to bother me a lot

nikp123 nikp123

🎯
university does like to bother me a lot
View GitHub Profile
@nikp123
nikp123 / poweroff_when_unplugged.sh
Created October 7, 2017 14:17
A script that powers off your device when unplugged from the charger
#!/system/bin/sh
# Written by nikp123 2017 :D
# Powers off android when you unplug it from the charger
# Make sure busybox is installed in order this to work
while :
do
sleep 10
@nikp123
nikp123 / c.bat
Created May 9, 2018 12:43
Some goofy script that I made while in school
@echo off
echo d8, d8b d8, d8,
echo `8P 88P `8P `8P
echo d88
echo d8888b?88,.d88b, 88b888 d8888b?88,.d88b, .d888b, 88b d88 d888b8b
echo d8b_,dP`?88' ?88 88P?88 d8b_,dP`?88' ?88 ?8b, 88P ?88 d8P' ?88
echo 88b 88b d8P d88 88b 88b 88b d8P `?8b d88 88b 88b ,88b
echo `?888P' 888888P'd88' 88b`?888P' 888888P'`?888P' d88' `88b`?88P'`88b
echo 88P' 88P' )88
echo d88 d88 ,88P
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <sys/ioctl.h>
#include <unistd.h>
int main(int argc, char* argv[]) {
if(argc<2) {
printf("Usage: %s outputfile\n", argv[0]);
return 1;
// COMPILE with any C++ compiler and link with SDL2
#include <iostream>
#include <vector>
#include <memory>
#include <SDL2/SDL.h>
#define WIN_HEIGHT 800
#define WIN_WIDTH 800
/**
Copyright (c) 2020 Nikola Pavlica
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@nikp123
nikp123 / monitor_config
Last active January 11, 2021 19:17
Changing display resolutions in sway
#!/bin/bash
swaymsg="$(swaymsg -t get_outputs -r)"
numOfModes=$(echo $swaymsg|jq -r '.[0].modes | length')
modes=''
widths="$(echo $swaymsg|jq -r '.[0].modes[].width')"
IFS=$'\n' widths=($widths)
#!/bin/sh
while ! swaymsg -t get_tree | grep $1; do
sleep 0.1
done
swaymsg [class="$1"] kill
@nikp123
nikp123 / script.sh
Created May 7, 2020 23:56
ChatDestroyer - A script for your immoral deeds
#!/bin/sh
FILE=$1
MAX_SIZE=$2
rm x*
split -b $2 $1
sleep 1
for i in x??; do
@nikp123
nikp123 / refresh_wall_on_display_change_mate.c
Created September 26, 2020 21:42
FIxes a dumb wallpaper bug when using i3 with MATE
#include <stdio.h>
#include <stdlib.h>
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
static XEvent xEvent;
static Display *XDisplay;
static Screen *XScreen;
@nikp123
nikp123 / linux-tpc-9150.patch
Last active September 7, 2021 11:35
Linux enablement patch for TPC-9150
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 8e5d4ab4e..90e460980 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1170,6 +1170,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
sun7i-a20-pcduino3.dtb \
sun7i-a20-pcduino3-nano.dtb \
sun7i-a20-wexler-tab7200.dtb \
+ sun7i-a20-tpc9150.dtb \
sun7i-a20-wits-pro-a20-dkt.dtb