Cleanup old map files:
| // https://github.com/Kirill89/prototype-pollution-explained | |
| const mergeFn = require('lodash').defaultsDeep; | |
| const payloads = [ | |
| '{"constructor": {"prototype": {"a0": true}}}', | |
| '{"__proto__": {"a1": true}}', | |
| ]; | |
| function check() { | |
| for (const p of payloads) { | |
| mergeFn({}, JSON.parse(p), {}); |
| const fs = require('fs'); | |
| const util = require('util'); | |
| const readFile = util.promisify(fs.readFile); | |
| fs.writeFileSync('a', 'a'); | |
| const attempts = 100000; | |
| function runInCallback(left, cb) { |
| # put it into your ~/.zshrc | |
| edit64() | |
| { | |
| DECODED=$(pbpaste | base64 --decode) | |
| TMP=$(mktemp) | |
| echo "Temporary file: $TMP" | |
| echo "$DECODED" > "$TMP" | |
| vi "$TMP" | |
| UPDATED=$(cat ${TMP}) |
| #!/usr/bin/env bash | |
| if ! [[ -x "$(command -v lebab)" ]]; then | |
| echo 'Error: lebab is not installed.' >&2 | |
| echo 'Please run: npm install -g lebab tslint' >&2 | |
| exit 1 | |
| fi | |
| if ! [[ -x "$(command -v tslint)" ]]; then | |
| echo 'Error: tslint is not installed.' >&2 |
| class GoodError extends Error { | |
| constructor(...args) { | |
| super(...args); | |
| this.name = 'GoodError'; | |
| Error.captureStackTrace(this, GoodError); | |
| } | |
| } |
| var client = {}; | |
| client.run = function (options) { | |
| options = options || {}; | |
| var socket = io.connect(options.remote || "http://localhost:8080"); | |
| socket.on('connect', function() { | |
| var term = new Terminal({ |
| const os = require('os'); | |
| function getLocalIP() { | |
| for (const ifaces of Object.values(os.networkInterfaces())) { | |
| for (const iface of ifaces) { | |
| if (iface.family === 'IPv4' && iface.internal === false) { | |
| return iface.address; | |
| } | |
| } | |
| } |
| --log_gc (Log heap samples on garbage collection for the hp2ps tool.) | |
| type: bool default: false | |
| --expose_gc (expose gc extension) | |
| type: bool default: false | |
| --max_new_space_size (max size of the new generation (in kBytes)) | |
| type: int default: 0 | |
| --max_old_space_size (max size of the old generation (in Mbytes)) | |
| type: int default: 0 | |
| --max_executable_size (max size of executable memory (in Mbytes)) | |
| type: int default: 0 |
Cleanup old map files:
| #!/bin/sh | |
| PACKAGE_NAME="com.trax.retailexecution" | |
| DB_NAME="$1" | |
| OUT_DIR="$HOME/RealmDatabases" | |
| # Check args | |
| if [ -z "$DB_NAME" ] | |
| then | |
| echo "usage ./realm.sh database_name" |