19 Nov 2020

Windows Terminal Shortcuts Address

收藏到CSDN网摘

Windows Terminal is a nice and morden tabbed console open-sourced by Microsoft in 2019. What I like most is the capability that I can combine all my shells in one window like cmd, powershell, git bash, and WSL ubuntu shell. For my day to day work, I used Double Commander (DC) for file managedment. It's very easy to add extra shortcuts on DC's toolbar. Unfortunately, the link will lost its targets every time I upgrade my Windows Terminal. Interestingly, the shortcut I pinned to my taskbar worked all the time. Sound strange? Yes, it is!

Sudo apt update Failure

收藏到CSDN网摘

Deppin is an amzingly polished Linux distro built upon Debian. It now evolves to v20. Interestingly, there's a tiny bug than prevents it from updating itself. However, there's a quick fix for that.

21 Sept 2020

Create automatically updated daily archive using 7-zip and batch

收藏到CSDN网摘

Since lockdown started, I switched to a laptop for my daily work and lost the directly connections to our secured network drive. Although we have alternative secured online space for file transferring, packing and uploading those files frequently is a dumb thing to do from time to time. By adding those tasks to a batch file and pressing the green button seem more sensiable to do then. In this post, a batch script that utilises the free opensource archive file software 7-zip has been shared. Moreover, it will use the current date to name the archive file automatically. Here we go!

8 Sept 2020

Visual Studio Kept on rebuilding all projects without modifying anything

收藏到CSDN网摘

I noticed vs2013 started to rebuild all my projects and their dependencies even without any code change. Interestingly, the exact same project won't be compiled on Debug mode, which suggests some differences in the settings. By changing the Tools - Options, select Projects and Solutions - Build and Run, then set "MSBuild project build output verbosity" to Diagnostic. This will output the reason for building a project. I found that VS is looking for missing vc120.pdb, which was generated in Debug mode but not in Release. So the cure is very easy after pinning the nails down.

2 Sept 2020

Change the Default profile while starting Microsoft Chromium Edge Browser

收藏到CSDN网摘

While the MS makes their Chromium based Edge browser better and better, the profile manager helps the users to manage their working account and personal account. It's also helpful to set which profile will be used to open links redirected from third-party applications. However, to decide which profile to be used to start Edge by default. some command line option need to be added as following:

26 Jun 2020

Open Multiple Application via Batch in Win10

收藏到CSDN网摘

Before this COVID-19 thing happened, the desktop sitting on my desk runs for ever. I usally run some expensive jobs over night and came back to check the results in the next morning. Nowaways, the PCs are very different from the old days machines that require a regular restart from time to time. However, while working on a laptop since the lockdown started it's impossible to keep the laptop running all the time. So I have to start all the applications at the beginning of my working days and close them in the afternoon. If your work is to surf the internet and gather data, it's absolutely fine to click one button and job's done. But if your work relates to multiple applications, it is a bit annoying. I need to find a way of doing that automatically. There are some nice software that you can rely on (someone recommends AutoHotKey although I didn't try it). I'd like to do it lightweightly, say using batch file (in command line). Here we go!

16 Jun 2020

Get Current Date and Time in Batch

收藏到CSDN网摘
From time to time, we may need to get the current date and time in batch to automate some tasks. For instance, I am modifying the compiled programme names using the current date, which is easy to archive and search in the future. There are such DOS commands exist such as Date and Time, which you can use to retrieve or set the current date and time respectively. However, we may like to get all this information in one go and manipulate it as required. If you're on Windows like me, the Windows Management Instrumentation (WMI) Command line tool (WMIC.exe) could be used for this purpose. The following batch shows how to get the date and time information and use them as variables in the batch.

27 Apr 2020

Add Share Folder in VirtualBox

收藏到CSDN网摘
I have used VirtualBox for trying out linux client on my Win10 laptop. Sometimes, I do need share files between the host and client OS. The option looks straightforward. But it doesn't work like that. Here is the detailed steps.

3 Apr 2020

C++ Tips: Get All System Environment Variables

收藏到CSDN网摘

It's very common that you might need to get/edit/delete a system environment variable from time to time. In one of my previous post, I shared two functions that could get a system environment variable by its name or get all system environment variables in a map<string,string>. However, the function didn't return ALL variables if you checked here as shown in the screenshot.




In this post, I made another function that can obtain all system environment variables from the list.

C++ Tips: Grab Current Username and Datetime using C++

收藏到CSDN网摘
From time to time, the current username and datetime need to be obtained in code for either saving system logs or debugging the code. If you are working in Windows like me, there are two functions available to do this. The first is GetUserName() in WinBase.h and the other is localtime() (and strftime() for formatting) in time.h (or  ). All you need to do is to include them in your header and call those functions when needed.

Here we go!

26 Feb 2020

Run Jupyter Notebook with Double-click

收藏到CSDN网摘
Jupyter notebook enables writing code with instructions in the same file, which is very convenient for preparing teaching materials. However, by using the default installation on Windows it requires typing commands in command window to start the server first.

To enable double-clicking opening on .ipynb files, the following command can be run using administrator privileges: