[HOW TO] Please, commit your changes or stash them before you can switch branches.

In the morning, I pull git to deploy, and unlucky, this paragraph shows me:
Please, commit your changes or stash them before you can switch branches.

Ya I see, a long time ago, I changed one line on file. So it don't like the git repositories file. Next, I have to change/ recovery file on my local as git repositories file.


I see it commons sense. So somebody know the method to fix. Next, google.


In this article I show some cases:


1. You are right, and this change is not affect to teams. You can commit this change using

git commit -m "My message"

2. Stash it


Stashing acts as a stack, where you can push changes, and you pop them in reverse order.
git stash

Do the merge, and then pull the stash:
git stash pop

3. Discard local changes for a specific file
git reset --hard. 
or 
git checkout -t -f remote/branch

4. Discard local changes for a specific file
git checkout filename



Tiến Phan - R0039

Knowledge is Endless

Sharing for Success



[HOW TO] script automatically call skype

In the morning my boss calls me: Tien, why do you don't write script automatically call skype? I see the admin girl don't exactly run on time for it. So please write windows script.

Tien: ya I understand. It is easy to write.

Drop call...

In the afternoon, I go to office, and start to write the script.

Most often, admin girl runs skype to call hanoi's office by hand. She has a lot of works, so she looks like difficult to remember on time to run skype.

In other cases, skype should automatically run every morning is the better.
Depending on how to do, I see windows batch script is good choice. However, I don't familiar with windows batch script.

If you don't yet familiar with windows batch script, you should to learn on. So I google about windows batch script, structure, parameter ... And other important thing, I need to know that how to skype call specific people in contact list.

Google is the king of search based on internet . I have enough knowledge to write a short script.

Below I'will show you my script.

@echo off
::Author: Tien
::Date: 23/03/2017
::This batch file runs for skype call every morning
cd C:\Program\/Files\Skype\Phone\
start Skype.exe /callto:receiver_skype

Step 1: Open notepad, and paste above script.
Step 2: Please choose 

  • Save As ...
  • Save as type: All Files (*.*)
  • File name: skype.bat


If you're already here, you can write. You also can be write better than me.
You can use this script for production with windows 7 32bit. With windows 7 64bit, you have to change C:\Program\/Files to C:\Program\/Files(x86), please verify on your windows operating system.

Eventually, you must to add this script to Startup folder on windows to complete. How to do?

Next, you only copy skype.bat, and paste to Startup folder. (Start, pull down mouse to Startup, right click to Open) - (C:\Users\my-user\AppData\Roaming\Microsoft\Windows\StartMenu\Programs\Startup)

The end.




Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

[HOW TO] Validate haproxy.cfg

In the morning I change the haproxy.cfg, but I don't want to restart the haproxy. Because it can make incident for our infrastructure.

So I think I need to validate haproxy configuration file. Luckily haproxy always support that. 

Way is 
/usr/sbin/haproxy -c -V -f /etc/haproxy/haproxy.cfg

Configuration file is valid

Good to see. I hope this help you to check the syntax of haproxy.cfg before restarting haproxy service.

Thank you,


Tiến Phan - R0039

Knowledge is Endless

Sharing for Success