Required tools for playing around with memory:
hexdump
objdump
readelf
xxd
gcore
var str = "qwertyuio"; | |
byte[] key = new byte[]{0,134,84,0,67,0,0,53,0,0,125,0,23,0,0,33};//Encoding.ASCII.GetBytes("1234567890123456"); | |
var res = RpcClient.EncryptBytesAes(str, key, new byte[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}); | |
Console.WriteLine(BitConverter.ToString(res)); | |
Console.WriteLine(RpcClient.DecryptBytesAes(res, key, new byte[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})); | |
public static byte[] EncryptBytesAes(string input, byte[] key, byte[] initialVector) | |
{ | |
byte[] encrypted; | |
using (AesManaged aesAlg = new AesManaged()) |
abstract class SocialAuth | |
{ | |
protected $id, $key, $url, $token, $userId, $service; | |
public function setParams($id, $key, $url) | |
{ | |
$this->id = $id; | |
$this->key = $key; | |
$this->url = $url; | |
} |
// https://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html#operator_like | |
const escapeLike = str => str.replace(/\\/g, '\\\\').replace(/([%_])/g, '\\$1'); | |
console.log(escapeLike('%test_') === '\\%test\\_'); | |
console.log(escapeLike('\\%test\\_') === '\\\\\\%test\\\\\\_'); | |
console.log(escapeLike('\\\\%test\\\\_') === '\\\\\\\\\\%test\\\\\\\\\\_'); |
// http://board.issociate.de/thread/508268/prockallsyms.html | |
// sudo grep ' D ' /proc/kallsyms | |
// g++ meltdown.c -std=c++11 && ./a.out ffffffff81d18564 9 | |
#include <stdio.h> | |
#include <string.h> | |
#include <signal.h> | |
#include <ctype.h> | |
#include <math.h> | |
#include <sched.h> |
'use strict'; | |
const {spawn} = require('child_process'); | |
const Convert = require('ansi-to-html'); | |
const express = require('express'); | |
const app = express(); | |
const convert = new Convert({ | |
fg: '#000', | |
newline: true, | |
escapeXML: true |
#!/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" |
Cleanup old map files:
--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 |
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; | |
} | |
} | |
} |