Skip to content

Instantly share code, notes, and snippets.

View thewh1teagle's full-sized avatar
💭
coding

thewh1teagle

💭
coding
  • localhost
  • The martian
View GitHub Profile
@thewh1teagle
thewh1teagle / udev_watcher
Last active May 16, 2022 08:22
watch changes under /dev directory in linux.
#!/usr/bin/bash
# will be ls /dev
# 2 files to compare before and
# after plug in/out the device
before="/tmp/before.txt"
after="/tmp/after.txt"
ls --color /dev > $before && clear
@thewh1teagle
thewh1teagle / hello.asm
Created June 26, 2020 21:39
very easy hello world assembly code for x86 architecture
# Useful variables
STDIN equ 0
STDOUT equ 1
STDERR equ 2
SYS_READ equ 0
SYS_WRITE equ 4
SYS_EXIT equ 1
KERNEL equ 0x80 ; interrupt number
%macro syscall 0
import subprocess
import sys
def ip_of_mac(mac):
mac = mac.lower().replace(":", "-")
output = str (
subprocess.check_output((f'arp -a | findstr "{mac}" '), shell=True, stderr=subprocess.STDOUT)
from threading import Thread
import asyncio
async def f(*args):
while 1:
await asyncio.sleep(2)
print("asyncio thread")
def function(*args):
asyncio.run(f(*args))
# Disable the PWR LED
dtparam=pwr_led_trigger=none
dtparam=pwr_led_activelow=off
# Disable the Activity LED
dtparam=act_led_trigger=none
dtparam=act_led_activelow=off
# Disable ethernet port LEDs
dtparam=eth_led0=4
dtparam=eth_led1=4
@thewh1teagle
thewh1teagle / bashrc.cmd
Created October 13, 2020 19:03
Windows cmd like linux bashrc
@echo off
:: Put me under C:\
cls
DOSKEY ls=dir
DOSKEY alias=doskey
DOSKEY clear=cls
DOSKEY notepad++="C:\Program Files (x86)\Notepad++\notepad++.exe"
@thewh1teagle
thewh1teagle / mail_sender.py
Created October 17, 2020 20:19
send mail with gmail and python
#!/usr/bin/env python3
# First, create app password here - https://security.google.com/settings/security/apppasswords
# Note: You have to enable 2fa in your account to be able to create app password!
import smtplib
gmail_user = 'you@gmail.com'
gmail_password = 'P@ssword!'
@thewh1teagle
thewh1teagle / reset_adapters.bat
Created October 29, 2020 20:30
Reset all network adapters windows
@echo off
REM credits: https://sites.google.com/site/eneerge/scripts/batchgotadmin
REM Stored here in case that site goes down some day
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
# program to display the functioning of
# settrace()
import sys
patch = """
from sys import settrace
import time
tracing = {}
@thewh1teagle
thewh1teagle / reset_new_adapters_service.bat
Last active May 16, 2022 08:22
This is a "patch" for strange bug of windows where you turn on your pc you have to reset network adapters to connect the internet
@echo off
:while_no_connection
ping -n 1 8.8.8.8 | find "TTL=" >nul
if errorlevel 1 (
goto reset_adapters
) else (
exit
)