Top HN posts
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
| import openai | |
| import boto3 | |
| import json | |
| import time | |
| from typing import Dict, List | |
| openai.api_key = '### SET YOUR OPENAPI API KEY HERE ###' | |
| session = boto3.session.Session() | |
| client = session.client('iam') |
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
| ' Proof of Concept: retrieving SSN for syscalling in VBA | |
| ' Author: Juan Manuel Fernandez (@TheXC3LL) | |
| 'Based on: | |
| 'https://www.mdsec.co.uk/2020/12/bypassing-user-mode-hooks-and-direct-invocation-of-system-calls-for-red-teams/ | |
| 'https://www.crummie5.club/freshycalls/ | |
| Private Type LARGE_INTEGER |
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
| <?php | |
| // half-hearted CSS minification | |
| $css = preg_replace( | |
| array('/\s*(\w)\s*{\s*/','/\s*(\S*:)(\s*)([^;]*)(\s|\n)*;(\n|\s)*/','/\n/','/\s*}\s*/'), | |
| array('$1{ ','$1$3;',"",'} '), | |
| file_get_contents('linked.css') | |
| ); | |
| // embed as a data: uri | |
| $base64css = rtrim(strtr(base64_encode($css), '+/', '-_'), '='); |
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
| # study stream aliases | |
| # Requires https://github.com/caarlos0/timer to be installed. spd-say should ship with your distro | |
| declare -A pomo_options | |
| pomo_options["work"]="45" | |
| pomo_options["break"]="10" | |
| pomodoro () { | |
| if [ -n "$1" -a -n "${pomo_options["$1"]}" ]; then | |
| val=$1 |
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
| n=256;q, t, m, e, p, c, f=(range(n),16,lambda x | |
| ,y, r=0:m((h:=x <<1,h^283)[ | |
| h&n!= 0],y>> 1,(r,r ^x) | |
| [y&1])if y else r,lambda | |
| a,w= 1,p=n -2:e(m(a, a),(w,m | |
| (w,a))[p&1] ,p>> 1)if p | |
| else w, lambda b: list( | |
| map (print,["%.2x "*t%(*b[r:r+t],)for | |
| r in [*q][::t]])),lambda a,i: (a<<i|a>>8-i)&255 | |
| ,lambda a: (a^c(a,1)^c(a,2)^c(a,3)^c(a,4))^99); |
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
| .global _main | |
| .extern _putchar | |
| .align 4 | |
| _main: | |
| ; prolog; save fp,lr,x19 | |
| stp x29, x30, [sp, #-0x20]! | |
| str x19, [sp, #0x10] |
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'll be doing another one for Linux, but this one will give you | |
| # a pop up notification and sound alert (using the built-in sounds for macOS) | |
| # Requires https://github.com/caarlos0/timer to be installed | |
| # Mac setup for pomo | |
| alias work="timer 60m && terminal-notifier -message 'Pomodoro'\ | |
| -title 'Work Timer is up! Take a Break 😊'\ | |
| -appIcon '~/Pictures/pumpkin.png'\ | |
| -sound Crystal" |
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
| ' Proof of Concept: retrieving SSN for syscalling in VBA | |
| ' Author: Juan Manuel Fernandez (@TheXC3LL) | |
| 'Based on: | |
| 'https://www.mdsec.co.uk/2020/12/bypassing-user-mode-hooks-and-direct-invocation-of-system-calls-for-red-teams/ | |
| 'https://www.crummie5.club/freshycalls/ | |
| Private Type LARGE_INTEGER |
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
| const tokens = [ | |
| [/^\s+/, null], | |
| [/^\[/, '['], | |
| [/^]/, ']'], | |
| [/^\{/, '{'], | |
| [/^}/, '}'], | |
| [/^:/, ':'], | |
| [/^,/, ','], | |
| [/^"/, '"'], | |
| [/^\d+/, 'number'], |