This file contains 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/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 |
This file contains 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
# 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 |
This file contains 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 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) |
This file contains 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
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)) |
This file contains 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
# 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 |
This file contains 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
@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" |
This file contains 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 | |
# 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!' |
This file contains 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
@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. |
This file contains 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
# program to display the functioning of | |
# settrace() | |
import sys | |
patch = """ | |
from sys import settrace | |
import time | |
tracing = {} |
This file contains 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
@echo off | |
:while_no_connection | |
ping -n 1 8.8.8.8 | find "TTL=" >nul | |
if errorlevel 1 ( | |
goto reset_adapters | |
) else ( | |
exit | |
) |