Skip to content

Instantly share code, notes, and snippets.

View Hritik14's full-sized avatar

Hritik Vijay Hritik14

View GitHub Profile
@Hritik14
Hritik14 / mysteriousC.md
Last active May 7, 2020 11:16
char c = 4["ABCEDF"]
weird.c
--------------
#include<stdio.h>
int main(){
	int i = 4;
	char c = i["ABCDEF"];
	printf("%c", c);
	return 0;
}
@Hritik14
Hritik14 / multi-net.sh
Last active April 23, 2023 17:19
Multipath routing to increase bandwith
#!/bin/bash
# (C) Hritik Vijay
# License: GPLv2
# Suppliment to https://m47r1x.github.io/posts/multi-net/
tmp=$(mktemp multi-net-ip-XXXX --tmpdir)
TIMEOUT=5
Table=200
_ping(){
@Hritik14
Hritik14 / multi-net.sh
Created April 20, 2020 05:42
Multipath routing to increase bandwith
#!/bin/bash
# (C) Hritik Vijay
# License: GPLv2
Table=200
route_cmd="ip route add default scope global "
# Iterate through each interface and process them
while read -r line; do
P=$(echo $line | grep -Eo 'via [0-9\.]+ ' | cut -d " " -f 2)
#include "DigiKeyboard.h"
#define LED_PIN 1
void setup() {
pinMode(LED_PIN, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(LED_PIN, LOW);
DigiKeyboard.sendKeyStroke(0);
@Hritik14
Hritik14 / route.ovpn
Created March 31, 2018 10:36
NetworkManager ip route in openVPN config
With custom routes in a custom ovpn file, NetworkManager reports with
`Error: configuration error: unsupported 1th argument to "route" which looks like a FQDN but only IPv4 address supported (line XX)`
Looks like the `route` config option is not available in NM ovpn config but the alternative `route-data` can be used.
The syntax remains the same:
`route-data IP netmask gateway`
Aug 10 20:17:07 HOSTNAME sudo[1343]: USERNAME : TTY=pts/0 ; PWD=/home/USERNAME ; USER=root ; COMMAND=/usr/bin/systemctl restart systemd-logind.service
Aug 10 20:17:07 HOSTNAME sudo[1343]: pam_unix(sudo:session): session opened for user root by (uid=0)
Aug 10 20:17:07 HOSTNAME systemd[1]: Stopping Login Service...
Aug 10 20:17:07 HOSTNAME systemd[1]: Stopped Login Service.
Aug 10 20:17:07 HOSTNAME gnome-shell[741]: Could not release device 13,67: Cannot invoke method; proxy is for a well-known name without an owner and proxy was constructed with the G_DBUS_PROX
Aug 10 20:17:07 HOSTNAME systemd[1]: Starting Login Service...
Aug 10 20:17:07 HOSTNAME gnome-shell[741]: Could not release device 13,71: Cannot invoke method; proxy is for a well-known name without an owner and proxy was constructed with the G_DBUS_PROX
Aug 10 20:17:07 HOSTNAME gnome-shell[741]: Could not release device 13,72: Cannot invoke method; proxy is for a well-known name without an owner and proxy was constructed with the G_DBUS_PROX
Aug 10 2