Skip to main content

Posts

How to run a command after x minutes

Recent posts

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

Check Time zone in Linux and windows machines

In Linux, open a terminal window and type the following command: timedatectl | grep "Time zone" In Windows, open a command promot and type the following command: tzutil /g To set a new timezone in Windows, open an elevated command prompt. Check out this link to set a new Time zone: https://quickbytesstuff.blogspot.com/2014/08/view-and-set-time-zone-via-command-line.html Checking Time Zone will clear up things, if the machine timing is properly sync or not. Or why machine is having a different time with the current location. Stay safe! and Keep things up! Another year is coming! Do ASAP,  A lways  S ay  A   P rayer ... Practice O.T.G. =  O bedience  T o  G od Make time for Prayer and Meditation. Take time to kneel down and Pray! Practice F.IF.T.H (Firm In Faith Towards Heaven)

Basic Ansible understanding when statement

Ansible playbook to illustrate how "when" conditional statement works in Ansible. Ansible playbook below will run a command: "file -s /dev/sdb"  The output of the command will be saved to the variable: save_the_command_output  Yes, the name of the variable can be anything. Just changed it to something that is sensible. save_the_command_output is just a string to illustrate its functionality or usage. After registering or saving the output to a variable, another command will be executed provided the conditional statement "when" is True or the condition is meet or satified. If the conditional statement is not meet then the command will be bypass or will not be executed. On this illustration below, if the conditional statement has been meet. Then a file with a filename "condition_ok" will be written on /tmp directory. Otherwise, if the condition is not meet then no file will be created. Sample playbook below: #=================== --- -  hosts: local

Python Basics - creating virtual environment and activating

 Creating virtual environment in Python is quite important thing to know if you are venturing to the world of Python Programming. Virtual Environment in Python may sound complicated at first if you haven't played around it. Let's delve into it. Why do we need a virtual environment? When we can just installed Python directly to the system. One good thing for creating Python virtual environment, is you can have multiple environments on Python on your system and also different versions. If 2 or 3 people are using the same server or computer, it won't be ideal that each person will use same environment and mess up the work of the other person. And also if your coding is good for a specific version of Python, the syntax may not work on new versions of Python and this is where virtual environment comes into the scenario. How do we create a virtual environment in Python? It's quite straight forward, here's the command. Of course this assumes that Python has been installed

Ansible comment all existing lines and add new lines

Backing up every configuration before any change is a good idea.  With the Git tool, every revision or change can be keep track and changes can be reversed. However, not everything is in Git. For example, in Linux configuration on /etc configuration or other important location or files is not under Git. To keep track of the changes, old school method can still be applied. Making another copy of the file, or just simply commenting every line and adding changes or new configuration after commenting the existing lines or configuration; are forms of backup. Existing configuration can still be seen, and can put back if there's a need to reverse the configuration. In an environment where there is hundred or more virtualized machines, Ansible is a way to go.  Ansible can do the task to comment all the existing lines and apply new configurations. Ansible script below, are references from multiple sources found on the web to create this Ansible script below. Here's the Ansible, save it