Skip to main content

Posts

Showing posts from June, 2026

Hide a file in Windows and set to read only

How to hide a file in Windows? How to set a read only file in Windows? Or set a read only file in Windows and hide it. Setting a file to read only or hiding a file in Windows, or doing both at the same time, can be done using Command Prompt or using PowerShell. Example commands: Hiding a file in Windows using PowerShell: (Get-Item "C:\file_example.txt").Attributes = 'Hidden' Setting a read-only file: (Get-Item "C:\file_example.txt").Attributes = 'ReadOnly' Set both read-only and hidden attributes to a file. (Get-Item "C:\file_example.txt").Attributes = 'Hidden, ReadOnly' How to reset the attributes or remove the attributes that was set? (Get-Item "C:\file_example.txt").Attributes = 'Normal' Hiding a file using command Prompt: c:\attrib +h "file_example.txt" Setting a read-only file: c:\attrib +h "file_example.txt" Set both read-only and hidden attributes to a file. c:\attrib +h +r "file_exa...

Bash script safely remove or delete files

Automation is a buzzword in today's technology; it makes things faster, effortless, and most of all ease the burden of system administrators. However, automation should be tested thoroughly to avoid any unforeseen circumstances or else instead of making life easier it might deliver some nightmares. For example, removing log files to save space or remove any unwanted or old log files to make room for new files; this task can be done manually or using some automation via a script. In Linux, cron jobs that fires automatically as per schedule is quite ideal to automate removing or deleting log files. This can also be done manually, by simply logging in to the server and delete files. There is nothing wrong in deleting manually but would not be ideal if the operation of the server is operating day and night.  There might be a chance that the operation will halt if there is no more room to write the log files. Or simply when there is some issue and wanted to troubleshoot; if log files ar...

Linux find up interfaces

If a Linux box VM, WSL or a physical server is unable to connect to Network, one possible issue is the network interface is not UP. Typing:   ip address show   Or:   ip a s  The output will show which interfaces are UP. If the output shows like:  eth0: <BROADCAST, MULTICAST, UP, LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 UP after multicast means that the interface is not disabled on the OS or administratively enabled LOWER_UP means that a cable is connected  and is able and is able to find an active switch port  Running this command below: tcpdump -D The output will also show that the interface is Up, Running and connected. Example: 1. eth0 [Up, Running, Connected] Basic commands that will help to save the day if ever there is some network or connectivity issues. That's it.. till next time. Stay close to Jesus, you will find comfort and amazing peace. All you need is to surrender wholeheartedly whatever you're going through.