Compare commits

..

3 Commits

Author SHA1 Message Date
lucca 498aed50d2 added profile 2026-09-19 21:23:27 -04:00
lucca 96895c9755 fixed the modes but now the refresh is 115ish on both 2026-09-07 20:07:10 -04:00
lucca cb576da8b5 before editing 900i and 1000i to work on 120hz capped sony crt 2026-09-07 20:02:27 -04:00
27 changed files with 2014 additions and 6 deletions
+8 -4
View File
@@ -7,11 +7,15 @@ addMode () {
#addMode "1280x960_120i" 105.90 1280 1360 1496 1712 960 963 969 1031 -HSync +Vsync interlace
#addMode "1280x960_120i" 105.50 1280 1360 1496 1712 960 963 969 1031 -HSync +VSync Interlace #119hz
addMode "1280x960_120i" 105.90 1280 1360 1496 1712 960 963 969 1031 -HSync +VSync Interlace
addMode "1600x900_120i" 124.240 1600 1696 1864 2128 900 903 908 949 -HSync +VSync interlace
addMode "1600x1000_120i" 137.500 1600 1696 1864 2128 1000 1003 1008 1049 -HSync +VSync interlace
addMode "1600x900_120i" 120.000 1600 1696 1864 2128 900 903 908 975 -HSync +VSync Interlace
addMode "1600x1000_120i" 133.000 1600 1696 1864 2128 1000 1003 1008 1075 -HSync +VSync Interlace
#addMode "640x480_120p" 52.50 640 680 744 848 480 483 487 518 -hsync +vsync
addMode "640x480_120p" 52.41 640 680 744 848 480 481 484 515 +HSync -Vsync
#addMode "640x480_120p" 52.41 640 680 744 848 480 481 484 515 +HSync -Vsync
#addMode "640x480_120p" 52.35 640 680 744 848 480 481 484 515 +HSync -Vsync #flicker fix (119hz)
#addMode "640x480_120p" 51.97 640 680 744 848 480 481 484 515 +HSync -Vsync
addMode "640x480_120p" 52.95 640 680 748 856 480 482 485 516 -HSync +VSync
addMode "480x360_120p" 29.00 480 504 552 624 360 363 367 389 -hsync +vsync #enter the gungeon
addMode "760x284_120p" 35.50 760 792 864 968 284 287 297 308 -hsync +vsync #downwell
addMode "1920x240_120p" 92.443 1920 2202 2266 2744 240 245 250 281 -HSync -VSync
addMode "640x360_119i_down" 27.810 640 672 736 824 360 365 373 563 -HSync -VSync Interlace
addMode "640x360_119i_up" 27.810 640 672 736 824 360 485 493 563 -HSync -VSync Interlace
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
cc controller-off.c -o controller-off $(pkg-config --cflags --libs sdl3)
BIN
View File
Binary file not shown.
+704
View File
@@ -0,0 +1,704 @@
/*
* controller-off.c
*
* Global SDL3 controller disconnect utility.
*
* Button combination:
*
* Guide/Home + North
*
* SDL mapping:
*
* PlayStation -> Home + Triangle
* Xbox -> Guide + Y
* Nintendo -> Home + X
*
* Build:
*
* cc controller-off.c -o controller-off \
* $(pkg-config --cflags --libs sdl3)
*
* Run:
*
* ./controller-off
*/
#include <SDL3/SDL.h>
#include <ctype.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#define MAX_CONTROLLERS 32
#define MAC_LEN 18
typedef struct {
SDL_JoystickID id;
SDL_Gamepad *gamepad;
int guide_pressed;
int north_pressed;
/*
* Prevent repeated triggers while both buttons
* remain held.
*/
int triggered;
} Controller;
static Controller controllers[MAX_CONTROLLERS];
static int controller_count = 0;
static volatile sig_atomic_t running = 1;
/*
* ------------------------------------------------------------
* Check for XX:XX:XX:XX:XX:XX
* ------------------------------------------------------------
*/
static int is_mac(const char *s)
{
if (!s || strlen(s) != 17)
return 0;
for (int i = 0; i < 17; i++) {
if (i == 2 ||
i == 5 ||
i == 8 ||
i == 11 ||
i == 14) {
if (s[i] != ':')
return 0;
} else {
if (!isxdigit(
(unsigned char)s[i]))
return 0;
}
}
return 1;
}
/*
* ------------------------------------------------------------
* Find a connected Bluetooth device whose name matches
* the SDL controller name.
*
* bluetoothctl output:
*
* Device AA:BB:CC:DD:EE:FF PS3 Controller
*
* We use:
*
* bluetoothctl devices Connected
* ------------------------------------------------------------
*/
static int find_bluetooth_device(
const char *controller_name,
char mac[MAC_LEN])
{
if (!controller_name)
return 0;
FILE *fp = popen(
"bluetoothctl devices Connected 2>/dev/null",
"r"
);
if (!fp)
return 0;
char line[1024];
while (fgets(
line,
sizeof(line),
fp
)) {
char candidate_mac[MAC_LEN];
char device_name[768];
memset(
candidate_mac,
0,
sizeof(candidate_mac)
);
memset(
device_name,
0,
sizeof(device_name)
);
/*
* bluetoothctl:
*
* Device MAC NAME
*/
if (sscanf(
line,
"Device %17s %[^\n]",
candidate_mac,
device_name
) != 2) {
continue;
}
if (!is_mac(candidate_mac))
continue;
/*
* SDL and bluetoothctl may use slightly
* different names.
*
* First try exact match.
*/
if (strcmp(
controller_name,
device_name
) == 0) {
strncpy(
mac,
candidate_mac,
MAC_LEN
);
mac[MAC_LEN - 1] = '\0';
pclose(fp);
return 1;
}
/*
* PS3-specific fallback.
*
* SDL:
*
* PS3 Controller
*
* BlueZ:
*
* PLAYSTATION(R)3 Controller
*/
if (
strstr(controller_name, "PS3") &&
strstr(device_name, "3 Controller")
) {
strncpy(
mac,
candidate_mac,
MAC_LEN
);
mac[MAC_LEN - 1] = '\0';
pclose(fp);
return 1;
}
}
pclose(fp);
return 0;
}
/*
* ------------------------------------------------------------
* Disconnect Bluetooth device.
* ------------------------------------------------------------
*/
static void disconnect_bluetooth(
const char *mac)
{
if (!is_mac(mac))
return;
printf(
"Disconnecting Bluetooth device %s\n",
mac
);
fflush(stdout);
pid_t pid = fork();
if (pid < 0) {
perror("fork");
return;
}
if (pid == 0) {
/*
* Suppress bluetoothctl output.
*/
FILE *devnull =
fopen("/dev/null", "w");
if (devnull) {
dup2(
fileno(devnull),
STDOUT_FILENO
);
dup2(
fileno(devnull),
STDERR_FILENO
);
fclose(devnull);
}
execlp(
"bluetoothctl",
"bluetoothctl",
"disconnect",
mac,
(char *)NULL
);
_exit(127);
}
/*
* Reap child process.
*/
waitpid(
pid,
NULL,
0
);
}
/*
* ------------------------------------------------------------
* Handle the button combination.
* ------------------------------------------------------------
*/
static void disconnect_controller(
Controller *controller)
{
if (!controller ||
!controller->gamepad)
return;
const char *name =
SDL_GetGamepadName(
controller->gamepad
);
printf("\n");
printf(
"PS/Home + North detected\n"
);
printf(
"Controller: %s\n",
name ? name : "Unknown"
);
char mac[MAC_LEN];
if (!find_bluetooth_device(
name,
mac
)) {
fprintf(
stderr,
"Could not find a connected Bluetooth "
"device matching \"%s\".\n",
name ? name : "Unknown"
);
return;
}
printf(
"Bluetooth MAC: %s\n",
mac
);
disconnect_bluetooth(mac);
}
/*
* ------------------------------------------------------------
* Find SDL controller.
* ------------------------------------------------------------
*/
static Controller *find_controller(
SDL_JoystickID id)
{
for (int i = 0;
i < controller_count;
i++) {
if (controllers[i].id == id)
return &controllers[i];
}
return NULL;
}
/*
* ------------------------------------------------------------
* Add controller.
* ------------------------------------------------------------
*/
static void add_controller(
SDL_JoystickID id)
{
if (controller_count >=
MAX_CONTROLLERS) {
fprintf(
stderr,
"Controller limit reached.\n"
);
return;
}
SDL_Gamepad *gamepad =
SDL_OpenGamepad(id);
if (!gamepad) {
fprintf(
stderr,
"SDL_OpenGamepad failed: %s\n",
SDL_GetError()
);
return;
}
Controller *controller =
&controllers[
controller_count++
];
memset(
controller,
0,
sizeof(*controller)
);
controller->id = id;
controller->gamepad = gamepad;
const char *name =
SDL_GetGamepadName(gamepad);
printf(
"Controller connected: %s\n",
name ? name : "Unknown"
);
}
/*
* ------------------------------------------------------------
* Remove controller.
* ------------------------------------------------------------
*/
static void remove_controller(
SDL_JoystickID id)
{
for (int i = 0;
i < controller_count;
i++) {
if (controllers[i].id != id)
continue;
SDL_CloseGamepad(
controllers[i].gamepad
);
/*
* Fill the removed slot with the last
* controller.
*/
controllers[i] =
controllers[
controller_count - 1
];
controller_count--;
return;
}
}
/*
* ------------------------------------------------------------
* Signal handler.
* ------------------------------------------------------------
*/
static void handle_signal(
int signal)
{
(void)signal;
running = 0;
}
/*
* ------------------------------------------------------------
* Main
* ------------------------------------------------------------
*/
int main(void)
{
signal(
SIGINT,
handle_signal
);
signal(
SIGTERM,
handle_signal
);
if (!SDL_Init(
SDL_INIT_GAMEPAD)) {
fprintf(
stderr,
"SDL_Init failed: %s\n",
SDL_GetError()
);
return 1;
}
/*
* Receive controller events even though we have
* no window/focus.
*/
SDL_SetHint(
SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS,
"1"
);
printf(
"====================================\n"
" Controller Off\n"
"====================================\n"
"Hold Home/Guide + Triangle/North\n"
"to disconnect the controller.\n\n"
);
/*
* Open controllers that already exist.
*/
int count = 0;
SDL_JoystickID *ids =
SDL_GetGamepads(&count);
if (ids) {
for (int i = 0;
i < count;
i++) {
add_controller(ids[i]);
}
SDL_free(ids);
}
SDL_Event event;
while (running) {
while (SDL_PollEvent(&event)) {
/*
* Controller added.
*/
if (event.type ==
SDL_EVENT_GAMEPAD_ADDED) {
add_controller(
event.gdevice.which
);
}
/*
* Controller removed.
*/
else if (event.type ==
SDL_EVENT_GAMEPAD_REMOVED) {
remove_controller(
event.gdevice.which
);
}
/*
* Button press/release.
*/
else if (
event.type ==
SDL_EVENT_GAMEPAD_BUTTON_DOWN ||
event.type ==
SDL_EVENT_GAMEPAD_BUTTON_UP
) {
Controller *controller =
find_controller(
event.gbutton.which
);
if (!controller)
continue;
int pressed =
event.type ==
SDL_EVENT_GAMEPAD_BUTTON_DOWN;
/*
* Guide/Home/PS.
*/
if (event.gbutton.button ==
SDL_GAMEPAD_BUTTON_GUIDE) {
controller->guide_pressed =
pressed;
}
/*
* North:
*
* PS = Triangle
* Xbox = Y
* Nintendo = X
*/
if (event.gbutton.button ==
SDL_GAMEPAD_BUTTON_NORTH) {
controller->north_pressed =
pressed;
}
/*
* Trigger only once per press.
*/
if (controller->guide_pressed &&
controller->north_pressed &&
!controller->triggered) {
controller->triggered = 1;
disconnect_controller(
controller
);
}
/*
* Allow another trigger after
* either button is released.
*/
if (!controller->guide_pressed ||
!controller->north_pressed) {
controller->triggered = 0;
}
}
}
SDL_Delay(5);
}
/*
* Cleanup.
*/
for (int i = 0;
i < controller_count;
i++) {
if (controllers[i].gamepad)
SDL_CloseGamepad(
controllers[i].gamepad
);
}
SDL_Quit();
return 0;
}
+2
View File
@@ -0,0 +1,2 @@
testvidmode "640x360_119i_down" 27.810 640 672 736 824 360 365 373 563 -HSync -VSync Interlace
testvidmode "640x360_119i_up" 27.810 640 672 736 824 360 485 493 563 -HSync -VSync Interlace
+1
View File
@@ -7,3 +7,4 @@ xmodmap -e 'remove mod4 = Hyper_L'
xmodmap -e 'remove mod1 = Hyper_L'
xmodmap -e 'clear mod3'
xmodmap -e 'add mod3 = Hyper_L'
systemctl --user restart sxhkd
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
echo nameserver 10.0.0.1 > /etc/resolv.conf
+108
View File
@@ -0,0 +1,108 @@
#!/bin/sh
# Local-only Wi-Fi hotspot for Kali NetHunter / Android
# SSID: vegeta black
# Password: supermarioinreallife
IFACE="wlan1" # Change if needed (check with: ip link / iw dev)
SSID="vegeta black"
PSK="supermarioinreallife"
CHANNEL="6"
AP_IP="192.168.43.1"
DHCP_RANGE="192.168.43.10,192.168.43.50,12h"
# Check root
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
echo "[*] Hard reset of Wi-Fi stack..."
# Full path to Android's svc
/system/bin/svc wifi disable 2>/dev/null
killall hostapd dnsmasq wpa_supplicant wificond 2>/dev/null
sleep 1
pkill -9 hostapd
sleep 3
# Delete the interface
iw dev $IFACE del 2>/dev/null
sleep 1
# Create a fresh AP interface
iw phy phy0 interface add $IFACE type __ap 2>/dev/null || \
iw phy phy0 interface add $IFACE type ap 2>/dev/null
sleep 1
ip link set $IFACE down 2>/dev/null
ip addr flush dev $IFACE 2>/dev/null
ip link set $IFACE up
sleep 1
# Create hostapd config
cat > /tmp/hostapd-"$IFACE".conf <<EOF
interface=$IFACE
driver=nl80211
ssid=$SSID
hw_mode=g
channel=$CHANNEL
ieee80211n=1
wmm_enabled=1
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=$PSK
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
EOF
# Start hostapd
hostapd -B /tmp/hostapd-"$IFACE".conf || {
echo "hostapd failed to start"
exit 1
}
# Assign static IP to the AP interface
ip addr add "$AP_IP/24" dev "$IFACE"
ip link set "$IFACE" up
# Remove any previous rules/routes
ip rule del pref 50 2>/dev/null
ip rule del from "$AP_IP"/32 table 200 2>/dev/null
ip route flush table 200 2>/dev/null
# Policy routing for the NAO network
ip route add 192.168.43.0/24 dev "$IFACE" src "$AP_IP" table 200
ip rule add pref 50 to 192.168.43.0/24 lookup 200
ip rule add from "$AP_IP"/32 table 200
# Start dnsmasq (DHCP only – no DNS forwarding / no internet)
dnsmasq \
--interface="$IFACE" \
--bind-interfaces \
--dhcp-range="$DHCP_RANGE" \
--dhcp-option=3,"$AP_IP" \
--dhcp-option=6,"$AP_IP" \
--port=0 \
--no-resolv \
--pid-file=/tmp/dnsmasq-"$IFACE".pid \
--log-facility=/tmp/dnsmasq-"$IFACE".log &
sleep 1
# Show status
echo
echo "Local-only hotspot started"
echo " Interface : $IFACE"
echo " SSID : $SSID"
echo " Password : $PSK"
echo " Gateway : $AP_IP"
echo
iw dev "$IFACE" info 2>/dev/null | head -n 15
echo
ip addr show "$IFACE"
echo
echo "Clients will receive IPs in the range 192.168.43.10 – 192.168.43.50"
echo "No internet is shared (local network only)."
+39
View File
@@ -0,0 +1,39 @@
#!/bin/sh
# Stop the local-only hotspot created by localhotspot
IFACE="wlan1" # Must match the interface used in localhotspot
# Check root
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
echo "[*] Stopping local hotspot..."
# Kill the daemons
killall hostapd dnsmasq 2>/dev/null
pkill -9 hostapd 2>/dev/null
pkill -9 dnsmasq 2>/dev/null
sleep 1
# Remove routing rules that were added
ip rule del pref 50 2>/dev/null
ip rule del from 192.168.43.1/32 table 200 2>/dev/null
ip route flush table 200 2>/dev/null
# Bring the interface down and remove the IP
ip addr flush dev "$IFACE" 2>/dev/null
ip link set "$IFACE" down 2>/dev/null
# Delete the AP interface
iw dev "$IFACE" del 2>/dev/null
# Clean up temporary files
rm -f /tmp/hostapd-"$IFACE".conf
rm -f /tmp/dnsmasq-"$IFACE".pid
rm -f /tmp/dnsmasq-"$IFACE".log
echo "[+] Hotspot stopped."
echo " Interface $IFACE has been removed."
+61
View File
@@ -0,0 +1,61 @@
#!/bin/sh
IFACE="wlan1"
SSID="naorobotwifi"
PSK="supermarioinreallife"
ip link set "$IFACE" up || exit 1
cat >/tmp/wpa-"$IFACE".conf <<EOF
ctrl_interface=/run/wpa_supplicant
update_config=0
network={
ssid="$SSID"
psk="$PSK"
key_mgmt=WPA-PSK
}
EOF
killall wpa_supplicant 2>/dev/null
wpa_supplicant -B -i "$IFACE" -c /tmp/wpa-"$IFACE".conf || exit 1
if command -v dhclient >/dev/null 2>&1; then
dhclient "$IFACE"
elif command -v udhcpc >/dev/null 2>&1; then
udhcpc -i "$IFACE"
elif command -v dhcpcd >/dev/null 2>&1; then
dhcpcd "$IFACE"
else
echo "No DHCP client found."
exit 1
fi
iw dev "$IFACE" link
ip addr show "$IFACE"
# Wait for DHCP to assign an address
sleep 2
IP=$(ip -4 -o addr show dev "$IFACE" | awk '{print $4}' | cut -d/ -f1)
if [ -z "$IP" ]; then
echo "Failed to obtain an IPv4 address on $IFACE"
exit 1
fi
# Remove any previous rules/routes
ip rule del pref 50 2>/dev/null
ip rule del from "$IP"/32 table 200 2>/dev/null
ip route flush table 200 2>/dev/null
# Policy routing for the NAO network
ip route add 192.168.0.0/24 dev "$IFACE" src "$IP" table 200
ip rule add pref 50 to 192.168.0.0/24 lookup 200
ip rule add from "$IP"/32 table 200
echo
echo "Connected on $IFACE ($IP)"
echo
ip route get 192.168.0.100
+86
View File
@@ -0,0 +1,86 @@
#!/bin/sh
# Local-only Wi-Fi hotspot for Kali NetHunter / Android
# SSID: vegeta black
# Password: supermarioinreallife
IFACE="wlan1" # Change if needed (check with: ip link / iw dev)
SSID="vegeta black"
PSK="supermarioinreallife"
CHANNEL="6"
AP_IP="192.168.43.1"
DHCP_RANGE="192.168.43.10,192.168.43.50,12h"
# Check root
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
# Kill previous instances
killall hostapd dnsmasq wpa_supplicant 2>/dev/null
sleep 1
# Bring interface down and clean it
ip link set "$IFACE" down 2>/dev/null
ip addr flush dev "$IFACE" 2>/dev/null
ip link set "$IFACE" up || {
echo "Failed to bring up $IFACE"
exit 1
}
# Create hostapd config
cat > /tmp/hostapd-"$IFACE".conf <<EOF
interface=$IFACE
driver=nl80211
ssid=$SSID
hw_mode=g
channel=$CHANNEL
ieee80211n=1
wmm_enabled=1
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=$PSK
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
EOF
# Start hostapd
hostapd -B /tmp/hostapd-"$IFACE".conf || {
echo "hostapd failed to start"
exit 1
}
# Assign static IP to the AP interface
ip addr add "$AP_IP/24" dev "$IFACE"
ip link set "$IFACE" up
# Start dnsmasq (DHCP only – no DNS forwarding / no internet)
dnsmasq \
--interface="$IFACE" \
--bind-interfaces \
--dhcp-range="$DHCP_RANGE" \
--dhcp-option=3,"$AP_IP" \
--dhcp-option=6,"$AP_IP" \
--port=0 \
--no-resolv \
--pid-file=/tmp/dnsmasq-"$IFACE".pid \
--log-facility=/tmp/dnsmasq-"$IFACE".log &
sleep 1
# Show status
echo
echo "Local-only hotspot started"
echo " Interface : $IFACE"
echo " SSID : $SSID"
echo " Password : $PSK"
echo " Gateway : $AP_IP"
echo
iw dev "$IFACE" info 2>/dev/null | head -n 15
echo
ip addr show "$IFACE"
echo
echo "Clients will receive IPs in the range 192.168.43.10 – 192.168.43.50"
echo "No internet is shared (local network only)."
+85
View File
@@ -0,0 +1,85 @@
#!/bin/sh
IFACE="wlan1"
SSID="vegetablack"
PSK="supermarioinreallife"
CHANNEL="11"
AP_IP="192.168.43.1"
[ "$(id -u)" -ne 0 ] && exit 1
echo "[*] Hard reset of Wi-Fi stack..."
# Full path to Android's svc
/system/bin/svc wifi disable 2>/dev/null
killall hostapd dnsmasq wpa_supplicant wificond 2>/dev/null
sleep 1
pkill -9 hostapd
sleep 3
# Delete the interface
iw dev $IFACE del 2>/dev/null
sleep 1
# Create a fresh AP interface
iw phy phy0 interface add $IFACE type __ap 2>/dev/null || \
iw phy phy0 interface add $IFACE type ap 2>/dev/null
sleep 1
ip link set $IFACE down 2>/dev/null
ip addr flush dev $IFACE 2>/dev/null
ip link set $IFACE up
sleep 1
# Simple hostapd config
cat > /tmp/hostapd.conf <<EOF
interface=$IFACE
driver=nl80211
ssid=$SSID
hw_mode=g
channel=$CHANNEL
auth_algs=1
ignore_broadcast_ssid=0
EOF
echo "[*] Starting hostapd (running in foreground)..."
echo "Look for the line: AP-ENABLED"
echo "Press Ctrl+C to stop later"
echo
hostapd /tmp/hostapd.conf
# Assign static IP to the AP interface
ip addr add "$AP_IP/24" dev "$IFACE"
ip link set "$IFACE" up
# Start dnsmasq (DHCP only – no DNS forwarding / no internet)
dnsmasq \
--interface="$IFACE" \
--bind-interfaces \
--dhcp-range="$DHCP_RANGE" \
--dhcp-option=3,"$AP_IP" \
--dhcp-option=6,"$AP_IP" \
--port=0 \
--no-resolv \
--pid-file=/tmp/dnsmasq-"$IFACE".pid \
--log-facility=/tmp/dnsmasq-"$IFACE".log &
sleep 1
# Show status
echo
echo "Local-only hotspot started"
echo " Interface : $IFACE"
echo " SSID : $SSID"
echo " Password : $PSK"
echo " Gateway : $AP_IP"
echo
iw dev "$IFACE" info 2>/dev/null | head -n 15
echo
ip addr show "$IFACE"
echo
echo "Clients will receive IPs in the range 192.168.43.10 – 192.168.43.50"
echo "No internet is shared (local network only)."
+98
View File
@@ -0,0 +1,98 @@
#!/bin/sh
# Local-only Wi-Fi hotspot for Kali NetHunter / Android
# SSID: vegeta black
# Password: supermarioinreallife
IFACE="wlan1" # Change if needed (check with: ip link / iw dev)
SSID="vegeta black"
PSK="supermarioinreallife"
CHANNEL="6"
AP_IP="192.168.43.1"
DHCP_RANGE="192.168.43.10,192.168.43.50,12h"
# Check root
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
echo "[*] Hard reset of Wi-Fi stack..."
# Full path to Android's svc
/system/bin/svc wifi disable 2>/dev/null
killall hostapd dnsmasq wpa_supplicant wificond 2>/dev/null
sleep 1
pkill -9 hostapd
sleep 3
# Delete the interface
iw dev $IFACE del 2>/dev/null
sleep 1
# Create a fresh AP interface
iw phy phy0 interface add $IFACE type __ap 2>/dev/null || \
iw phy phy0 interface add $IFACE type ap 2>/dev/null
sleep 1
ip link set $IFACE down 2>/dev/null
ip addr flush dev $IFACE 2>/dev/null
ip link set $IFACE up
sleep 1
# Create hostapd config
cat > /tmp/hostapd-"$IFACE".conf <<EOF
interface=$IFACE
driver=nl80211
ssid=$SSID
hw_mode=g
channel=$CHANNEL
ieee80211n=1
wmm_enabled=1
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=$PSK
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
EOF
# Start hostapd
hostapd -B /tmp/hostapd-"$IFACE".conf || {
echo "hostapd failed to start"
exit 1
}
# Assign static IP to the AP interface
ip addr add "$AP_IP/24" dev "$IFACE"
ip link set "$IFACE" up
# Start dnsmasq (DHCP only – no DNS forwarding / no internet)
dnsmasq \
--interface="$IFACE" \
--bind-interfaces \
--dhcp-range="$DHCP_RANGE" \
--dhcp-option=3,"$AP_IP" \
--dhcp-option=6,"$AP_IP" \
--port=0 \
--no-resolv \
--pid-file=/tmp/dnsmasq-"$IFACE".pid \
--log-facility=/tmp/dnsmasq-"$IFACE".log &
sleep 1
# Show status
echo
echo "Local-only hotspot started"
echo " Interface : $IFACE"
echo " SSID : $SSID"
echo " Password : $PSK"
echo " Gateway : $AP_IP"
echo
iw dev "$IFACE" info 2>/dev/null | head -n 15
echo
ip addr show "$IFACE"
echo
echo "Clients will receive IPs in the range 192.168.43.10 – 192.168.43.50"
echo "No internet is shared (local network only)."
+107
View File
@@ -0,0 +1,107 @@
#!/bin/sh
# Local-only hotspot using the internal SoftAP interface (wlan1)
# SSID: vegeta black
# Password: supermarioinreallife
IFACE="wlan1"
SSID="vegeta black"
PSK="supermarioinreallife"
CHANNEL="6"
AP_IP="192.168.43.1"
NET="192.168.43.0/24"
DHCP_RANGE="192.168.43.10,192.168.43.50,12h"
[ "$(id -u)" -ne 0 ] && { echo "Need root"; exit 1; }
echo "[*] Stopping Android Wi-Fi services (critical step)..."
# These commands release the radio so hostapd can take over
svc wifi disable 2>/dev/null
stop wpa_supplicant 2>/dev/null
killall wpa_supplicant hostapd dnsmasq 2>/dev/null
sleep 2
echo "[*] Preparing $IFACE..."
ip link set "$IFACE" down 2>/dev/null
ip addr flush dev "$IFACE" 2>/dev/null
# Make sure it is in AP mode
iw dev "$IFACE" set type __ap 2>/dev/null || iw dev "$IFACE" set type ap 2>/dev/null
ip link set "$IFACE" up
sleep 1
# Disable reverse path filter
echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
echo 0 > /proc/sys/net/ipv4/conf/"$IFACE"/rp_filter 2>/dev/null
# hostapd config
cat > /tmp/hostapd-$IFACE.conf <<EOF
interface=$IFACE
driver=nl80211
ssid=$SSID
hw_mode=g
channel=$CHANNEL
ieee80211n=1
wmm_enabled=1
auth_algs=1
wpa=2
wpa_passphrase=$PSK
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
ignore_broadcast_ssid=0
EOF
echo "[*] Starting hostapd on $IFACE..."
hostapd -B /tmp/hostapd-$IFACE.conf
if [ $? -ne 0 ]; then
echo
echo "hostapd still failed. Trying alternative method..."
# Sometimes a short delay + re-up helps
ip link set "$IFACE" down
sleep 1
ip link set "$IFACE" up
sleep 1
hostapd -B /tmp/hostapd-$IFACE.conf || {
echo "Still failing. Paste the full hostapd error."
exit 1
}
fi
sleep 1
# Assign IP
ip addr add $AP_IP/24 broadcast 192.168.43.255 dev $IFACE
ip route add $NET dev $IFACE src $AP_IP 2>/dev/null
# Firewall
iptables -I INPUT -i $IFACE -j ACCEPT
iptables -I OUTPUT -o $IFACE -j ACCEPT
iptables -I FORWARD -i $IFACE -j ACCEPT
iptables -I FORWARD -o $IFACE -j ACCEPT
# DHCP
echo "[*] Starting dnsmasq..."
dnsmasq \
--interface=$IFACE \
--bind-interfaces \
--dhcp-range=$DHCP_RANGE \
--dhcp-option=3,$AP_IP \
--dhcp-option=6,$AP_IP \
--port=0 \
--no-resolv \
--pid-file=/tmp/dnsmasq-$IFACE.pid &
sleep 2
echo
echo "=== Status ==="
iw dev $IFACE info
echo
ip -4 addr show $IFACE
echo
echo "SSID : $SSID"
echo "Password : $PSK"
echo "Gateway : $AP_IP"
echo
echo "Connect your PC and try: ping 192.168.43.1"
+79
View File
@@ -0,0 +1,79 @@
#!/bin/sh
# Local-only hotspot using Android's built-in SoftAP (wlan1)
# SSID & password are set in Android Settings → Hotspot
# This script only takes control of the interface afterwards
IFACE="wlan1"
AP_IP="192.168.43.1"
NET="192.168.43.0/24"
DHCP_RANGE="192.168.43.10,192.168.43.50,12h"
[ "$(id -u)" -ne 0 ] && { echo "Need root"; exit 1; }
echo "[*] Waiting for Android hotspot interface ($IFACE)..."
# Give you time to turn the hotspot on
for i in $(seq 1 15); do
if ip link show "$IFACE" >/dev/null 2>&1; then
echo " Found $IFACE"
break
fi
sleep 1
done
if ! ip link show "$IFACE" >/dev/null 2>&1; then
echo "Interface $IFACE not found."
echo "Turn on the normal Android Wi-Fi Hotspot first, then run this script again."
exit 1
fi
echo "[*] Taking control of $IFACE..."
# Kill any existing DHCP / hostapd from Android or previous runs
killall dnsmasq hostapd 2>/dev/null
sleep 1
# Disable reverse path filter
echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
echo 0 > /proc/sys/net/ipv4/conf/"$IFACE"/rp_filter 2>/dev/null
# Flush old addresses and routes
ip addr flush dev "$IFACE" 2>/dev/null
ip route flush dev "$IFACE" 2>/dev/null
# Assign our fixed gateway IP
ip addr add "$AP_IP/24" broadcast 192.168.43.255 dev "$IFACE"
ip link set "$IFACE" up
ip route add "$NET" dev "$IFACE" src "$AP_IP" 2>/dev/null
# Allow traffic
iptables -I INPUT -i "$IFACE" -j ACCEPT
iptables -I OUTPUT -o "$IFACE" -j ACCEPT
iptables -I FORWARD -i "$IFACE" -j ACCEPT
iptables -I FORWARD -o "$IFACE" -j ACCEPT
# Start our own DHCP (local only – no internet)
echo "[*] Starting local DHCP server..."
dnsmasq \
--interface="$IFACE" \
--bind-interfaces \
--dhcp-range="$DHCP_RANGE" \
--dhcp-option=3,"$AP_IP" \
--dhcp-option=6,"$AP_IP" \
--port=0 \
--no-resolv \
--pid-file=/tmp/dnsmasq-"$IFACE".pid \
--log-dhcp &
sleep 2
echo
echo "=== Local-only Hotspot ready ==="
echo "Interface : $IFACE"
echo "Gateway : $AP_IP"
echo "DHCP : 192.168.43.10 – 192.168.43.50"
echo
echo "SSID and password are whatever you set in Android Hotspot settings."
echo "Connect your PC and try: ping 192.168.43.1"
echo
ip -4 addr show "$IFACE"
+110
View File
@@ -0,0 +1,110 @@
#!/bin/sh
# Standalone local-only hotspot (hostapd + dnsmasq)
# SSID: vegeta black
# Password: supermarioinreallife
IFACE="wlan1"
SSID="vegeta black"
PSK="supermarioinreallife"
CHANNEL="6"
AP_IP="192.168.43.1"
NET="192.168.43.0/24"
DHCP_RANGE="192.168.43.10,192.168.43.50,12h"
[ "$(id -u)" -ne 0 ] && { echo "Need root"; exit 1; }
echo "[*] Cleaning previous state..."
killall hostapd dnsmasq wpa_supplicant 2>/dev/null
svc wifi disable 2>/dev/null
sleep 2
# Fully reset the interface
ip link set "$IFACE" down 2>/dev/null
ip addr flush dev "$IFACE" 2>/dev/null
ip route flush dev "$IFACE" 2>/dev/null
# Force AP mode
iw dev "$IFACE" set type __ap 2>/dev/null || iw dev "$IFACE" set type ap 2>/dev/null
sleep 1
ip link set "$IFACE" up
sleep 1
# Disable reverse path filter
echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
echo 0 > /proc/sys/net/ipv4/conf/"$IFACE"/rp_filter 2>/dev/null
# hostapd config
cat > /tmp/hostapd-$IFACE.conf <<EOF
interface=$IFACE
driver=nl80211
ssid=$SSID
hw_mode=g
channel=$CHANNEL
ieee80211n=1
wmm_enabled=1
auth_algs=1
wpa=2
wpa_passphrase=$PSK
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
ignore_broadcast_ssid=0
EOF
echo "[*] Starting hostapd..."
hostapd -B /tmp/hostapd-$IFACE.conf
if [ $? -ne 0 ]; then
echo
echo "hostapd failed. Trying one more time after extra reset..."
ip link set "$IFACE" down
sleep 2
iw dev "$IFACE" set type __ap 2>/dev/null
ip link set "$IFACE" up
sleep 2
hostapd -B /tmp/hostapd-$IFACE.conf || {
echo "hostapd still failed."
echo "Run this and paste the output:"
echo " hostapd -d /tmp/hostapd-$IFACE.conf"
exit 1
}
fi
sleep 1
# Assign IP
ip addr add $AP_IP/24 broadcast 192.168.43.255 dev $IFACE
ip link set $IFACE up
ip route add $NET dev $IFACE src $AP_IP 2>/dev/null
# Firewall
iptables -I INPUT -i $IFACE -j ACCEPT
iptables -I OUTPUT -o $IFACE -j ACCEPT
iptables -I FORWARD -i $IFACE -j ACCEPT
iptables -I FORWARD -o $IFACE -j ACCEPT
# DHCP
echo "[*] Starting dnsmasq..."
dnsmasq \
--interface=$IFACE \
--bind-interfaces \
--dhcp-range=$DHCP_RANGE \
--dhcp-option=3,$AP_IP \
--dhcp-option=6,$AP_IP \
--port=0 \
--no-resolv \
--pid-file=/tmp/dnsmasq-$IFACE.pid &
sleep 2
echo
echo "=== Standalone Hotspot Started ==="
echo "SSID : $SSID"
echo "Password : $PSK"
echo "Gateway : $AP_IP"
echo
iw dev $IFACE info 2>/dev/null | head -15
echo
ip -4 addr show $IFACE
echo
echo "Connect your PC and try: ping 192.168.43.1"
+60
View File
@@ -0,0 +1,60 @@
#!/bin/sh
# Reliable local-only hotspot using Android SoftAP
# 1. Turn Android Hotspot ON first
# 2. Run this script
IFACE="wlan1"
AP_IP="192.168.43.1"
NET="192.168.43.0/24"
DHCP_RANGE="192.168.43.10,192.168.43.50,12h"
[ "$(id -u)" -ne 0 ] && { echo "Need root"; exit 1; }
if ! ip link show "$IFACE" >/dev/null 2>&1; then
echo "Turn the Android Hotspot ON first, then run this script."
exit 1
fi
echo "[*] Taking control of Android SoftAP on $IFACE..."
# Only kill DHCP, leave Android's hostapd running
killall dnsmasq 2>/dev/null
sleep 1
# Disable reverse path filter
echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
echo 0 > /proc/sys/net/ipv4/conf/$IFACE/rp_filter 2>/dev/null
# Add our gateway IP (keep whatever Android already has)
ip addr add $AP_IP/24 broadcast 192.168.43.255 dev $IFACE 2>/dev/null
ip link set $IFACE up
ip route add $NET dev $IFACE src $AP_IP 2>/dev/null
# Allow traffic
iptables -C INPUT -i $IFACE -j ACCEPT 2>/dev/null || iptables -I INPUT -i $IFACE -j ACCEPT
iptables -C OUTPUT -o $IFACE -j ACCEPT 2>/dev/null || iptables -I OUTPUT -o $IFACE -j ACCEPT
iptables -C FORWARD -i $IFACE -j ACCEPT 2>/dev/null || iptables -I FORWARD -i $IFACE -j ACCEPT
iptables -C FORWARD -o $IFACE -j ACCEPT 2>/dev/null || iptables -I FORWARD -o $IFACE -j ACCEPT
# Start our DHCP
dnsmasq \
--interface=$IFACE \
--bind-interfaces \
--dhcp-range=$DHCP_RANGE \
--dhcp-option=3,$AP_IP \
--dhcp-option=6,$AP_IP \
--port=0 \
--no-resolv \
--pid-file=/tmp/dnsmasq-$IFACE.pid &
sleep 2
echo
echo "=== Local-only Hotspot Ready ==="
echo "SSID & Password = whatever you set in Android Hotspot settings"
echo "Gateway = $AP_IP"
echo
ip -4 addr show $IFACE
echo
echo "Connect your PC and ping 192.168.43.1"
+123
View File
@@ -0,0 +1,123 @@
#!/bin/sh
# Aggressive standalone local-only hotspot
# Tries to fully release Android's control of the radio
IFACE="wlan1"
SSID="vegeta black"
PSK="supermarioinreallife"
CHANNEL="6"
AP_IP="192.168.43.1"
NET="192.168.43.0/24"
DHCP_RANGE="192.168.43.10,192.168.43.50,12h"
[ "$(id -u)" -ne 0 ] && { echo "Need root"; exit 1; }
echo "[*] Aggressively stopping Android Wi-Fi stack..."
# Stop as many Android Wi-Fi related services as possible
svc wifi disable 2>/dev/null
stop wpa_supplicant 2>/dev/null
stop wifi 2>/dev/null
killall wpa_supplicant hostapd dnsmasq wificond 2>/dev/null
sleep 2
# Extra force
setprop ctl.stop wpa_supplicant 2>/dev/null
setprop ctl.stop wifi 2>/dev/null
sleep 1
echo "[*] Fully resetting $IFACE..."
ip link set "$IFACE" down 2>/dev/null
ip addr flush dev "$IFACE" 2>/dev/null
ip route flush dev "$IFACE" 2>/dev/null
# Delete and recreate the interface if possible
iw dev "$IFACE" del 2>/dev/null
sleep 1
# Try to create a clean AP interface
iw phy phy0 interface add "$IFACE" type __ap 2>/dev/null || \
iw phy phy0 interface add "$IFACE" type ap 2>/dev/null
sleep 1
ip link set "$IFACE" up 2>/dev/null
sleep 1
# Disable reverse path filter
echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
echo 0 > /proc/sys/net/ipv4/conf/"$IFACE"/rp_filter 2>/dev/null
# hostapd config
cat > /tmp/hostapd-$IFACE.conf <<EOF
interface=$IFACE
driver=nl80211
ssid=$SSID
hw_mode=g
channel=$CHANNEL
ieee80211n=1
wmm_enabled=1
auth_algs=1
wpa=2
wpa_passphrase=$PSK
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
ignore_broadcast_ssid=0
EOF
echo "[*] Starting hostapd..."
hostapd -B /tmp/hostapd-$IFACE.conf
if [ $? -ne 0 ]; then
echo
echo "Still failed. Trying one last method..."
# Last resort: bring interface down/up again
ip link set "$IFACE" down
sleep 2
iw dev "$IFACE" set type __ap 2>/dev/null
ip link set "$IFACE" up
sleep 2
hostapd -B /tmp/hostapd-$IFACE.conf || {
echo
echo "Standalone hostapd is not working reliably on this device."
echo "The internal Wi-Fi firmware is still holding management frames."
exit 1
}
fi
sleep 1
# Configure IP
ip addr add $AP_IP/24 broadcast 192.168.43.255 dev $IFACE
ip link set $IFACE up
ip route add $NET dev $IFACE src $AP_IP 2>/dev/null
# Firewall
iptables -I INPUT -i $IFACE -j ACCEPT
iptables -I OUTPUT -o $IFACE -j ACCEPT
iptables -I FORWARD -i $IFACE -j ACCEPT
iptables -I FORWARD -o $IFACE -j ACCEPT
# DHCP
echo "[*] Starting dnsmasq..."
dnsmasq \
--interface=$IFACE \
--bind-interfaces \
--dhcp-range=$DHCP_RANGE \
--dhcp-option=3,$AP_IP \
--dhcp-option=6,$AP_IP \
--port=0 \
--no-resolv \
--pid-file=/tmp/dnsmasq-$IFACE.pid &
sleep 2
echo
echo "=== Standalone Hotspot ==="
echo "SSID : $SSID"
echo "Password : $PSK"
echo "Gateway : $AP_IP"
echo
iw dev $IFACE info 2>/dev/null | head -12
echo
ip -4 addr show $IFACE
+55
View File
@@ -0,0 +1,55 @@
#!/bin/sh
IFACE="wlan1"
SSID="vegeta black"
PSK="supermarioinreallife"
CHANNEL="6"
AP_IP="192.168.43.1"
NET="192.168.43.0/24"
DHCP_RANGE="192.168.43.10,192.168.43.50,12h"
[ "$(id -u)" -ne 0 ] && exit 1
killall hostapd dnsmasq 2>/dev/null
sleep 1
# Simple, highly compatible hostapd config
cat > /tmp/hostapd-$IFACE.conf <<EOF
interface=$IFACE
driver=nl80211
ssid=$SSID
hw_mode=g
channel=$CHANNEL
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=$PSK
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
EOF
hostapd -B /tmp/hostapd-$IFACE.conf
sleep 1
ip addr flush dev $IFACE
ip addr add $AP_IP/24 broadcast 192.168.43.255 dev $IFACE
ip link set $IFACE up
ip route add $NET dev $IFACE src $AP_IP
iptables -I INPUT -i $IFACE -j ACCEPT
iptables -I OUTPUT -o $IFACE -j ACCEPT
dnsmasq --interface=$IFACE --bind-interfaces \
--dhcp-range=$DHCP_RANGE \
--dhcp-option=3,$AP_IP \
--dhcp-option=6,$AP_IP \
--port=0 --no-resolv &
echo
echo "Hotspot should be up."
echo "SSID: $SSID"
echo "Password: $PSK"
echo
iw dev $IFACE info | head -10
+44
View File
@@ -0,0 +1,44 @@
#!/bin/sh
IFACE="wlan1"
SSID="vegeta black"
PSK="supermarioinreallife"
CHANNEL="6"
AP_IP="192.168.43.1"
[ "$(id -u)" -ne 0 ] && exit 1
echo "[*] Hard reset of Wi-Fi stack..."
svc wifi disable
killall hostapd dnsmasq wpa_supplicant wificond 2>/dev/null
sleep 3
# Delete the interface completely
iw dev $IFACE del 2>/dev/null
sleep 1
# Create a fresh AP interface
iw phy phy0 interface add $IFACE type __ap
sleep 1
ip link set $IFACE down
ip addr flush dev $IFACE
ip link set $IFACE up
sleep 1
# Very simple hostapd config
cat > /tmp/hostapd.conf <<EOF
interface=$IFACE
driver=nl80211
ssid=$SSID
hw_mode=g
channel=$CHANNEL
wpa=2
wpa_passphrase=$PSK
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
EOF
echo "[*] Starting hostapd (watch for errors)..."
hostapd /tmp/hostapd.conf
+51
View File
@@ -0,0 +1,51 @@
#!/bin/sh
IFACE="wlan1"
SSID="vegeta black"
PSK="supermarioinreallife"
CHANNEL="6"
AP_IP="192.168.43.1"
[ "$(id -u)" -ne 0 ] && exit 1
echo "[*] Hard reset of Wi-Fi stack..."
# Full path to Android's svc
/system/bin/svc wifi disable 2>/dev/null
killall hostapd dnsmasq wpa_supplicant wificond 2>/dev/null
sleep 3
# Delete the interface
iw dev $IFACE del 2>/dev/null
sleep 1
# Create a fresh AP interface
iw phy phy0 interface add $IFACE type __ap 2>/dev/null || \
iw phy phy0 interface add $IFACE type ap 2>/dev/null
sleep 1
ip link set $IFACE down 2>/dev/null
ip addr flush dev $IFACE 2>/dev/null
ip link set $IFACE up
sleep 1
# Simple hostapd config
cat > /tmp/hostapd.conf <<EOF
interface=$IFACE
driver=nl80211
ssid=$SSID
hw_mode=g
channel=$CHANNEL
wpa=2
wpa_passphrase=$PSK
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
EOF
echo "[*] Starting hostapd (running in foreground)..."
echo "Look for the line: AP-ENABLED"
echo "Press Ctrl+C to stop later"
echo
hostapd /tmp/hostapd.conf
+155
View File
@@ -0,0 +1,155 @@
#profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
#text colors
txtblk='\e[0;30m' # Black - Regular
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
txtylw='\e[0;33m' # Yellow
txtblu='\e[0;34m' # Blue
txtpur='\e[0;35m' # Purple
txtcyn='\e[0;36m' # Cyan
txtwht='\e[0;37m' # White
x="/etc/X11/xorg.conf.d"
xmonad="$HOME/.xmonad/xmonad.hs"
xmo=$xmonad
gpc="$HOME/mnt/gaming-win/C:/Users/lucka/"
brc="$HOME/.bashrc"
alias v="vim"
alias s="sudo"
alias mg="sshfs gaming-pc.mario:/ ~/mnt/gaming-pc"
alias mt="sshfs lucka@terraria.mario: ~/mnt/terraria.mario"
alias umg="umount ~/mnt/gaming-pc"
#alias ms="sshfs truenas.mario:/mnt/b8ce9a57-7ce7-47b8-a233-21184c8a0953/share ~/share -o reconnect -o ServerAliveInterval=15"
#alias ums="umount ~/share"
alias p="~/sh/ytmusicquick"
alias nas="ssh nas.mario"
#alias mn="sshfs -o allow_root truenas.mario:/mnt/mario ~/mnt/truenas.mario"
mn () {
sudo mount -o rsize=131072,wsize=131072,nconnect=16 -t nfs 10.0.21.1:/mnt/mario/share ~/mnt/truenas.mario/share
sudo mount -o rsize=131072,wsize=131072,nconnect=16 -t nfs 10.0.21.1:/mnt/mario/websites ~/mnt/truenas.mario/websites
sudo mount -o rsize=131072,wsize=131072,nconnect=16 -t nfs 10.0.21.1:/mnt/mario/roms ~/mnt/truenas.mario/roms
#sudo mount -o rsize=130048,wsize=131007,bsize=16777216,username=roms,password=00P9sVAgGQymKp2hZi79TYXliJt20tAT,uid=1000,gid=1000,iocharset=utf8,mapposix,actimeo=6,echo_interval=1,nostrictsync,cache=loose,nocase,soft,vers=3.1.1 -t cifs //10.0.21.1/roms ~/mnt/truenas.mario/roms
sudo mount --bind /home/lucka/.steam/steam/steamapps/compatdata /home/lucka/mnt/truenas.mario/roms/windows/Steamm/steamapps/compatdata
sudo mount -o rsize=131072,wsize=131072,nconnect=16 -t nfs 10.0.21.1:/mnt/slowpool/movies ~/mnt/truenas.mario/movies
sudo mount -o rsize=131072,wsize=131072,nconnect=16 -t nfs 10.0.21.1:/mnt/mario/os-isos/template/iso ~/mnt/truenas.mario/os-isos
}
alias umn="sudo umount ~/mnt/truenas.mario/*"
alias mfs="~/sh/mount-all-filesystems.sh"
alias lgctl="~/sh/lgctl"
alias bs="barriers -f -c ~/.config/barrier-server.conf --disable-crypto"
alias xe="vim ~/.xmonad/xmonad.hs"
sshfs(){
/usr/bin/sshfs -o reconnect,allow_root,workaround=buflimit,ServerAliveInterval=15,ServerAliveCountMax=3 $*
}
ytmp3 () {
yt-dlp --extract-audio --audio-format mp3 $@
}
ytmp3numbered () {
ytmp3 --output "%(autonumber)s - %(title)s.%(ext)s" $@
}
ytdl () {
yt-dlp "$*"
}
tfcfg () {
ssh gaming-win -t "e: && cd steamlibrary\steamapps\common\team fortress 2\tf\cfg && cmd"
}
gremote () {
#bash -c 'sleep 2 && remmina -c vnc://127.0.0.1:5901' &
ssh -L 5901:127.0.0.1:5901 $1 'pkill x11vnc; x11vnc -display :0 -rfbport 5901 -localhost -threads -noxfixes -noxdamage'
}
i () {
sudo apt install "$*"
}
u () {
sudo apt purge "$*"
}
sshmnt () {
mkdir -p ~/mnt/$1
sshfs -o ServerAliveInterval=7 $1 ~/mnt/$1
}
n () {
numlockx off
}
terminal-open () {
xfce4-terminal --command "$*"
}
topen () {
terminal-open "$*"
}
+x () {
chmod ug+x $*
}
cdwm () {
cd ~/compile/lukedwm/dwm
}
recordto () {
ffmpeg -f pulse -i default -codec:a flac "${1}.flac"
}
getclip () {
xclip -selection c -o
}
setclip () {
xclip -selection c
}
sshsus () {
ssh -J root@10.0.42.69 $*
}
webp () {
ffmpeg -i $1 -vcodec libwebp -filter:v fps=fps=60 -lossless 1 -loop 0 -preset default -an -vsync 0 $1.webp
}
alias py="python3"
pssh () {
adb forward tcp:65522 tcp:22; ssh root@127.0.0.1 -p 65522 $*
}
testvidmode () {
xrandr --delmode HDMI-A-0 $1
xrandr --rmmode $1
xrandr --newmode $*
xrandr --addmode HDMI-A-0 $1
xrandr --output HDMI-A-0 --mode $1
}
testvidmode2 () {
xrandr --delmode DisplayPort-0 $1
xrandr --rmmode $1
xrandr --newmode $*
xrandr --addmode DisplayPort-0 $1
xrandr --output DisplayPort-0 --mode $1
}
nintendontify () {
for i in *; do mkdir "$(echo $i | sed 's/.iso//')"; mv "$i" "$(echo $i | sed 's/.iso//')"/game.iso; done
}
wiiconnect () {
bluetoothctl connect 00:1E:35:3A:A9:B5
}
vsync () {
picom --backend glx --vsync
}
crtTV () {
       testvidmode "1280x480_60i" 26.108 1280 1332 1455 1664 480 483 489 523 interlace -hsync -vsync
       xrandr --output DisplayPort-0 --mode 1280x480_60i --scale-from 640x480 --below HDMI-A-0
}
crtTVscale () {
       testvidmode "1280x480_60i" 26.108 1280 1332 1455 1664 480 483 489 523 interlace -hsync -vsync
       xrandr --output DisplayPort-0 --mode 1280x480_60i --scale-from 1280x960 --below HDMI-A-0
}
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
delMode () {
xrandr --delmode HDMI-A-0 "$1"
xrandr --rmmode "$1"
}
for i in $(xrandr | grep -o '1280x960_[^ ]*')
do
delMode $i
done
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
xrandr --newmode "1600x900_60p" 118.25 1600 1688 1856 2112 900 903 908 934 -hsync +vsync
xrandr --addmode DisplayPort-1 1600x900_60p
xrandr --output HDMI-A-0 --mode 1600x900_120i --primary --output DisplayPort-1 --mode 1600x900_60p --same-as HDMI-A-0
+1 -1
View File
@@ -1,2 +1,2 @@
#!/bin/sh
xrandr --output DisplayPort-0 --off --output DisplayPort-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DisplayPort-2 --off --output HDMI-A-0 --off
xrandr --output DisplayPort-0 --off --output DisplayPort-1 --primary --mode 1920x1080 --scale-from 1920x1080 --pos 0x0 --rotate normal --output DisplayPort-2 --off --output HDMI-A-0 --off
+4 -1
View File
@@ -1,2 +1,5 @@
#!/bin/sh
xrandr --output DisplayPort-0 --off --output DisplayPort-1 --primary --mode 1280x720 --pos 0x0 --rotate normal --output DisplayPort-2 --off --output HDMI-A-0 --off
xrandr --newmode "1280x720_60.00" 74.50 1280 1344 1472 1664 720 723 728 748 -hsync +vsync
xrandr --addmode DisplayPort-1 "1280x720_60.00"
xrandr --output DisplayPort-0 --off --output DisplayPort-1 --primary --mode "1280x720_60.00" --pos 0x0 --rotate normal --output DisplayPort-2 --off --output HDMI-A-0 --off
Executable
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
# Toggle picom with --backend glx --vsync
if pgrep -x "picom" > /dev/null; then
# Picom is running → kill it
pkill -x picom
notify-send "Picom" "Compositor disabled" 2>/dev/null || true
else
# Picom is not running → start it
picom --backend glx --vsync &
notify-send "Picom" "Compositor enabled (GLX + VSync)" 2>/dev/null || true
fi