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
import 'dart:ui'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); |
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
var orginalCallback; | |
void main() { | |
runApp(...); | |
orginalCallback = window.onReportTimings; | |
window.onReportTimings = onReportTimings; | |
} | |
const maxframes = 60; | |
final lastFrames = ListQueue<FrameTiming>(maxframes); |
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/env python3 | |
# My attempt to create a spoofing IP address using RAW sockets, i know it can be done using scapy | |
# but wanted to create it using RAW socket. | |
# Feedbacks/improvements are welcome :) | |
#Author: B31212Y | |
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/env python | |
"""Simple wrapper to update Transmission's IPv4 binding on startup for use with VPNs. | |
(For Linux systems. Tested on Ubuntu 14.04 LTS) | |
""" | |
import json, os, subprocess | |
VPN_IF = "tun0" | |
TRANSMISSION_CFG = os.path.expanduser('~/.config/transmission/settings.json') |
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
"""tun_routing.py""" | |
import logging as LOGGER | |
import subprocess | |
from ipaddress import IPv4Address | |
from itertools import count | |
from typing import Union | |
# pip install pypacker | |
from pypacker.layer3.ip import IP as IPv4Packet | |
from pypacker.layer3.ip import IP_PROTO_UDP |
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
"""tun.py | |
*CAP_NET_ADMIN capability is required to create TUN interfaces.* | |
Based on: https://github.com/povilasb/iptun/blob/master/iptun/tun.py | |
""" | |
import logging as LOGGER | |
import os | |
import struct | |
import subprocess |
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
import os | |
import subprocess | |
# Open file corresponding to the TUN device. | |
tun = open('/dev/tun0', 'r+b') | |
# Bring it up and assign addresses. | |
subprocess.check_call('ifconfig tun0 192.168.7.1 192.168.7.2 up', shell=True) |
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
package main | |
import ( | |
"exec" | |
"log" | |
"os" | |
"syscall" | |
"unsafe" | |
) |
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
import _winreg as reg | |
import win32file | |
adapter_key = r'SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}' | |
def get_device_guid(): | |
with reg.OpenKey(reg.HKEY_LOCAL_MACHINE, adapter_key) as adapters: | |
try: |
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
package main | |
import ( | |
"exec" | |
"log" | |
"os" | |
) | |
func main() { | |
file, err := os.Open("/dev/tun0", os.O_RDWR, 0) |
NewerOlder