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
cd ~ && chmod 600 ~/.ssh/* && chmod 700 ~/.ssh && chmod 644 ~/.ssh/*.pub |
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
static async Task<Encoding> GetEncodingFromStream(Stream s, int bufferSize, CancellationToken ct) | |
{ | |
if (!s.CanSeek || !s.CanRead) | |
{ | |
// can't touch this | |
return Encoding.Default; | |
} | |
byte[] buffer = new byte[bufferSize]; | |
int bytesRead = await s.ReadAsync(buffer, 0, buffer.Length, ct); |
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
let securityHeaders = { | |
"Content-Security-Policy": "default-src 'self' 'unsafe-inline'", | |
"X-Xss-Protection": "1; mode=block", | |
"X-Frame-Options": "DENY", | |
"Referrer-Policy": "strict-origin-when-cross-origin", | |
"Permissions-Policy": "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()" | |
}; | |
addEventListener('fetch', event => { | |
event.respondWith(addHeaders(event.request)); |
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
<!DOCTYPE html> | |
<html lang="da-DK"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> | |
<div> | |
<textarea id="emails"></textarea> | |
<button id="doMail"></button> |
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
sudo apt-get update | |
sudo apt-get dist-upgrade | |
sudo apt-get install boinc-client | |
sudo /etc/init.d/boinc-client restart | |
boinccmd --project_attach https://boinc.bakerlab.org/rosetta/ {your-weak-key-here} | |
boinccmd --set_run_mode always | |
boinccmd --set_network_mode always | |
boinccmd --get_simple_gui_info |
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 CallbackWrapper { | |
param ( | |
[string]$callbackScript, | |
[object]$param, | |
[int]$order | |
) | |
$callback = [ScriptBlock]::Create($callbackScript) | |
return [PSCustomObject]@{ | |
Result = $callback.InvokeReturnAsIs($param) | |
Order = $order |
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 () { | |
"use strict"; | |
var t = performance.timing, | |
t1 = t.navigationStart, | |
arr = [t.responseEnd - t1, t.domContentLoadedEventStart - t1, t.loadEventEnd - t1], | |
storage = sessionStorage, | |
storageKey = "perf-coll", | |
coll = JSON.parse(storage.getItem(storageKey) || "[]"), | |
serialized; | |
coll.push(arr); |
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
/** | |
* NAV client control with a simple multiline text box | |
* Exposes the following methods: | |
* GetText() : string | |
* SetText(string) | |
* GetReadOnly() : boolean | |
* SetReadOnly(boolean) | |
* | |
* And the following events: | |
* Blur |
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 Get-Spreadsheet { | |
param( | |
[Parameter(Mandatory = $true)] | |
[ValidateScript({ Test-Path $_ -PathType Leaf })] | |
[string]$Path | |
) | |
try { | |
[DocumentFormat.OpenXml.Packaging.SpreadsheetDocument] | Out-Null | |
} | |
catch { |
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/sh | |
curl 'http://192.168.1.1/log/in?un=admin&pw=SECRET&rd=%2Fuir%2Fstatus.htm&rd2=%2Fuir%2Fwanst.htm&Nrd=1' --user-agent 'Mozilla/4.0' --header 'Connection: keep-alive' --header 'Accept: text/html' --cookie-jar /tmp/cookiejar.txt | |
sleep 1 | |
curl 'http://192.168.1.1/uir/rebo.htm?Nrd=0&ZT=1489819874729' --user-agent 'Mozilla/4.0' --header 'Connection: keep-alive' --header 'Accept: text/html' --cookie /tmp/cookiejar.txt | |
rm /tmp/cookiejar.txt |
NewerOlder