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
#!/bin/bash | |
f="$1" | |
if [ -z "$f" ] | |
then | |
echo "Usage: $0 elf-to-fix" | |
exit 1 | |
fi | |
if [ -n "$f" -a ! -f "$f" ] |
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
function searchTag(el, tag) { | |
return el.tagName === tag ? el : searchTag(el.parentNode, tag); | |
} | |
const blockList = /acer|kioxia|pny/ig | |
const requireList = /[124]tb/ig | |
[...$$('#ItemContainer .prod_name')] | |
.filter(el => el.textContent.match(blockList) || !el.textContent.match(requireList)) | |
.map(el => searchTag(el, 'DL')) |
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
Add-WindowsCapability -Online -Name (Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server~~~*').Name | |
Start-Service sshd | |
Set-Service sshd -StartupType Automatic | |
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force | |
ssh w11 powershell 'chcp 65001; Add-Content -Force -Path $env:ProgramData\ssh\administrators_authorized_keys -Value "ssh-ed25519 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";icacls.exe "$env:ProgramData\ssh\administrators_authorized_keys" /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"' |
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 ctypes import wintypes | |
import ctypes | |
import threading | |
import time | |
kernel32 = ctypes.CDLL('kernel32') | |
ENABLE_PROCESSED_INPUT = 1 | |
ENABLE_LINE_INPUT = 2 | |
ENABLE_ECHO_INPUT = 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
package main | |
import "fmt" | |
func fcolor(r, g, b byte) string { | |
return fmt.Sprintf("\x1b[38;2;%d;%d;%dm", r, g, b) | |
} | |
func bcolor(r, g, b byte) string { | |
return fmt.Sprintf("\x1b[48;2;%d;%d;%dm", r, g, b) |
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 os | |
proxy = os.getenv('socks5_proxy') | |
if proxy: | |
host, port = proxy.split(':') | |
import socks # pip install pysocks | |
import socket | |
def create_connection(address, timeout=None, source_address=None): | |
sock = socks.socksocket() |
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 { Tooltip } from 'bootstrap'; | |
import { nextTick } from 'vue'; | |
const attrName = 'data-bs-title'; | |
const contextAttrName = '__v_bs_tooltip__'; | |
export default { | |
install(app, options) { | |
app.directive('bs-tooltip', { | |
mounted(el, binding, vnode, prevVnode) { |
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
tab() { | |
s=$(printf "%s" "$*" | base64 | tr -d \\n) | |
osascript &>/dev/null <<EOF | |
tell application "iTerm" | |
activate | |
tell current window to set tb to create tab with default profile | |
tell current session of current window to write text " eval \$(echo $s | base64 --decode)" | |
end tell | |
EOF | |
} |
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
#include <windows.h> | |
#include <winternl.h> | |
#include <stdarg.h> | |
#define GetCurrentProcess() ((HANDLE)-1) | |
NTSYSCALLAPI NTSTATUS NTAPI NtCreateSection( | |
_Out_ PHANDLE SectionHandle, | |
_In_ ACCESS_MASK DesiredAccess, | |
_In_opt_ POBJECT_ATTRIBUTES ObjectAttributes, |
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 ctypes | |
import ctypes.wintypes as wintypes | |
import time | |
import win32con | |
user32 = ctypes.CDLL('user32') | |
user32.MapVirtualKeyW.restype = wintypes.UINT | |
user32.MapVirtualKeyW.argtypes = (wintypes.UINT, wintypes.UINT) |
NewerOlder