Skip to main content

Posts

Python create simple function

Recent posts

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

Linux change hostname without rebooting

Changing hostname in Linux without rebooting, is quite straight forward. Changing the hostname will also change the name on the Terminal prompt, and will be displayed beside the current login user on the system. Open a terminal window and edit /etc/hostname. Use vi, nano or even echo command to change the content or value of the hostname file. Then type this: sysctl kernel.hostname=new-hostname-office.internal After typing the command, if the new hostname doesn't appear yet. Disconnect from SSH and login again via SSH and the new name will be displayed. That's it, simple as that. If unsure, try on a VM before applying to production. And check whether the desired output is the expected result. Cheers! Till next time. Do ASAP, Always Say A Prayer... Practice O.T.G. = Obedience To God Make time for Prayer and Meditation. Take time to kneel down and Pray! Practice F.IF.T.H (Firm In Faith Towards Heaven) Your attitude will depends your altitude, stay humble!

Check TLS settings in IE properties

 IE Properties or Internet Explorer properties still plays a part on Windows 10 or even Window 11. For example, some VPN settings like TLS or Transport Layer Security still checks on IE Properties. How to access Internet Explorer or IE properties? If IE is not yet blocked on the corporate environment or active directory network, then press windows key + r and type, iexplore on the run box. This will open Internet Explorer. A better way to do this without opening IE itself, is to use the Control Panel applet. Press windows key + r to open run box. And on the run box windows type, inetcpl.cpl and click ok or pres enter to run the command. This will open the IE or Internet Explorer properties and changes can be made. The other way is to check the Windows Registry, but a word of caution don't play or change the registry if you're not sure of what you're doing as this might lead to corrupting your Windows OS. Anyway, if you want to try or experiment on a Windows VM that can be