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
setTimeout(() => { | |
document.querySelectorAll("textarea").forEach(e => { | |
e.addEventListener("keydown", ev => { | |
if (ev.ctrlKey) { | |
ev.stopPropagation(); | |
} | |
}) | |
}) | |
}, 2000) |
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 java.io.*; | |
import java.nio.*; | |
import java.nio.file.*; | |
import org.apache.bcel.classfile.Utility; | |
public class Main { | |
public static void help() { | |
System.out.println( |
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 _fillUp(value, count, fillWith) { | |
var l = count - value.length; | |
var ret = ""; | |
while (--l > -1) | |
ret += fillWith; | |
return ret + value; | |
} | |
function hexdump(arrayBuffer, offset, length) { | |
offset = offset || 0; |
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
// system resources physical memory map VM detection trick | |
// written by Graham Sutherland (@gsuberland) for Nettitude | |
// based on prior work done as part of the al-khaser project | |
// https://github.com/LordNoteworthy/al-khaser/ | |
// ref: https://blog.xpnsec.com/total-meltdown-cve-2018-1038/ | |
// ref: https://gist.github.com/xpn/3792ec34d712425a5c47caf5677de5fe | |
// compile: |
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
class Test: | |
async def notify_async(): | |
await asyncio.sleep(1) | |
def notify(self): | |
loop = None | |
try: | |
loop = asyncio.get_running_loop() | |
except RuntimeError: |
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 itertools | |
def expand_ip_range(ipstr): | |
parts = ipstr.split('.') | |
param = [] | |
for part in parts: | |
if '-' in part: | |
tmp = part.split('-') | |
start = 0 |
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 | |
installed=( $(dpkg-query -W --showformat='${Package}\n' | grep -oP '^linux-image-\K\d.*' | sort -r) ) | |
running=$(uname -r) | |
echo Installed versions: ${installed[@]} | |
if [[ ${#installed[@]} -le 1 ]]; then | |
echo Nothing to do | |
exit | |
fi |
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
const sqlite3 = require('sqlite3') | |
const fs = require('fs') | |
let dbpath = 'common.db' | |
let finished = 0, total = 0 | |
let mydb = new sqlite3.Database(dbpath) | |
if (fs.existsSync(dbpath)) { | |
fs.unlinkSync(dbpath) | |
} |
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 | |
if [ ! -f "vmlinux-3.2.0-4-4kc-malta" ]; then | |
wget https://people.debian.org/~aurel32/qemu/mipsel/vmlinux-3.2.0-4-4kc-malta | |
fi | |
if [ ! -f "debian_wheezy_mipsel_standard.qcow2" ]; then | |
wget https://people.debian.org/~aurel32/qemu/mipsel/debian_wheezy_mipsel_standard.qcow2 | |
fi | |
sudo qemu-system-mipsel -m 1024M -M malta \ |
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 | |
echo Setting up ComputerName and HostName | |
sudo scutil --set ComputerName XXX | |
sudo scutil --set HostName XXX | |
echo Disable spotlight | |
sudo mdutil -a -i off | |
echo Disable guest account |
NewerOlder