Skip to content

Instantly share code, notes, and snippets.

View milankragujevic's full-sized avatar

Milan Kragujević milankragujevic

View GitHub Profile
@milankragujevic
milankragujevic / bixby-be-gone.bat
Created August 20, 2020 12:20
(temporarily) Remove Bixby from Galaxy S9+
adb shell pm uninstall -k --user 0 com.samsung.android.app.settings.bixby
adb shell pm uninstall -k --user 0 com.samsung.systemui.bixby2
adb shell pm uninstall -k --user 0 com.samsung.android.bixby.service
adb shell pm uninstall -k --user 0 com.samsung.android.bixby.agent
adb shell pm uninstall -k --user 0 com.samsung.android.bixby.wakeup
adb shell pm uninstall -k --user 0 com.samsung.android.bixby.agent.dummy
@milankragujevic
milankragujevic / keyboard.sh
Created August 2, 2020 15:11
Fix laggy caps lock key on Ubuntu
#!/bin/sh
# put in /opt/keyboard.sh
# chmod a+rwx /opt/keyboard.sh
# crontab -e
# @reboot sleep 5; bash /opt/keyboard.sh &
xkbcomp -xkb "$DISPLAY" - | sed 's#key <CAPS>.*#key <CAPS> {\
repeat=no,\
type[group1]="ALPHABETIC",\
symbols[group1]=[ Caps_Lock, Caps_Lock],\
actions[group1]=[ LockMods(modifiers=Lock),\
@milankragujevic
milankragujevic / mouse.sh
Last active May 20, 2023 03:13
Normalize mouse speed on Ubuntu (flat acceleration profile, similar to Windows)
#!/bin/bash
# put in /opt/mouse.sh
# chmod a+rwx /opt/mouse.sh
# crontab -e
# @reboot sleep 5; bash /opt/mouse.sh &
gsettings set org.gnome.desktop.peripherals.mouse accel-profile flat
gsettings set org.gnome.desktop.peripherals.mouse speed 0
@milankragujevic
milankragujevic / iptables.sh
Last active April 8, 2020 22:59
Improved iptables rules for VPN server and gateway
#!/bin/bash
# NOTE: Replace [OWN IP] and [TRUSTED IP]
sudo bash -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
sudo iptables -F INPUT
sudo iptables -F FORWARD
sudo iptables -t nat -F
# Block all incoming
#!/usr/bin/perl -w
use IO::Socket ;
use IO::Handle ;
my $host = $ARGV[0] || "localhost";
my $port = $ARGV[1] || 8000;
STDERR->autoflush(1);
STDOUT->autoflush(1);
my $data = "";

Keybase proof

I hereby claim:

  • I am milankragujevic on github.
  • I am milankragujevic (https://keybase.io/milankragujevic) on keybase.
  • I have a public key whose fingerprint is 4CAA 8F55 93DD 89E7 AD17 457B BEA6 D978 14AD D0FD

To claim this, I am signing this object:

@milankragujevic
milankragujevic / restart.sh
Created January 11, 2020 01:47 — forked from katallaxie/restart.sh
Automatically restart a CISCO 3208G on UMW
#!/bin/sh
usr=admin
pwd=atlanta
ip=192.168.0.1
tmp=/tmp/deviceRestart
cookies=cookies.txt
#improve the logread output
sqm_logger() {
[
{
"id":"",
"status":"Zatvoren",
"openedDate":"2019-12-21T13:24:18.000+0000",
"closedDate":"2019-12-26T13:47:12.000+0000",
"service":"Postpaid priključak",
"identifier":"066 1XX XXX",
"open":false
},
@milankragujevic
milankragujevic / 02_network
Created December 31, 2019 13:43
target/linux/ramips/image/mt76x8.mk, target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v620.dts, target/linux/ramips/base-files/etc/board.d/02_network
tplink,tl-wr840n-v620|\
@milankragujevic
milankragujevic / iptables.sh
Created December 26, 2019 13:58
IP Aliasing with iptables on Linux
iptables -t nat -I PREROUTING -d 10.8.0.3 -j DNAT --to 192.168.1.73
iptables -t nat -I POSTROUTING -s 192.168.1.73 -j SNAT --to 10.8.0.3