Skip to main content

Posts

Check Chrony logs on.Linux

Recent posts

Linux clear logs or big files

To easily clear a log file or empty a big file. Type this on a terminal,.make sure to zip or backup the file if you feel you might need it later. > MyBigLog_file.txt Yes, just type greater than sign,.followed by the filename of a log file or any file. Don't do this in Production if not sure of the consequences. If the file exists it will empty the file, if the file doesn't exist it will create the file. Test it on a VM, to see what it really does before rolling out to production. Cheers,. enjoy Linux and command line. Be still and know God is in control!

Python create simple function

Basic function in Python. def multiply(x,y):   return x*y x=2 y=5 z=multiply(x,y) print("Product is: ", z) print(x, " * " , y ," is equals to = ", z) Sample output: That's it, a simple and basic functin in Python! Keep your feet on the ground! and kneel down to pray! Prayer is the ultimate connection to the creator.

How to trim leading and trailing spaces

How to trailing spaces, leading space or both on a CSV file or any text file? Notepad++ can easily do this task without any fuss. Can be done easily in 3 clicks, provided you have Notepad++ installed on your system. Notepad++ can easily be downloaded just search Notepad++ on your favorite search engine. Or try visiting this link: https://notepad-plus-plus.org/downloads/v8.6.7/ If your file that needs to be trimmed with leading or trailing spaces or both is on CSV or in a text file format, just export it or copy to Notepad++. For the sake of clarity and for anyone of what's trailing or leading space means. Leading spaces, are the spaces that are inserted at the front of any string. Since spaces are typically not shown on any editor, unless some settings are set to on the editor to show the spaces.So, leading spaces may appear like its not align to the left or beginning of any editor. While trailing spaces, appear at the end of the string. One way to check if the string has

Linux VM always disconnected after a few seconds or minutes

VM on VMware or vSphere always got disconnected after a few seconds or minutes. CentOS or RHEL VM cannot be accessed via SSH and unable to activate or make the Interface UP. Typing: ip link show nmcli dev status nmcli gen staus Shows that VM interface is not yet UP. Typing: ip link set ens192 up Will bring the interface UP but still SSH is not working and not able to reach the VM. Typing: nmcli con up ens192 Shows "STATE" connecting but will never shows "connected". Restarting the VM and creating new interface will not help either. Typing: nmtui (network manager text user interface) It shows that the interface has been assigned with correct IP Address, DNS and Gateway But the VM still not available on the network and SSH cannot access to the VM. Well the solution, might just be an overlooked by configuring so fast the VM that a simple option was not carefully set. If the VM was set with IP Address, DNS and Gateway manually, however,

How to get assigned ESXi license on vCenter

There are few ways to get the assigned license to a host on vCenter, it could be done via ESXi Shell, PowerCLI, or via License Administration. However, it can be also done via Host Inventory option. Click "Inventory" option and select the host in which you want to check or verify on what is the License Key assigned to the particular host. After selecting or clicking the host, go to the "Configure" tab option. Click and expand the "System" drop down menu and click "licensing", then the license key details that has been assigned or applied to the host will be shown on the right pane on the same window. The "License" will be the name that was assigned to the License Key like, "License for Server1", or "Nginx Host License Key" it can be any name that was created by the administrator, descriptive name that can easily identify the server or host is much better. And the "License Key" is the details of

How to run a command after x minutes

In Linux command below will trigger an rm commands after 5 minutes. echo "sleep 5m && rm -f /var/www/html/products.html" | at now In Windows the command below will also trigger a copy command after 5 minutes. Start-Job -ScriptBlock { copy /html/update.html /shared/} -ArgumentList (New-TimeSpan -Minutes 5)

Windows delete recent items history

How to delete "recent windows items" or the links of the files you've open in Windows 10 or Windows 11? Here are the locations that will delete the windows recent items. Please test on a VM or any test device before applying to the actual computer or device. Make sure the output is what is expected. Open a command prompt and change directory to this locations: cd "%APPDATA%\Microsoft\Windows\Recent Items" <<< This might work on earlier version of Windows cd %APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations <<< Works fine on Windows 11 and 10 cd %APPDATA%\Microsoft\Windows\Recent\CustomDestinations <<< Works fine on Windows 11 and 10 Yes, please test on a Virtual Machine before applying to a production laptop or computer. Cheers! Till next time. Do ASAP, Always Say A Prayer... Practice O.T.G. = Obedience To God Make time for Prayer and Meditatio