Skip to main content

Posts

Showing posts from May, 2023

Zip log files via script or cron job

Zipping log files to save disk space is quite a common task for system admin. Logs can be kept for a certain period of time depending on the company policy. To keep logs files and not delete them is quite a good strategy. If something goes wrong, you will be able to trace and go back in time, and check what went wrong. Zipping log files can be done manually, or via Bash or Shell script. If the folder has a standard pattern, which is quite ideal then creating a shell script to automate the zipping of log files will be easier. For example, if  the log files is on this path /mnt/log folder. And it has this pattern, YYYY-MM-DD. Creating a script to avoid manual task can be done easily. Depending on how busy the application is, log files can grow easily and may fill-up the disk quickly. If the log folder structure is based on Year, Month and Date. Then the shell script knows what pattern to look for and the task can be automated. Example Screenshot of the log folder structure: Below is a sc

Outlook keeps disconnecting and laptop no network or WiFi

Outlook is a very good tool, however if it gives some issues, it can ruin your day or your mood to work. Well, as the odds say nothing is perfect and even the flowers on the field that looks so beautiful will one day fade away. Same goes with our electronic devices, you just don’t know when it will go south. It might even give you issues when you needed it most to work properly, and sometimes that will be the time that it will not work as expected. Anyway, problems will always be there. The only question is, how will you face the issue or problem? For Outlook not responding and also the network or WiFi keeps disconnecting even though your phone or other devices or laptop has no issue to the network. It seems that the laptop has been singled out, and that’s the only device on the network that is not working. There are various approaches to solve this issue. Sometimes, it’s the same issue Outlook not responding or no network, but then different ways to resolve the problem. Yes,

Linux / WSL vi do save as or create password encryption

Vi / Vim is a powerful tool and for Linux enthusiast, this is a must tool to learn. Text file or basic editing in command line is quite important, to take notes, create a script, store text data or just anything that needs editing or creating via command line or terminal. How to create a text file in command line and put a password or encrypt the file? Text file is readable via lot of tools, cat, less, more, grep or any text editing files. One way to protect the file or its content is to encrypt the file. Screenshot below shows, how to create the file and encrypt it. Example: vi -x TestPasswordEncrypt.txt After entering the command, it will ask for an encryption key twice. And after entering the password, it will open the vi text editor, pressing "i" or the "insert" key then user can start entering text or typing on the vi window. After typing anything, press "esc" key and press :w (colon and w)  to save the file. If user need to save the file with a new f