Skip to content

Instantly share code, notes, and snippets.

View ArrayIterator's full-sized avatar

ArrayIterator ArrayIterator

View GitHub Profile
/**
* Simple Password Strength Checker
* ~ Password Score based on the following rules:
* PasswordScore(password: string, username: string|null): number
* ~ Generate Password based on the following rules:
* GeneratePassword(length: number = 12): string
* ~ Password Strength Level:
* PASSWORD_WEAK: 0
* PASSWORD_MEDIUM: 1
* PASSWORD_STRONG: 2
@ArrayIterator
ArrayIterator / Crypto.js
Last active August 15, 2024 06:12
Easier to use Web Crypto - Crypto.js
const Algorithms = {
AES: {
description: 'Advanced Encryption Standard',
ivLength: 16,
decryptionSupported: true,
keySupported: true,
publicKeySupported: false,
signatureSupported: false,
default: 'AES-128-CBC',
algorithms: {
@ArrayIterator
ArrayIterator / helper.js
Last active May 12, 2024 05:33
Helper for React.js (just like some php functions) to easier manage code - https://github.com/ArrayIterator/arrayiterator-js-helper
const createTrimRegexP = (e, position ='both') => {
const charArray = {};
strval(e).split('').forEach((e) => {
if (in_array(e, ['-', '/'])) {
e = '\\' + e;
}
charArray[e] = e;
});
let regex = `[${values(charArray).join('')}]`;
switch (lower_trim(position)) {
@ArrayIterator
ArrayIterator / PasswordHash.php
Last active April 6, 2024 23:25
Password Hashing Library with OpenWall PasswordHash Compat
<?php
declare(strict_types=1);
namespace ArrayIterator\Hashing;
use Exception;
use function chr;
use function crypt;
use function max;
use function min;
// stpd! chatgpt 3.5 generated
// phpDateConverter.js
/**
* Converts PHP date format to JavaScript date format.
* @param {string} phpFormat - PHP date format string.
* @returns {string} - JavaScript date format string.
*/
function convertPhpToJsDateFormat(phpFormat) {
// Mapping of PHP date format characters to JavaScript equivalents
@ArrayIterator
ArrayIterator / as-numbers.php
Last active October 31, 2023 20:54
array list of tld domain + supported sub domains, ipv4, ipv6, as-number include whois server
<?php
declare(strict_types=1);
// auto generated at : 2023-10-28T05:03:52+07:00
return [
'0-0' => [
'range' => [
0,
0,
],
@ArrayIterator
ArrayIterator / FileResponder.php
Created October 24, 2023 19:26
File Serve Responder
<?php
namespace MyNamespace;
class FileResponder
{
protected $file = null;
protected $mimetype = 'application/octet-stream';
/**
@ArrayIterator
ArrayIterator / KINSING-KDEVTMPFSI.md
Last active November 1, 2024 06:20
Kill the kinsing & kdevtmpfsi malware

Kinsing File Affected

Too many problem solver on the internet does not resolve the malware infection about kinsing. The kinsing malware also infected the network & listen into network port.

Check All SSH Authorization

Check under the root ssh authorization

cat ~/.ssh/authorized_keys
If you'r using MAC Intel CPU you want to use VMware to virtual your desired OS such Windows or Ubuntu on the MAC OS you need to download VMware Fusion Player first then it has two version Pro and Player, the Player version is free for personal use but you need to create VM account to download and licence key.
You can create account to download yourself here:
https://customerconnect.vmware.com/group/vmware/evalcenter?p=fusion-player-personal
If you don't want to create account to get license, you can try below original license key for VMware Fusion Player:
COMPONENT:
VMware Fusion Player – Personal Use
@ArrayIterator
ArrayIterator / CreditCard.php
Last active December 28, 2022 18:20
PHP Credit Card Generator / Validator
<?php
declare(strict_types=1);
namespace ArrayIterator\Generator;
/**
* Credit card validator & generator
*/
class CreditCard
{