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
$ShortcutPath = "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\MyToastApp.lnk" | |
$TargetPath = "C:\Path\To\YourApp.exe" | |
$AppUserModelID = "Your.App.ID" | |
Add-Type -TypeDefinition @" | |
using System; | |
using System.Runtime.InteropServices; | |
using System.Runtime.InteropServices.ComTypes; | |
[ComImport] |
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
section .data | |
elf_magic db 0x7F, 'E', 'L', 'F' ; ELF magic number | |
msg db "[+] ELF magic detected", 10 ; msg to print | |
msg_len equ $ - msg | |
usage_msg db "Usage: ./elf_check <filename>", 10 | |
usage_msg_len equ $ - usage_msg | |
error_msg db "Error opening file. Please supply a valid file path.", 10 | |
error_msg_len equ $ - error_msg | |
not_elf db "[-] No ELF magic detected", 10 | |
not_elf_len equ $ - not_elf |
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
#!/bin/bash | |
# link.sh on box 3 | |
SOURCE_USER="user" | |
SOURCE_HOST="ip" | |
SOURCE_DIR="/home/user/Downloads/link/" | |
LOCAL_DIR="/home/user/Downloads/link/" | |
LOCK_FILE="/tmp/rsync.lock" | |
FLAG_FILE="/tmp/rsync_ready3" # modify per mirror, e.g. box 4 -> rsync_ready4, etc |
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
// browser console hack to prevent chrome from mucking with code blocks when a page is translated | |
// e.g. translating a chinese web page to english | |
document.querySelectorAll('pre, code').forEach(block => { | |
block.style.whiteSpace = 'pre-wrap'; | |
block.setAttribute('translate', 'no'); | |
}); |
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
document.querySelectorAll('p').forEach(p => { | |
p.style.textAlign = 'justify'; | |
p.style.padding = '10px'; | |
}); |
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
document.querySelectorAll('p').forEach(p => p.style.textAlign = 'justify'); |
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
cat fd.txt | awk '/bytes each:/ { | |
if (line) { | |
split(line, sizes, " ") | |
size_in_bytes = sizes[1] | |
print size_in_bytes "\t" line | |
} | |
line = $0; | |
next | |
} | |
{ line = line " " $0 } |
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
// js console to dump urls to json | |
const links = document.querySelectorAll('a'); | |
const matchingUrls = []; | |
links.forEach(link => { | |
const url = link.href; | |
if (url.match(/https:\/\/example\.com\/(path1|path2)\/.*/)) { | |
matchingUrls.push(url); | |
} |
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
# I will not write piracy software, I will not write piracy software, I will not write | |
for file in *.mp3; do tracknum="${file%% *}"; trackname="${file#* }"; trackname="${trackname%.mp3}"; id3v2 -T "$tracknum" -t "$trackname" "$file"; done |
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
typ := reflect.TypeOf(function.Here{}) | |
for i := 0; i < typ.NumField(); i++ { | |
field := typ.Field(i) | |
fmt.Printf("Field: %s, Type: %s\n", field.Name, field.Type) | |
} | |
for i := 0; i < typ.NumMethod(); i++ { | |
method := typ.Method(i) | |
fmt.Printf("Method: %s\n", method.Name) |
NewerOlder