Sublime: “Open Git Repository” Hotkey

To open a Sublime Merge from a Sublime Text it is required to open a context menu with the right-click and select the “Open Git Repository”.

By default, there is no a keyboard shortcut to open the Sublime Merge quickly, that is not very handy.

This short note shows how to create a key binding that permits to “Open Git Repository” in the Sublime Merge using a hotkey.

Cool Tip: How to add a newline at the EOF on save in Sublime Text! Read more →

“Open Git Repository” in Sublime Merge using Hotkey

In the Sublime Text, go to the PreferencesKey Bindings and in the right panel specify a keyboard shortcut for the sublime_merge_open_repo command, for example:

[
    // Open Git Repository in Sublime Merge
    { "keys": ["ctrl+alt+z"], "command": "sublime_merge_open_repo"}
]

Save with Ctrl + S and close the window with the key binding settings.

Now you can simply press the Ctrl + Alt + Z in the Sublime Text to open the current project in the Sublime Merge.

Start Maximized | Minimized Program – CMD (Batch)

A START command is used to run a program or command in a separate window from a Windows command prompt (CMD).

The new window can be started as maximized or minimized, that can be controlled using the /MAX or /MIN switches correspondingly.

Below i will show how to start a program in the maximized or minimized window from the Windows command prompt (CMD) or a batch file. (more…)

Docker Compose: Pull Latest Image Version

The docker-compose up command doesn’t check a registry for a newer version of an image if it finds the image:latest among the locally cached images.

So after a while you may find, that despite of the :latest tag of the image in a docker-compose.yml file, the docker-compose up command doesn’t pull the latest version of this image even though it is available in the registry.

Below i will show how to force the docker-compose up command to pull the latest version of the images. (more…)

Windows: Migrate Domain User Profile To Local

If you are leaving a company and keep your corporate laptop, that is in a company’s AD domain (e.g. AzureAD), with you, you may wonder how to keep your user’s profile settings and data before removing it from the domain.

Unfortunately, by the moment, Microsoft doesn’t propose any official tool to migrate the domain user profile to the local one (at least i couldn’t find one).

Nevertheless, there is a tool called “User Profile Wizard”, created by ForensiT’s, that can be used to copy the domain user profile to the local one and in this article I will show you how to do this. (more…)

Kubernetes: Deployment Is Not Creating Pods

Imagine the situation, when you are starting a Deployment of some application on a Kubernetes cluster by running, for example, the kubectl create deployment command.

Then you execute the kubectl get pods command to list the Pods, but it returns “No resource found“, that means the Deployment hasn’t created any Pods.

Below i will show you how to start troubleshooting when the Deployment is not creating the Pods on a Kubernetes cluster. (more…)

Git Bash: Clear History

The history -cw command is used to clear a Bash history on Linux, but for some reason it doesn’t work for a Git Bash on Windows.

If you try to clear the commands history in the Git Bash using this command, it won’t work – you will still see the history of the executed commands after the application restart.

To completely erase the Git Bash history you need to locate and delete the .bash_history file and then run the history -c command. (more…)

Python: Sleep Random Time – Web Scraping

Some websites can block access to prevent web scraping, that can be easily detected if your Python script is sending multiple requests in a short period of time.

To not get banned you can try to add random delays between queries.

For this you can use the Python’s sleep() function that suspends (waits) execution of the current thread for a given number of seconds with the randint() function that returns a random integer. (more…)