PHP HowTo – correctly search for a string inside a string
22.Sep.2022

the developer can name this file ./EXAMPLES/ARRAY/find.php please note the strpos or stripos !== false without it, if a substring is found within a string at position 0 for if 0 equals false <?php $mystring = ‘abc’; $findme = ‘a’; […]

PHP HowTo – sort array of arrays
22.Sep.2022

usage: $devices_array_sorted = ArrayOfArraysSort($devices_array, “AverageWatts”,SORT_ASC); the function: /* sort array that contains a lot of arrays by key */ function ArrayOfArraysSort($array,$key,$mode) { // sort by age $sort = array(); foreach($array as $k=>$v) { $sort[$key][$k] = $v[$key]; } # sort by […]

GNU Linux – fonts and font editors – what is WOFF?
26.Aug.2022

TTF vs WOFF (Web Open Font Format) “TTF (TrueType Font) is a standard developed by Apple in the 1990s” “WOFF is basically a compressed TTF with metadata and browser support” (src) developed by Mozilla in concert with Type Supply, LettError, […]

GNU Linux bash – optimizing basics – the ll alias to ll
26.Jul.2022

ok an alias is simply an appreviation (ll) of a longer command (ls -lah –color) defined in one of those files: user@Debian8:~$ bash -l; # simulates a login 1. hello from /etc/bash.bashrc 2. hello from /etc/profile 7. hello from ~/.bash_profile […]

GNU Linux Bash – simple backup web root and mysql mariadb database in one go script
25.Jul.2022

v2 mkdir /root/backups; vim /scripts/backup_db.sh #!/bin/bash # Prompt user for root password read -sp “Enter MySQL root password: ” root_password echo # Get list of databases databases=$(mysql -uroot -p”$root_password” -e “SHOW DATABASES;” | grep -Ev “(Database|information_schema|performance_schema|mysql)”) for db in $databases; […]

MySQL MariaDB cheat sheet
14.Jul.2022

login to mysql: su – root; list all available databases: # login & send command to mysql & logout mysql -u root -e ‘show databases’ -s –skip-column-names # or login mysql -u root -p; # enter command mysql> show databases; […]

GNU Linux Debian 11 – How to setup Brother QL 600 LabelPrinter
13.Jul.2022

it’s a two part process: 1. install the drivers (thanks all involved great work 🙂 su – root apt update apt install printer-driver-ptouch 2. install the printer via cups web browser interface http://localhost:631/ or: https://localhost:631/ -> Administration -> Add Printer […]

GNU Linux bash – notebook laptop test battery runtime script
08.Jul.2022

how long (many hours) will this notebook-laptop battery last? some sensors/softwares report/calculate things like this… 5days on one charge is a very very optimistic estimate for most intel or amd based notebooks (even for RISC/ARM based notebooks-laptops that would be […]

Rant: One day either JavaScript or AutoComplete will start ww3
25.Jun.2022

which pretty much reads like: it probably has to do with: https://wiki.mozilla.org/ServerJS/Introduction (used in firefox and/or thunderbird?) (checkout this search for more javascript rants X-D) one day either JavaScript or Autocomplete will cause the 3rd world war: now imagine Biden […]