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 / dwm
Last active May 16, 2022 08:22
dwm brightness conrol keys
sudo apt-get install xbacklight
: /etc/X11/xorg.conf
Section "Device"
Identifier "Card0"
Driver "intel"
Option "Backlight" "/sys/class/backlight/intel_backlight"
EndSection
#!/usr/bin/bash
beep () {
if [ "$1" = --list ]
then
find /usr/share/sounds -type f -exec basename {} \; | sort -n | tr '\n' ' '; echo
else
paplay $(find /usr/share/sounds -type f -iname "${1:-bell}*" | head -1)
fi
}
#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS
#------------------------------------------------------------------------------#
###### Debian Main Repos
deb http://deb.debian.org/debian/ stable main contrib non-free
deb-src http://deb.debian.org/debian/ stable main contrib non-free
deb http://deb.debian.org/debian/ stable-updates main contrib non-free
deb-src http://deb.debian.org/debian/ stable-updates main contrib non-free
### PUT IN BASHRC ###
# If there are multiple matches for completion, Tab should cycle through them
bind 'TAB':menu-complete
# Display a list of the matching files
# empty program
section .text ;the actual code
global _start ; make label visible for linker
_start: ;label, as main() function in C
mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel ( like syscall )
@thewh1teagle
thewh1teagle / hello.asm
Last active May 16, 2022 08:22
hello world assembly x86
# 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
%macro syscall 0
@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)