[PHP] generate random proxy IP:PORT from CIDR
this script will Generate a random IP:PORT address within a CIDR range.
<?php
/**
* Generate a random IP address within a CIDR range.
*
* @param string $cidr The CIDR range (e.g., "192.168.1.0/24").
* @return string The random IP address.
*/
function generateRandomIP(string $cidr): string {
list($ip, $subnet) = explode('/', $cidr);
// Convert IP to binary format
$ipBinary = ip2long($ip);
// Calculate the number of available IP addresses ...
[PHP] generate big text file for testing purpose
This script will generate a text file named big_text_file.txt with a size of approximately 10 megabytes.
You can adjust the size by changing the value of $fileSizeMB.
The script generates random strings of characters to fill the file.
<?php
// Function to generate a random string
function generateRandomString($length = 10) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';
for ($i = 0; $i < $length; $i+ ...
XAMPP vhosts config full example and guide
Sample configuration for xampp virtual hosts 100% work tested 2022
XAMPP vhosts config full example and guide
important for linux and mac users. Make sure permission of xampp, open etc/httpd.conf change nobody and nogroup with your username and your group
sudo gedit /opt/lampp/etc/httpd.conf
<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/grou ...
List of Chrome Driver command line arguments
List of Chrome Driver command line arguments
Here is the list of Chrome Driver command line Arguments.
If you are using chrome Driver for Selenium WebDriver or Protractor or …. then these are a handy useful list of command line arguments that can be used.
You may use this to look at the usuage: https://code.google.com/p/chromium/codesearch#chromium/src/chromeos/chromeos_switches.cc
Run chromedriver –help to see command line arguments for your version.
--adaboost
--aggressive
--aggressive-cache-d ...
Install markdown engine on vite ESM typescript
Install
yarn add -D vite-plugin-markdown @babel/preset-react @babel/preset-typescript @babel/env babel-plugin-module-resolver
Setup babel config
create .babelrc.js
const presets = ['@babel/env', '@babel/react', '@babel/preset-typescript'];
const plugins = [
[
require.resolve('babel-plugin-module-resolver'),
{
root: [__dirname, './src'],
extensions: ['.jsx', '.js', '.ts', '.tsx', ...
How to disable WebRTC in Chrome, Firefox, Safari, Opera Edge
NFO:
WebRTC is often talked about on VPN Websites.
WebRTC is a Technology that allows your Browser to have Video and Voice Communication Abilities.
When you use Google Meet to hold a Video Conference, you’re using WebRTC.
The same is with the Facebook Messenger Video Call.
There are other Applications that make use of WebRTC. For Example, if you’re on Discord.
It enables live Communications in real Time.
What is WebRTC Leak?
WebRTC works by sending Audio/Video Feeds between two Entitie ...
Android Activity lifecycle
is onStart or onCreate first will be triggered in android activity?
In the Android Activity lifecycle, onCreate() is triggered before onStart(). Here’s a brief overview of the sequence of method calls when an Activity is created:
onCreate(): This method is called when the activity is first created. It is where you typically perform one-time initialization such as setting up the user interface, binding data to lists, or initializing variables.
onStart(): This method is called after onCreate() ...
OkHttp cookie handling on android webview supported
Here how i implement cookie handling for android lollipop - tiramisu and also jvm and non-persistent connection.
requires:
[versions]
webkit = "1.10.0"
okhttp = "4.12.0"
[libraries]
webkit = { module = "androidx.webkit:webkit", version.ref = "webkit" }
okhttp = { module = "com.squareup.okhttp3:okhttp-bom", version.ref = "okhttp" }
okhttp-lib = { module = "com.squareup.okhttp3:okhttp" }
implementa ...
Turn git log history into markdown
#!/bin/bash
echo "writing github commit history"
git log --pretty=format:"%ad%n%h %s%n%b" --date=format:"%Y-%m-%d %H:%M:%S" | while IFS= read -r line; do
trimmed_line="${line#"${line%%[![:space:]]*}"}"
trimmed_line="${trimmed_line%"${trimmed_line##*[![:space:]]}"}"
if [ -n "$trimmed_line" ]; then
if [[ "$trimmed_line" =~ ^[0-9]{4}-[0-9]{2&# ...