List view
Aadhar
- PHP Class, Non-Class and JS Validation of 12 digit Aadhar NumberAjaxDropDownSelect
- Ajax and JS based cascading dropdown select boxAjaxRealTimeGraph
- PHP based Real Time Plot of sensor values acquired using AjaxphpDBF_Import.php
- DBF to MySQL import - Schema and Data - using php-dbase extensionPHPFormToDBonce
- One time update of record using random hash from a field in recordPHPProgressMonitor
- Monitor progress of execution of a long running php script with examplesphpHitCounter
- Implements a single webpage hit counter for a single file or set of filesSpriteCSSImages
- Deploy several images from single Sprite Image using CSS. Use in counter digits display.LangUtils
- GetText manipulation scripts for rapid translationsLimeSurveyQAImport
- SQLs generated to import List Radio Questions and Answers from Formatted Text file into LimeSurvey v2.051's DBMSAccessInPHP/mdbtest.php
- Illustrates the usage of MSAccess MDB file in PHP on WindowsOrangeHRMutils
- External and internal bridges to OrangeHRM's Free Open Source EditionPHPINICompare
- Compare php.ini files across serversphpRFT
- PHP Remote File TransferphpTamilTabUniFont
- Tamil TAB Font to Unicode and vice-versa functionsSubnetMaskcalc
- Subnet Mask Calculator by subnetmask.infotranslation
- Easy PHP Site Translation classunixtime/unix_time.html
- Epoch Convertor from Online Conversion | Demo | Productionbooklet-page-calculator.html
- Booklet Page Calculatorcplusplus
- C++ tutorial examplesclean_csv_quote_strings.php
- Strips line feeds in quoted stringsdata_in_php
- Store, retrieve, include and execute data at the end of a php filedocgenerator
- Generates a sample contractual agreement with data from a html form. Generate Disclaimer.display_paged.php
- Display a paged set of records from a MySQL tabledomtute.php
- PHP syntax for DOMDocument across PHP versions to treat searched objects as arraysipmon.php
- Monitor status of devices usingping
jsDynaField
- jQuery based Dynamic Form Field Additionoct_repl.php
- Octal to ASCII string replaceropensslver.php
- OpenSSL version checker - useful for checking if TLS alone is enabledphpGetDomains
- domain_lister.php - Get Insert SQL statements from registrar records at Daily Changesphp-mysql-functions
- PHP functions for MySQL and Password set/blank bash scripts for MySQL 5.6mssql_to_mysql.php
- Converts CREATE TABLE and INSERT statements from MS SQL Server sql script to MySQL equivalentsphp_recursive_menu.php
- Assemble Menu Array from single MySQL query using recursive self lookupphpCheckPAN.php
- Indian Income Tax PAN card validity checkerphpDate2words.php
- Convert Date string to proper cased wordsphpssh2.php
- PHP Tunnel into remote service on localhostphpunzip
- Unzip archives using php by PHPConceptsphp_wget.php
- Use shell commands from within PHP (in windows too) and grab with wgetpincodes
- Data Dump of Indian Postal Codeswiki_extract.php
- Extract urls of uploaded files in MediaWiki based Wikis and use withwget
sql2excel
- php class to convert an sql to an excel worksheetphpIMO_chkdigit.php
- Generate IMO (shipping) check digitphpLIKE.php
- Unicode aware MySQL LIKE operator for PHPphpLegacy.php
- Backport of new PHP functions equivalentsunicode_sql2excel.php
- Export SQL to Excel without any library (native CSV) for unicode datagxlate
- PHP Function for Google Translation of single string without using Google Translate APIcidr_match.php
- Check if IPv4 is within subnet range and dynamically get a base URLip.php
- Obtain your public / private ipiprec.php
- Store your public / private ip in a text file on the server and retrieve at willip2isp_tsv.php
- Lookup the owner ISP of an array of IPs from https://ipinfo.io (free 1000 lookups per day per IP)jsBase64Form.php
- Submit a form field after base64 encoding it in javascriptperm.php
- Set folders to 755 and files to 644 permissions recursivelyPortReDirect.html
- Redirects from Port 80 to any other port without port forwarding - plain HTML and JS onlyUnixTS2DateTS.php
- Convert Unix Timestamp to Readable Date Format in PHPyoutube_srt_corrector.php
- Correct auto generated subtitles from YouTube Closed Captionsparse_apache2_log.sh
- Parse Apache2 Log at /var/log/apache2/access.logSetMTU.bat
- When optical fibre length increases as occurs when re-routing on cut, latency increases - adjust Max Tx Unitkill_wget.bat
- Kill Windows Process when invoked from browser or other program like apache
pubip=`wget -qO- http://www.apmuthu.com/ip.php`
ascii_endecode.php
- encrypt / decrypt ASCII code based index shift in phpDecryptCSinPHP.php
- decrypt C# in phpxlate.php
- Encode / Decode strings / binary in PHPmod_rewrite_test.php
- Advanced mod_rewrite troubleshooting testerPHP_SourceCodeViewer.php
- Place this file in a folder calledsource
and name itindex.php
to view source code of all php files under it.phpLuhn.php
- generate and verify credit card checksumsvar2file.php
- Save a PHP variable in a file for including it in another PHP file.AjaxJSselect.html
- Javascript based drop down select controlled by another select boxTandC.php
- Place defined constants in a PHP Stringmask_download_url.php
- Mask the real URL of a downloadable file in php
images_to_pdf.php
- Join images in a folder into a single PDF file using FPDF librarypdfoverlay
- Generate an overlaid PDF populating a template PDF file using data from a databasePDFMerger.php
- Split and Merge PDF files using fpdf and fpdiphp_get_pdf_header.php
- Extract Creation Date, Modified Date, Number of Pages and PDF Version from a PDF file
DMCA.php
- Generate and/or use a DMCA page in your site
- DOS_FileListInMySQL.md - Organise DOS File and Folder List into a MySQL table and generate Delete and Move commands
php_is_cli.php
- Checks if called from PHP CLI, obtains local server IPphp_cli_param_usage.php
- Various ways to pass on parameters into a PHP script for CLI usagephp_cli_console_input.php
- Get user input from console into PHP variable
dbs_xchg_rate.php
- Get Exchange Rate from DBS Bank in Singapore DollarsBloomberg_Rates.php
- Get currency exchange rate from Bloombergfxratenet_rates.php
- Get currency exchange rate from fx-rate.netXE/xe_xchg_rate.php
- Get all From/To exchange rates from XEx-rates/x-rates.php
- Get 1 USD Exchange Rate of 53 Currencies from x-ratesrbi_inr_rates.php
- Get latest Reserve Bank of India (RBI) Forex rates in INR
EA_MSSQL_Parser
- Enterprise Architect MS SQL Table format parse to MySQL table creation fragmentExtractOptions.php
- HTML select box options string to arrayHTML2Links.php
- Extract all unique filtered URLs with their display values from XML / HTML contentparse_word.php
- Extract text from Word documentsParseSQLstr.php
- Parse SELECT columns of any SQL string without connecting to DBxml2tsv
- Convert XML to TSV (Tab Separated Values)youtube2srt.php
- Convert YouTube Transcript page text into subtitle .srt formatnetgear_logs.sh
- Netgear DG834G Router Log Parserhierarchial_parser.php
- Category, Sub-Category, Items parser from formatted text fileexcel_parser_sample.php
- Parse Excel data into PHP
- Debian to FreeBSD md5 format conversion and comparison in bash
# in Debian / Windows GitBash
find . -type f -exec md5sum '{}' \; > ../debian_md5.txt
# in FreeBSD
find . -type f -exec md5 '{}' \; > ../freebsd_md5.txt
awk -F'*' '{ print "MD5 ("$2") = "$1 }' ../debian_md5.txt | sed 's/\s$//' > ../freebsd_formatted_md5.txt
diff ../freebsd_formatted_md5.txt ../freebsd_md5.txt
7-Zip file extraction on desktop
"C:\Program Files\7-Zip\7z" e %USERPROFILE%\Desktop\content.epub -y -o%USERPROFILE%\Desktop\output *.pdf -r
curl -s ifconfig.me/ip # Using curl silently without progress bar
wget -qO- ifconfig.me/ip # Using wget quietly
# Remove Comments and append new IPs and then:
grep -v "#" ip_blocked.txt | uniq | sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n > ip_blocked_sorted.txt
cat /var/log/apache2/access.log | awk '{print $1}' | sort -nr | uniq -c | sort -nr | head -n 25
while (true); do clear; ls -al; sleep 2; done
Remove delay in login for Debian (10.11.12) Buster, BullsEye and Bookworm LXC containers
systemctl mask systemd-logind
awk '!seen[$0]++'
awk
executes the action print last only when NR > 2
(that is, on all lines but the first 2). On all lines, it sets the variable last
to the current line. So when awk reads the third line, it prints line 2 (which was stored in last
). When it reads the last line (line n
) it prints the content of line n-1
. The net effect is that lines 2
through n-1
are printed.
awk 'NR>2 {print last} {last=$0}'
cat my_infile.txt | \
awk '!seen[$0]++' | \
awk '!seen[$0]++' > my_outfile.txt
cat my_infile.txt | \
paste - - > my_outfile.txt
find . -name "*.zip" | while read filename; do unzip -o -d "`basename "$filename" | cut -d"." -f1`" "$filename"; done;
grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' log.txt | sort -u > new.txt
find . -type f \( -name "*.png" -o -name "*.jpg" \) -exec bash -c 'base64 {} > {}.b64' \;
- dd/mm/yyyy format to be reeplaced as yyyy-mm-dd format using RegEx Replace option
- '11/04/2011', needs to become '2011-04-11'
- Find:
(\d+)/(\d+)/(\d{4})
Replace with:$3-$2-$1
- Here the missing character is forward slash (/)
^((?!/).)*$
sed '${/?>/d;}' -i my_php_script.php
# Recursive within a folder:
cd /your/dir/here && find . -type f -print0 | xargs -0 sed -i '${/?>/d;}'
$a = file_put_contents('./logs.txt', date('Y-m-d ')."AA".PHP_EOL , FILE_APPEND | LOCK_EX);
if (strlen($a) != strlen(utf8_decode($a)))
echo $a . " is unicode";
INET_NTOA(INET_ATON( <IPField> ) & 0xFFFF0000)
ALTER TABLE my_old_db.mytable RENAME my_new_db.mytable;
COALESCE( expression, 'a substitute for NULL' ) -- NULL only
COALESCE( NULLIF( expression, 0 ), 'a substitute for Zero' ) -- Zero only
IFNULL( NULLIF( expression, 0 ), 'a substitute for NULL or Zero') -- NULL or Zero
SELECT SUBSTR(MailID, 1, INSTR(MailID, '@') -1) FROM `users`; -- username
SELECT (SUBSTRING_INDEX(SUBSTR(MailID, INSTR(MailID, '@') +1),'.',1)) FROM `users`; -- domain first part
SELECT RIGHT(MailID, LENGTH(MailID)-INSTR(MailID, '@')) AS Domain FROM `users`; -- Full Domain only
USE `ddb`;
DELIMITER $$
CREATE TRIGGER `default_date` BEFORE INSERT ON `dtable` FOR EACH ROW
if ( isnull(new.query_date) ) then
set new.query_date=curdate();
end if;
$$
delimiter ;
validate EMail addresses
SELECT * FROM tblExample
WHERE fldEMail IS NOT NULL
AND fldEMail NOT REGEXP '^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9._+-]@[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9]\\.[a-zA-Z]{2,63}$';
SET @N = 2; -- 2nd word
SET @haystack = '378459X293X4460'; -- example
SET @delimiter = 'X';
SELECT
SUBSTRING_INDEX(SUBSTRING_INDEX(@haystack, @delimiter, @N), @delimiter, -1)
FROM
my_table;
getmac -v -fo list
Change the code page at the DOS Prompt with:
chcp 65001
and then issue any command like:
dir /b > ..\files.txt
Excel Reverse Concatenate
=TRIM(MID(SUBSTITUTE($A2,",",REPT(" ",999)),COLUMNS($A:A)*999-998,999))
=RIGHT(A2,LEN(A2)-FIND("@",SUBSTITUTE(A2,"/","@",LEN(A2)-LEN(SUBSTITUTE(A2,"/",""))),1))
VLC Player CLI Merge MP3 files when in same format in windows
"%PROGRAMFILES%\VideoLAN\VLC\vlc.exe" -vv 1.mp3 2.mp3 3.mp3 --sout-keep --sout=#gather:transcode{acodec=mp3,ab=128}:standard{access=file,mux=dummy,dst=combinedout.mp3}