Skip to content

Instantly share code, notes, and snippets.

View ArrayIterator's full-sized avatar

ArrayIterator ArrayIterator

View GitHub Profile
@ArrayIterator
ArrayIterator / ip_helper.cjs
Last active June 25, 2024 14:49
IP Helper For Validate IP4 & IP6 - (ip_helper.mjs - for module) & (ip_helper.cjs - for common js)
/*!
* IP Helper
*
* @author ArrayIterator<me@arrayiterator.com>
*/
const IPv4_REGEX = /^(?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.(?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.(?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.(?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])$/;
// ::1 is also valid IPv6 address
const IPv6_REGEX = /^([0-9a-fA-F]{0,4}:){1,7}([0-9a-fA-F]{1,4})$/;
@ArrayIterator
ArrayIterator / PasswordScore.js
Last active May 12, 2024 05:32
Simple Password Strength Checker & Generator - https://github.com/ArrayIterator/simple-passwordscore
/**
* 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
Created May 11, 2024 10:52
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 October 18, 2023 19:29
Kil 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.

Edit the crontab

Do not delete the url of wget or curl command from kinsing malware, just comment it like. There are script checking about the crontab file

# your another crontab
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