Posts

F3 check for faulty and fake SD card

[Post Reformating Required] sudo umount /dev/sdX; # Unmount it if it's currently mounted sudo mkfs.ext4 /dev/sdX; # Format it to ext4 # If it's not mounted automatically: sudo mkdir /media/new_folder_name sudo mount /dev/sdX /media/new_folder_name f3write /media/new_folder_name f3read /media/new_folder_name/ Reference: https://starbeamrainbowlabs.com/blog/article.php?article=posts%2F402-fight-flash-fraud.html List all the attached devices sudo fdisk -l Run f3probe for examination f3probe --destructive --time-ops /dev/sdb If you encounter this kind of error f3probe: libdevs.c:324: read_all: Assertion `(*__errno_location ()) == 5' failed. Resolution: install the package libude version 1 sudo apt-get install libudev1 libudev-dev

Delete .DS_Store file in OneDrive on Mac

Background This is the "find" command to remove all (including OneDrive) .ds_store in a particular directory. Pay attention to the ".", run the command only at the directory level you would like to search and execute.  Command find . -type f -name '.DS_Store' -exec rm {} \;

Use PHP 7.4 in Hostgator CLI

Login to the shell vim ~/.bashrc add the following in the .bashrc alias php='/opt/cpanel/ea-php74/root/usr/bin/php' export PATH="/opt/cpanel/ea-php74/root/usr/bin:$PATH" source the .bashrc, or do a re-login Reference https://stackoverflow.com/questions/39643805/need-to-run-composer-update-on-ssh-on-hostgator-but-php-v-to-low

Virtualmin Installation Error: Can't locate Virtualmin/Config.pm in @INC

Background Encounter "Can't locate Virtualmin/Config.pm in @INC" error during the virtualmin installation How to reproduce? OS: Ubuntu 18.04 LTS Machine: AWS EC2 Virtualmin: installation script on 2020/07/14 Error Message ▣▣▣ Phase 3 of 3: Configuration Can't locate Virtualmin/Config.pm in @INC (you may need to install the Virtualmin::Config module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/bin/virtualmin-config-system line 9. BEGIN failed--compilation aborted at /usr/bin/virtualmin-config-system line 9. ▣▣▣ Cleaning up Solution edit file /usr/bin/virtualmin-config-system add the "BEGIN { push @INC, '/usr/share/perl5/vendor_perl'; }" on line 9 #!/usr/bin/env perl use strict; use warnings; use 5.010_001; use ...

Remap my macbook key button

Background My macbook keyboard got some problem, the up arrow sometime cannot function properly, i found that the right shift button is not usually used and it is just right above the up arrive, so i decided to remap the apple keypad from right shift to up arrow. Conclusion You may find the detail explanation here with the key code table for the HEX number assignment: https://developer.apple.com/library/archive/technotes/tn2450/_index.html Command hidutil property --set '{"UserKeyMapping": [{"HIDKeyboardModifierMappingSrc":0x7000000e5, "HIDKeyboardModifierMappingDst":0x700000052}] }' Reference https://apple.stackexchange.com/questions/283252/how-do-i-remap-a-key-in-macos-sierra-e-g-right-alt-to-right-control

Backup and Restore in Virtualmin

Backup all domains virtualmin backup-domain --dest /absolate_path/backups/ --all-domains --all-features --newformat --all-virtualmin Restore Virtualmin virtualmin restore-domain --source /absolate_path/virtualmin.tar.gz --all-virtualmin Restore all domains virtualmin restore-domain --source /absolate_path/ --all-domains --all-features Restore specific domain virtualmin restore-domain --source /absolate_path/specific.domain.tar.gz --domain specific.domain --all-features --skip-warnings --continue-on-error --delete-existing