Skip to content

Instantly share code, notes, and snippets.

View dagli's full-sized avatar
🎯
Focusing

dagli

🎯
Focusing
View GitHub Profile
@dagli
dagli / typo.js
Created March 10, 2019 09:00 — forked from iwek/typo.js
Typo Generator in JavaScript
function getTypos(str) {
//http://stackoverflow.com/questions/1431094/how-do-i-replace-a-character-at-a-particular-index-in-javascript
String.prototype.replaceAt=function(index, char) {
return this.substr(0, index) + char + this.substr(index+char.length);
}
//define proximity arrays
var array_prox = [];
@dagli
dagli / auth.php
Created December 13, 2018 08:09 — forked from markrickert/auth.php
Authenticate via HTTP against WordPress user database
<?php
//Force SSL so that passwords aren't sent in the clear.
if($_SERVER["HTTPS"] != "on") {
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
exit();
}
//Here's where the Wordpress magic happens.
@dagli
dagli / encryption.js
Created December 3, 2018 14:43 — forked from vlucas/encryption.js
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bytes (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', new Buffer(ENCRYPTION_KEY), iv);
@dagli
dagli / proxifier_trial_reset.bat
Last active March 29, 2024 16:10
Proxifier Trial Reset
REM Initex Software Proxifiertrial reset
REM Close Proxifier if it is running
taskkill /f /im Proxifier.exe
reg delete "HKCU\SOFTWARE\Microsoft\Internet Explorer\Main" /v DefaultWANProfile /f
reg delete "HKCU\Software\Initex\ProxyChecker\Settings" /v DefaultWANProfile /f
reg delete "HKCU\Software\Initex\Proxifier\Settings" /v DefaultWANProfile /f
REM Delete "DefaultWANProfile" line in "Settings.ini" file in ProxifierPE folder (for Portable Edition)
del %~dp0Settings.old.ini
@dagli
dagli / ns-create.sh
Last active December 12, 2018 02:44 — forked from dpino/ns-inet.sh
Setup a network namespace with Internet access
#!/usr/bin/env bash
set -x
NS="vpn"
ETH="ens3"
VETH="veth0"
VPEER="veth1"
VETH_ADDR="10.200.1.1"
VPEER_ADDR="10.200.1.2"