Each file has three timestamps associated with it (stored as the number of seconds since the Epoch, Jan 1, 1970). The three timestamps are: Access time (atime): The timestamp when the file was last accessed. Modification time (mtime): The timestamp when the file was last modified. Change time (-ctime): The timestamp when the metadata for […]
Archives for April 2022
Mac Terminal diskutil Command Examples
The diskutil command operates on disk partitions: mounting and unmounting, getting information, renaming, erasing, and more. Read-only operations can be done by any user, but writing and mounting require an administrator. For example, if you have a portable USB drive mounted: $ df -h /Volumes/MyUSB Filesystem Size Used Avail Capacity Mounted on /dev/disk1s2 1.8Ti 813Mi […]
Mac Terminal vi[m] Editor Commands
A text editor is an application that enables you to view, create, or modify the contents of text files. Text editors were originally created to write programs in source code, but are now used to edit a wide variety of text-based files. Various types of text editors are compatible with Linux. However, text editors do […]
How to Install dmg File on Mac from Command Line
Installing software is the most common way to customize your Mac so that it can perform the tasks you need. When downloading and installing software from the Internet, make sure that you trust the source to avoid infecting your computer with malware by mistake. Many applications are distributed as disk images, a compressed binary format. […]
getsebool Command in Linux
SELinux booleans allow you to change the SELinux policy at runtime without the need to write additional policies. This allows you to change the policy without the need for recompilation, such as allowing services to access NFS volumes. The setsebool command can be used to modify (switch on or off) the value of a SELinux […]
setsebool Command in Linux
SELinux booleans allow you to change the SELinux policy at runtime without the need to write additional policies. This allows you to change the policy without the need for recompilation, such as allowing services to access NFS volumes. The setsebool command can be used to modify (switch on or off) the value of a SELinux […]
mcopy Command in Linux
The mcopy command can be used to copy files between Unix and MS-DOS format partitions. The mtools package provides the mcopy command. The mtools package can help you when working with the DOS or Windows operating system while running Linux, and facilitate the transfer of information and manipulation of removable media for those operating systems. […]
mkfs.ext4 Command Examples in Linux
Ext4 is a native Linux filesystem, developed as the successor to ext3, and it was (and for some distributions still is) the default filesystem for many years. It offers stability, high capacity, reliability, and performance while requiring minimal maintenance. On top of that, you can resize (increase/decrease) the filesystem without a problem. The mkfs.ext4 command […]
PHP decbin function – Decimal to binary
The PHP function decbin() converts a decimal number into a string containing its binary representation. The largest decimal value that can be converted is 2147483647. If you have to deal with larger numbers, you need to write a custom function to handle the values. It takes just one parameter, which is the number to convert. […]
htaccess Cheatsheet
Here is a simple cheatsheet for the .htaccess file: Enable Directory Browsing Options +Indexes ## block a few types of files from showing IndexIgnore *.wmv *.mp4 *.avi Disable Directory Browsing Options All -Indexes Customize Error Messages ErrorDocument 403 /forbidden.html ErrorDocument 404 /notfound.html ErrorDocument 500 /servererror.html Get SSI working with HTML/SHTML AddType text/html .html AddType text/html […]