Deploying a template in Visual Studio

I had to use MS Visual Studio to work with Graphisoft’s Archicad API. The API kit installs a template in Visual Studio, though the references to the libraries and header files in the template have a relative path specially for the example projects that come with the kit. That required editing the path to the referenced files in the template in order to use it for projects stored in locations other than the Examples directory of the API kit.

The templates in Visual Studio are stored in the form of a ZIP file. Though the decompressed template can be customised by editing, duplicating the template with customisations is not as simple as unzipping the template, edit the files and re-zip as a new template to be available in Visual Studio. From what I gathered, Visual Studio 2017 onwards, the templates are not simply scanned for in their directories. They are instead required to ‘provide some “manifest” file storing the template’s location’ (Ref).

This is a compilation of the steps to generate a usable template in Visual Studio 2017 (community) using broadly gathered info, not describing the mechanism or the structure of the template.

An existing project-template can be found in %userprofile%/Documents/Visual Studio 2017/Templates/ProjectTemplates Duplicate the ZIP file of the template, extract and customise it. Re-compress it into a ZIP file.

(It seems some tags need to be defined in the <Template Data> section in the .vstemplate file, for compatibility with v2019. Ref.)

In order to deploy this customised template, a VSIX project template is needed. The VSIX project template becomes available in the New Project dialog box (search vsix) after installing the Visual Studio SDK. To install Visual Studio SDK, run the Visual Studio installer and install ‘Visual Studio extension development’ workload. Ref.

After the VSIX project template is available in the New Project dialog in Visual Studio:

  • Create a new VSIX project using the Visual C# VSIX template.
  • Right-click on the VSIX project in the Solution Explorer and select ‘Set as Startup Project’.
  • Browse the Solution Explorer for a source.extension.vsixmanifest file. Double-click to open it, and a form opens up.
  • In the ‘Assets’ section, select New. In the ‘Add New Asset’ dialog box, select Type as Microsoft.VisualStudio.ProjectTemplate and Source as ‘File on filesystem’. Browse and select the ZIP file of the template. The template ZIP file should now be listed in the Solution Explorer under ProjectTemplates.
  • Build the project for release version. Browse to the bin > Release directory of the VSIX project, and run the .vsix file that was generated to install the template.
  • The template should now be available in the New Project dialog box after restarting Visual Studio. Search for the template by the <Name> specified in <TemplateData> of the .vstemplate file.

Hope this helps someone. Share your thoughts / suggestions please. Thanks.

Change windows10 Alt+Tab navigation back to classic icons instead of thumbnails

In the registry editor, reach HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer.

Add a new DWORD key: AltTabSettings and change its value to 1.

Restart Explorer (Launch the Task Manager, find ‘Windows Explorer’ in the group ‘Windows processes’, right-click it and ‘restart’)

Now Alt+Tab should display only the application icons.

To revert back to the thumbnails, change the registry-key (AltTabSettings) value to 0.

Removing a directory from the git repository after adding it to .gitignore

If a directory was added to .gitignore before pushing to the repository, it does not get pushed. But if the directory was already pushed, and later added to .gitignore, then to remove it from the repository:

git rm -r --cached dirToIgnore
git commit -m 'Removing the gitignored dir'
git push

The directory dirToIgnore should now be removed from the git repository.

Fixing Apache localhost/~username resolve on macOS Mojave

Edit /etc/apache2/httpd.conf

sudo vi /etc/apache2/httpd.conf

Uncomment the following lines:

#LoadModule vhost_alias_module libexec/apache2/
#Include /private/etc/apache2/extra/httpd-vhosts.conf
#LoadModule userdir_module libexec/apache2/
#Include /private/etc/apache2/extra/httpd-userdir.conf

Uncomment the following in /private/etc/apache2/extra/httpd-userdir.conf :

#Include /private/etc/apache2/users/*.conf

Create the file /private/etc/apache2/users/yourUserName.conf if it doesn’t exist:

sudo vi /private/etc/apache2/users/yourUserName.conf

Add the following in this file:

<Directory "/Users/yourUserName/Sites/">
  Options Indexes MultiViews
  AllowOverride None
  Require all granted

For running PHP, uncomment the following line in /etc/apache2/httpd.conf . The version of PHP in the module name may vary as per the currently installed version (7 in this case):

#LoadModule php7_module libexec/apache2/

Restart Apache server:

sudo apachectl restart

The local webserver should now be available at http://localhost/~yourUserName/ , referring to the location ~/yourUserName/Sites/

using git to deploy on server

Install git on the remote server (if it is not already).

On Ubuntu:

sudo apt-get update
sudo apt-get install git

Create an SSH key pair (locally):

ssh-keygen -C ""

Accept the default file to save the key. If a passphrase is entered, it would have to be entered every time during ‘git push‘. The following two files would be created in ~/.ssh/ (public key)
id_rsa (identification)

Create an authorized_keys file (if it is not present) on the remote server in ~/.ssh/ for the SSH daemon to accept the key:

touch ~/.ssh/authorized_keys

Copy the local SSH ID/key to the remote server’s authorized_keys in ~/.ssh/ as:

ssh-copy-id user@remoteServerIP

It would prompt for the passphrase if it was entered while generating the key (using ssh-keygen).

Create a local git repository, in a project directory (say ~/project01) that needs to be uploaded to the server. Then create a file in it to test the git transfer later:

cd ~/project01
git init
echo 'testing deployment via git' > example.txt 

On the remote server, initialise a bare repository in a directory (say ~/project01.git):

mkdir ~/project01.git && cd ~/project01.git
git init --bare

Set up a post-receive hook for ~/project01.git on the remote server, to ‘checkout’ the git files into a remote project directory (say ~/project01, as the local):

mkdir ~/project01
nano ~/project01.git/hooks/post-receive

Enter the following script code in this post-receive file:

export GIT_WORK_TREE=/home/user/project01
git checkout -f master

Make post-receive executable:

chmod +x ~/project01.git/hooks/post-receive

Set up remote origin to the server (bare) repository, at the local end:

git remote add origin user@remoteServerIP:project01.git

Stage the content of the local repository and commit it:

cd ~/project01
git add example.txt
git commit -m "New sample file to test git transfer"

Push the sample file to the server, setting the remote as upstream:

git push --set-upstream origin master

The file should be available on the remote server at ~/project01 (created earlier).

Note: It is recommended against using git as a deployment tool, for reasons as it does not track permissions. Read here.


komorebi – sunlight filtering through the trees


木 – tree

漏れ – leakage

日 – sun


A text-based window manager for linux and terminal multiplexer; displays system info in the CLI, such as battery, hdd, thermal stats.

battery status on linux via CLI

acpi (battery stats – basic)

acpi -i (battery stats – more info)

acpi -V (battery & thermal stats)

sudo tlp-stat -b (battery info)

sudo tlp-stat -s (system info)

booting ubuntu in text mode

back-up grub:

sudo cp /etc/default/grub /etc/default/grub-orig

edit the following in /etc/default/grub:




update grub:

sudo update-grub

Set systemd target. The unit groups many daemons and starts services such as NetworkManager.service and activates another target unit named

sudo systemctl set-default

check default target:

systemctl get-default

The above command links to: /etc/systemd/system/

List all target units:

systemctl list-units --type target --all

To reset to graphical target:

sudo systemctl set-default 

hostname dns resolve

This is a collection of some commands to diagnose the DNS resolution problems, from OSX in a local network having linux and mac machines.

On linux, edit: /etc/avahi/avahi-daemon.conf to set ‘use-ipv6’ to ‘no’, so avahi resolves the hostname to ipv4 address. Not sure if this affects the DNS resolution from a mac, but I set it to ipv4 anyway.


Restart avahi-daemon on linux:

sudo systemctl restart avahi-daemon.service

Resolve mDNS/DNS hostname to IP address and vice-versa:

avahi-resolve-host-name onizu-asus.local

Scan for mDNS/DNS-SD services published on the local network:


on OSX, run the DNS Service Discovery tool:

dns-sd -E

The domain should be listed in the output of the above command. But for me it doesn’t list anything..

A system reboot works for me. The local hostname starts resolving on the mac. Not able to figure out why it stops working after a while..