Use cURL to authenticate with JWT Bearer tokens

Example to pass the Bearer token in the Authorization header: curl -H ‘Accept: application/json’ -H "Authorization: Bearer ${TOKEN}" https://api.website.com/v1/userscurl -H ‘Accept: application/json’ -H "Authorization: Bearer ${TOKEN}" https://api.website.com/v1/users If you need to get the Bearer token use this: curl -s -X POST -H ‘Accept: application/json’ -H ‘Content-Type: application/json’ –data ‘{"username":"{username}","password":"{password}"}’ https://api.website.com/v1/authcurl -s -X POST -H ‘Accept: […]

Detect VMWare Virtual Machine

How to detect VMWare Virtual Machine via WMIC: wmic bios get serialnumber /format:listwmic bios get serialnumber /format:list The output is like this: SerialNumber=VMware-56 4d 95 b1 5a fa 05 0f-28 d0 2d d4 a3 fe e2 5dSerialNumber=VMware-56 4d 95 b1 5a fa 05 0f-28 d0 2d d4 a3 fe e2 5d Alternatively you can query […]

Detect Microsoft Virtual PC Virtual Machine

How to detect Virtual PC Virtual Machine via WMIC: wmic baseboard get manufacturer, product /format:listwmic baseboard get manufacturer, product /format:list The output is like this: Manufacturer=Microsoft Corporation Product=Virtual MachineManufacturer=Microsoft Corporation Product=Virtual Machine Another way is to query “csproduct” like this: wmic csproduct get vendor, name /format:listwmic csproduct get vendor, name /format:list The output is like […]

Fix MariaDB 10.5 “Can’t create test file” errors

I found some issues on recent MariaDB 10.5 installation. The problems seem related to the new protections applied by MariaDB. Here is how I fixed them: 1) Could not increase number of max_open_files sed -i ‘s/LimitNOFILE=16384/LimitNOFILE=150000/’ /etc/systemd/system/mysqld.service sed -i ‘s/LimitNOFILE=16384/LimitNOFILE=150000/’ /lib/systemd/system/mariadb.service systemctl daemon-reloadsed -i ‘s/LimitNOFILE=16384/LimitNOFILE=150000/’ /etc/systemd/system/mysqld.service sed -i ‘s/LimitNOFILE=16384/LimitNOFILE=150000/’ /lib/systemd/system/mariadb.service systemctl daemon-reload 2) Can’t create […]

Use MariaDB and MySQL without Password (MySQL Backup)

On older MySQL versions you could use: /etc/mysql/debian.cnf/etc/mysql/debian.cnf To get MySQL username and password to use for backup purposes. On newer MySQL v8+ versions you just need to run this command as root user: mysql -u root -h localhost …mysql -u root -h localhost … Password is not required in this case. This is because […]

Check if a Trademark is already registered

Here are a few online tools I use to search for Trademarks: Check a Trademark in United States of America (USA): http://tmsearch.uspto.gov/ Check a Trademark in Europe (EU): https://euipo.europa.eu/eSearch/

Make name server address permanent in /etc/resolv.conf

How to make name server address permanent in /etc/resolv.conf? If you do not have the package resolvconf installed, then it is easy: after changing it the way you like, issue the command: sudo chattr +i /etc/resolv.confsudo chattr +i /etc/resolv.conf The command changes the file attributes, making it immutable (the +i option). To view the attribute […]

InnoSetup error the servicemanager is not available

This error happens with InnoSetup v6+ It is related to functions used to manage Windows services, such as: function OpenServiceManager() : HANDLE; begin if UsingWinNT() = true then begin Result := OpenSCManager(”,”,SC_MANAGER_ALL_ACCESS); if Result = 0 then MsgBox(‘the servicemanager is not available’, mbError, MB_OK) end else begin MsgBox(‘only nt based systems support services’, mbError, MB_OK) […]

InnoSetup disable DesktopIcon via command-line

First make sure you have a task named “desktopicon”: [Tasks] Name: desktopicon; Description: Create a &desktop icon; GroupDescription: "Additional icons:"; Flags: checkedonce[Tasks] Name: desktopicon; Description: Create a &desktop icon; GroupDescription: "Additional icons:"; Flags: checkedonce You may also have the desktop icon in the [Icon] section: [Icons] Name: {userdesktop}\YourApp; Filename: {app}\YourApp.exe; Tasks: desktopicon[Icons] Name: {userdesktop}\YourApp; Filename: […]

Get Laptop Battery DeviceID and Name via WMIC

Query the Win32_Battery class via WMIC from command-line: WMIC Path Win32_Battery get DeviceID,Name /format:listWMIC Path Win32_Battery get DeviceID,Name /format:list The output is like this: DeviceID= ASUSTeKASUS Battery Name=ASUS BatteryDeviceID= ASUSTeKASUS Battery Name=ASUS Battery