Development

How to delete all files containing string in Linux

April 27, 2023

find -type f -name '*string*' -delete This command will delete all files whose filenames contain the string string. The * character is a wildcard that matches any number of characters. The -type f option tells find to only look for files, not directories. The -delete option tells find to delete the files it finds.

How to Resolve "Cannot Unregister the Machine While It Is Locked" Error in Vagrant

February 1, 2022

When working with Vagrant, a tool for building and managing virtual environments, you may encounter an error message that reads “Cannot unregister the machine while it is locked.” This is often accompanied by a block of error messages and command output, as shown below: vagrant destroy default: Are you sure you want to destroy the 'default' VM? [y/N] y ==> default: Destroying VM and associated drives… There was an error while executing VBoxManage, a CLI used by Vagrant for controlling VirtualBox. ...

How To Install PHP (7.4, 7.3 & 5.6) on Debian 9 Stretch

July 14, 2020

Prerequisites # Login to your Debian 9 system using shell access. For remote systems connect with SSH. Windows users can use Putty or other alternatives applications for SSH connection. ssh root@debian9 Run below commands to upgrade the current packages to the latest version. sudo apt update sudo apt upgrade Let’s execute the following commands to install the required packages first on your system. Then import packages signing key. After that configure PPA for the PHP packages on your system. ...

Fix casks with `depends_on` that reference pre-Mavericks

May 18, 2020

If you get an error of the type Error: Cask 'hex-fiend-beta' definition is invalid: invalid 'depends_on macos' value: ":lion", where hex-fiend-beta can be any cask name, and :lion any macOS release name, run the following command: /usr/bin/find "$(brew --prefix)/Caskroom/"*'/.metadata' -type f -name '*.rb' -print0 | /usr/bin/xargs -0 /usr/bin/perl -i -pe 's/depends_on macos: \[.*?\]//gsm;s/depends_on macos: .*//g' This will remove all depends_on macos references of installed casks.

How to run VLC player as root user

May 18, 2020

sed -i 's/geteuid/getppid/' /usr/bin/vlc Explanation: The initialization script check if the UID is equals to zero. Zero is reserved for the root user. Using sed to replace geteuid for getppid fools the initialization script because it is always > 0. While running the VLC as root is not recommended, it works. Be aware of the risks and obviously do not do it for production environments.

List all Azure VM extensions

December 28, 2018

az vm extension image list [ { "name": "AcronisBackup", "publisher": "Acronis.Backup", "version": "1.0.33" }, { "name": "AcronisBackupLinux", "publisher": "Acronis.Backup", "version": "1.0.33" }, { "name": "AlertLogicLM", "publisher": "alertlogic", "version": "1.3.0.1" }, { "name": "AlertLogicLM", "publisher": "AlertLogic.Extension", "version": "1.3.0.0" }, { "name": "AlertLogicLM", "publisher": "AlertLogic.Extension", "version": "1.4.0.0" }, { "name": "AlertLogicLM", "publisher": "AlertLogic.Extension", "version": "1.9.0.0" }, { "name": "AlertLogicLM", "publisher": "AlertLogic.Extension", "version": "1.9.1.0" }, { "name": "AgentWinExt", "publisher": "bmc.ctm", "version": "9.0.0.1" }, { "name": "ChefClient", "publisher": "Chef. ...