Skip to content

Instantly share code, notes, and snippets.

View romandobra's full-sized avatar
🇨🇦
Open for proposals

romandobra

🇨🇦
Open for proposals
View GitHub Profile
location / {
if (!-f /var/www/auth_cookies/$cookie_AUTH_COOKIE) {
add_header Content-Type text/html;
return 200 '<form><input name="auth_cookie"><button type="submit">AUTH</button></form><script>
const f=new Proxy(new URLSearchParams(window.location.search),{get:(searchParams,prop)=>searchParams.get(prop),});
if (!f.auth_cookie == ""){document.cookie="AUTH_COOKIE="+f.auth_cookie+"; Expires=Thu, 01 Jan 2070 00:00:01 GMT";
window.location.replace("$scheme://$server_name/")};
</script>';
@romandobra
romandobra / send-to-console.expect
Last active August 23, 2024 08:04
cat piped_script.sh | expect send-to-console.expect
#!/usr/bin/expect -f
set timeout -1
spawn virsh -c qemu:///system console vm1
expect "Connected"
send "\r"
expect "debian-live login: "
send "root\r"