Zhixian's Tech Blog

2019-08-18

Adventures in Kali Linux (Xfce)

Filed under: computing — Tags: , , , — Zhixian @ 09:06:08 am

I recently have the inclination to try using Kali Linux as my development Linux OS of choice. This blog post is not so much as instructional blog post, but rather my journal on what I did after I installed Kali Linux. Some might question why use Kali Linux, well…its something to try. Its a learning experience in some ways. Anyways, here goes.

  1. Setup bluetooth

By default, it seems that Kali Linux does not have any bluetooth managers installed. So I chose to install blueman a fairly popular bluetooth manager. Commands that I used:

apt search blueman
apt-get install blueman
service bluetooth status
service bluetooth start
service bluetooth status

The service bluetooth status statements are just to check that bluetooth is working after I started the service.

  1. Create a normal user with sudo rights

I suddenly remember that I was logged on to the root account that has super-powers! So I hurriedly create a normal user account with sudo rights instead:

useradd -m zhixian
passwd zhixian
usermod -a -G sudo zhixian
chsh -s /bin/bash zhixian

  1. Install Chrome

To install Chrome, I went to the Chrome website and download the respective DEB file and install it by running:

apt-get install ./google-chrome-stable_current_amd64.deb

Then I remember, I should probably stop using the root account. Since I already have my user account setup. So I logged out to proceed with the rest of my Kali Linux installation. Actually, at this point I was feeling sleepy, so I put the system to Hibernate and went for a nap… 🙂

…(an hour later)

Only to wake up to find out that Kali Linux did not hibernate my laptop properly! Arghhh!
More specifically, it manages to save the session state and all but it did not power off the laptop. And what’s worse is that it seems to be doing some weird operation that kept my laptop heatup. Not sure what went wrong. Still haven’t gotten this fixed. Suspend and shutdown works well though. So I guess I will just have to live without hibernation for now.

  1. Enable blueman as a service

After I restarted Kali, I realise my bluetooth is not running on startup. So I ran:

sudo systemctl enable bluetooth

After leaving my Kali Linux alone for a week. I came back to it.
And found that I cannot surf Internet on it as the date-time on the machine is not accurate. As it turns out, NTP is not installed by default (so no automatic date-time synchronization). So I installed a NTP service and set it to start on startup.

sudo apt-get install ntp
sudo systemctl restart ntp
sudo systemctl enable ntp

Then I decide that I might want to use Gimp for image editing:

sudo apt-get install gimp

I toy around the idea of install Darktable as well but decide to hold off installing stuff that I’m not using immediately. Hence, all the drawing software like Inkscape, Dia, Krita are not installed as well (for now).

I then thought of checking if I have the common git UI tools, gitk and git-gui.
Nope, gitk does not exists. So:

sudo apt-get install gitk

Then I test git-gui.  Cool! Its installed now.
But I note that the command-line to activate it is slightly different compared to other platforms. On other platforms, the command to invoke git-gui is unsurprisingly “git-gui”.
But oddly on Linux, the command is “git gui” (without the dash”.
So to be consistent, I add an alias for this in my “.bash_aliases” file.

Some of you might be wondering, “Urgh! Why are you using gitk and git-gui? Surely there are better tools around? Heard of this product Sourcetree? Or maybe Kraken?”
LOL! True! I know these tools exists. I used to think the way too.

However, as I get more familiar with these 2 tools, I find that they meet my most of needs. True, other tools have additional helpful functions. But I think if you are using git right, you won’t be needing those “helpful” functions. Another reason to get familiar with gitk and git-gui is that they are not only free but are also widely available across platforms. It exists by default in the Windows / Mac OS distributions of git (I think). Which means you do not need to re-learn tools.

As a aside, tools are great! But sometimes, I do feel overwhelmed with learning all the different tools out there. Especially if they do not really contribute to me being more productive.

Let’s see. What else do I need to install. Oh! I might want to type Chinese occasionally. So I installed fcitx and google-pinyin keyboard:

sudo apt-get install fcitx
sudo apt-get install fcitx-googlepinyin

Then I decide I want to re-look at using Thunderbird. So:

sudo apt-get install thunderbird

Not sure, if I want to use a dedicate mail client (Thunderbird), so hold off the decision for now.

Then I went to install engrampa, a UI frontend for manage archives like zip files because there isn’t one installed by default. Initially, I wanted to install xarchiver as I read somewhere that xarchiver is the de factor file archiver manager for Xfce. But after trying it out, I find that engrampa provides a better user experience. So:

sudo apt-get install engrampa

Then I recall that I want to install telegram as well. Unfortunately, there’s no convenient apt package. Instead, I’ve to download the binaries off their website. Installation is simply unzipping the archive and placing the contents in a convenient location and adding shortcuts for easy access.

Now what’s left seems to be installing my various software development stuff.

 

Advertisements

2019-01-12

Installing PowerShell Core

Filed under: computing, software, windows — Tags: , , , — Zhixian @ 23:42:01 pm

This blog post is a reminder to myself on the installation process for PowerShell Core.

What is PowerShell Core?

PowerShell Core is a version of PowerShell based on .NET Core.
The idea is to bring PowerShell across to platforms other than Windows (for example Linux, and macOS).

Images of PowerShell Core Installation (for Windows)

The installer for PowerShell Core can be found at https://github.com/PowerShell/PowerShell.

If you browse to this page, you’ll see the Windows Installer somewhere on the middle of the page.

image

After you clicked on the link, an installation file should be downloaded to your computer.
After the file has finish downloading, you should see the downloaded file which is named something like “PowerShell-<version>-<platform>.msi”.

image

Double-clicking the file will start the installation process.
After the installation process startup, you will see a screen like the below.
Click on the “Next” button to proceed with the installation process.

image

After you clicked on the next button, you will come to the “End-User License Agreement” dialog.
Checked on the “I accept the terms in the License Agreement” checkbox.
Click on the “Next” button to proceed with the next step of the installation process.

image

After you clicked on the “Next” button, you will see the “Destination Folder” dialog.
You can choose to change the installation location of the PowerShell Core, if you would like to install it to a location other than its default (which is “C:\Program Files\PowerShell\”).
After you set the location, clicked on the “Next” button to proceed with the next step of the installation process.

image

After you clicked on the next button, you will see the “Optional Actions” dialog.

Accept the default checked items, and clicked on the “Next” button to proceed.

image

After you clicked on the next button, you are finally ready to install PowerShell Core.
Click on the “Install” button to proceed with the installation.

image

After you clicked on the install button, the installation process will install PowerShell Core.

image

After the installation is complete, you will see a screen like the below.
Click on the “Finish” button to complete the installation process.

image

After closing the installation dialog, you can run PowerShell from Windows Start Menu by clicking on the item labeled “PowerShell 6 (x64)”.

image

This is bring up the PowerShell Core command-line shell.
Type “$PSVersionTable” on the command-line to see the version of the PowerShell that you are running.

Things to note are PSVersion and PSEdition.
PSEdition should read “Core” and PSVersion should report the version of PowerShell Core that you are running.

image

At this point, if you see a screen like the above, it means you have a running copy of PowerShell Core.

2018-12-08

Install .NET Core 2.2 on Ubuntu 18.04

Filed under: computing, ubuntu, Uncategorized — Tags: , , — Zhixian @ 09:40:12 am

About

This is a note to self about installing the .NET Core SDK 2.2 on Ubuntu (because the instructions on Microsoft website does not work / is incomplete).

Scenario

When the .NET Core 2.2 SDK release was announced, I was keen to install it on my Ubuntu machine. So I went to their web site (https://dotnet.microsoft.com/download/linux-package-manager/ubuntu18-04/sdk-2.2.100) and and followed their instructions there.

The instructions are:

  1. Register Microsoft feed
  2. Install the .NET SDK

Which means executing the following commands at your command-line prompt:

wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo add-apt-repository universe
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-2.2

Unfortunately, despite following the instructions, you may find that you still could not install the latest .NET Core SDK as the package could not be found when you execute the last command! 😦

Solution

To fix this issue, you need to add Microsoft’s repository:

sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-get update

After update, you should be able install .NET Core 2.2 SDK by running the following command again.

sudo apt-get install dotnet-sdk-2.2

2015-10-23

Setup Ubuntu (Trusty Tahr) for development

Filed under: development, ubuntu — Tags: , , , , — Zhixian @ 11:18:10 am

This blog post is on my setting up another Ubuntu Server VM.
This time I want a VM that has the common software development applications pre-installed.
As such most of the steps are similar to what I did in a previous blog post.
So on this blog post, I will start from the screen where I can select pre-packaged software.

image

Although, I was not really sure I really need the DNS server and print server, I thought “Ah well. Might as well.”
So they are included.

Setup MySql

First thing to setup is to assign a password for MySql server “root” account.
Note: You may have notice that background color have changed from purple to blue.
This was because I typed the wrong confirmation password when setting the password.

image

 

image

Setup E-mail

 

image

 

image

 

image

 

image

2015-01-05

Install nunit on Ubuntu

Filed under: computing — Tags: , , — Zhixian @ 23:34:01 pm

To install nunit on Ubuntu, start a terminal session and execute the following command:

sudo apt-get install nunit nunit-console nunit-gui

zhixian@SARA: ~_200

After installation has complete, you can run nunit by executing the following command in the terminal session:

nunit-gui

for the user-friendly graphical interface or alternatively,

nunit-console

for the nunit console.

2015-01-04

How to install xsp4 onto Ubuntu

Filed under: computing — Tags: , , — Zhixian @ 09:14:01 am

I just realise that the mono-complete does not include the xsp4 package.
This package is needed if you intend to debug web applications using MonoDevelop.

sudo apt-get install mono-xsp4

zhixian@SARA: ~_196

After the installation process has complete, you may see a message stating that you have an incomplete debian.webapp.

zhixian@SARA: ~_199

To remedy this, install asp.net-examples by running the below command:

sudo apt-get install asp.net-examples

zhixian@SARA: ~_198

2015-01-03

Installing Postgresql using installer from EnterpriseDB on Ubuntu

Filed under: computing — Tags: , , , , , , , — Zhixian @ 17:23:01 pm

This blog post describes installing Postgresql 9.4 and pgAdmin III 1.20.0 using the installer provided by EnterpriseDB.

Background (Or lessons learnt)

I recently installed a copy of Postgresql on Ubuntu based on instructions from the official web site (http://www.postgresql.org/download/linux/ubuntu/).
Unfortunately, the copy of pgAdmin III (a graphical UI to manage Postgresql databases) is outdated.
The version of Postgresql installed was 9.4 but the version of pgAdmin installed was 1.18.1 which has warnings issued when I connect to the database.

pgAdmin III_168

So I decide to do the next best thing mentioned in the page – use the installer from EnterpriseDB in hopes that they have packaged the latest copy of pgAdmin III.

PostgreSQL: Linux downloads (Ubuntu) - Google Chrome_171

Assumptions

I assumed you know how to start a terminal session and execute commands in it.

Summary of Steps

  1. Download Installer
  2. Making Installer executable
  3. Execute the Installer

Download Installer

Clicking the download link in the previous screen shot will bring me to the EnterpriseDB’s Postgresql install download page (http://www.enterprisedb.com/products-services-training/pgdownload).

Because I’m running the 64-bit version of Ubuntu, I clicked on the “Linux x86-64” button to download the installer.

Download PostgreSQL | EnterpriseDB - Google Chrome_172

After you clicked the button, you will be brought to a thank-you page.
Wait for the download to complete.

Thank you for downloading PostgreSQL! | EnterpriseDB - Google Chrome_173

After the download has complete, your download folder should look like the below.

Downloads_174

Making Installer executable

By default, the downloaded file is not executable by double-clicking it.
Attempts to do so, will result in the below dialog:

Untitled window_175

Click on the No button to close the dialog.

To make the downloaded file executable:

1. Start a terminal session and navigate to folder where you saved the downloaded installer.

zhixian@SARA: ~-Downloads_176

2. Run the following command. Replace the text in bold if necessary if you are not using Ubuntu 64-bit.

chmod +x ./postgresql-9.4.0-1-linux-x64.run

zhixian@SARA: ~-Downloads_177

Execute the installer

Now you can execute the installer. From the terminal session, run the following command start the installation wizard:

sudo ./postgresql-9.4.0-1-linux-x64.run

zhixian@SARA: ~-Downloads_180

You will see the welcome screen of the installation wizard.
Click on Next button to proceed to the next step of the installation wizard.

Setup (as superuser)_181

The installation wizard should prompt you for the location to install Postgresql.
Click on Next button to accept the default and proceed to the next step of the installation wizard.

Setup (as superuser)_182

The installation wizard will now prompt you for the directory to store data for Postgresql.
Click on Next button to accept the default and proceed to the next step of the installation wizard.

Setup (as superuser)_183

The installation wizard will now prompt you for a password to the postgres account.
This account is use for starting Postgresql.
Enter your desired password for this account.
Click on Next button to accept the default and proceed to the next step of the installation wizard.

Setup (as superuser)_184

The installation process will then prompt you for a port number that Postgresql will use to host the database server.
Click on Next button to accept the default and proceed to the next step of the installation wizard.

Note The default port that Postgresql use is 5432. However, this port is all in used by the first instance of Postgresql that I installed previously the installation wizard picked the next available port 5433. I accepted the defaults in the screen shot below planning to uninstall the first instance of Postgres and then reconfigure this instance of Postgresql to use port 5432.

Setup (as superuser)_185

The installation wizard will now prompt you for the locale that your database will use.
Click on Next button to accept the default and proceed to the next step of the installation wizard.

Setup (as superuser)_186

The installation will now declare that it has all the information need to install Postgresql.
Click on Next button to accept the default and proceed with installing Postgresql.

Setup (as superuser)_187

The installation wizard will start to install Postgresql.
Wait for the installation process to complete.

Setup (as superuser)_188

After the installation process has complete, you will see the below screen.
Click on Finish button to exit the installer.

Note If you not need to download and install additional software, uncheck the option to start Stack Builder at exit.

Setup (as superuser)_189

After you exit the installation wizard, you should be able to see the Postgresql that you just installed from the desktop menu.

Workspace 1_195

Note If you do not see the menu item, you may need to re-login or restart your system.

The pgadmin installed should be version 1.20 and should work fine with Postgresql 9.4.

2014-12-31

How to Install Postgresql onto Ubuntu (Trusty Tahr)

Filed under: computing — Tags: , , , , , — Zhixian @ 00:08:12 am

This blog post describes how I install Postgresql 9.4 onto Ubuntu.

You may want to following this blog post, Installing Postgresql using installer from EnterpriseDB on Ubuntu instead.
The below blog post will install latest version of Postgresql at this time of writing (version 9.4).
Unfortunately, the graphical interface tool installed pgAdmin III that is installed with this set of instructions uses an older version of pgAdmin III (version 1.18.1 at this time of writing).
This version does not support Postgresql 9.4.

Summary

  1. Create Repository List File
  2. Import Signing Key
  3. Update apt-get
  4. Install Postgresql
  5. Install Additional Modules

Create Repository List File

Create the repository list file using the following command:

echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list

zhixian@SARA: ~_161

Import Signing Key

Import signing key for Postgresql by running the following command:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

zhixian@SARA: ~_162

Update apt-get

Run the following command to update your apt-get.

sudo apt-get update

zhixian@SARA: ~_163

Install Postgresql

Run the following command:

sudo apt-get install postgresql-9.4

zhixian@SARA: ~_164

Install Additional Modules

The installation above is quite bare-bones. It does not provide a graphical tool or development libraries.
To add them, run the following command:

sudo apt-get install postgresql-contrib-9.4 pgadmin3 libpq-dev postgresql-server-dev-9.4

postgresql-contrib-9.4 – additional supplied modules
libpq-dev – libraries and headers for C language frontend development
postgresql-server-dev-9.4 – libraries and headers for C language backend development
pgadmin3 – pgAdmin III graphical administration utility

zhixian@SARA: ~_165

After installation have complete, you can find the graphical tool under Applications > Programming > pgAdmin III from the desktop menu.

Workspace 1_166

Reference

Linux downloads (Ubuntu) (http://www.postgresql.org/download/linux/ubuntu/)

2014-12-30

How to install MonoDevelop on Ubuntu

Filed under: computing — Tags: , , — Zhixian @ 23:33:12 pm

This blog post describes how I install MonoDevelop onto Ubuntu.

Summary

  1. Add Mono Project Signing Key
  2. Add Package Repository
  3. Install MonoDevelop
  4. Reference

Add Mono Project Signing Key

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

zhixian@SARA: ~_156

Add Package Repository

echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

zhixian@SARA: ~_157

Install MonoDevelop

sudo apt-get install monodevelop

zhixian@SARA: ~_158

After installation have complete, you should be able to find MonoDevelop under Applications > Programming > MonoDevelop from the desktop menu.

Workspace 1_160

Reference

Install MonoDevelop on Linux (http://www.monodevelop.com/download/linux/)

2014-12-28

How to install Mono on Ubuntu

Filed under: web application development — Tags: , , , , , — Zhixian @ 01:29:12 am

This blog post describes my installation steps to get Mono running on my Ubuntu.

I will write another blog post on testing this installation.

Assumptions

  1. You have Apache HTTP Server installed
  2. You know how to start a terminal session and run commands there.

Summary

  1. Add Mono Project GPG signing key
  2. Add Mono Package Repository
  3. Add mod_mono Repository
  4. Update package cache
  5. Install Mono
  6. Install mod_mono
  7. Enable mod_mono
  8. Reference

Mono Project GPG signing key

This step adds the GPG signing key to your key-ring.
This signing key is used to make sure the installed files are valid.
To add the key to your key ring, start a terminal session and run the following command:

sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

zhixian@SARA: ~_120

Add Mono Package Repository

This step add the Mono package repository into apt-get list of available package repositories.
Enter the following command at the command-line of the terminal session:

echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

zhixian@SARA: ~_121

Add mod_mono Repository

This step adds the repository for mod_mono to apt-get list of available package repositories.
mod_mono is use by Apache HTTP server to interpret .NET web pages.
To add the repository, run the following command at the command-line:

echo “deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main” | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list

zhixian@SARA: ~_124

Update package cache

To update the apt-get package cache to use the repositories that you just added, run the following command at the command-line:

apt-get update

zhixian@SARA: ~_125

Install Mono

To install the complete Mono package enter the following at the command-line:

sudo apt-get install mono-complete

zhixian@SARA: ~_126

After the initial listing of the packages that will be installed, you will be given a prompt asking if you would like to proceed install Mono. Enter “Y” to proceed with the installation process.

zhixian@SARA: ~_127

zhixian@SARA: ~_128

Install mod_mono

Run the following command to add mod_mono:

sudo apt-get install libapache2-mod-mono

zhixian@SARA: ~_129

You might see an error exit status at the end of the installation process.
This is due to some configuration issue in the installation process.
I’m not too sure what exactly is the issue but it seems fine to ignore it.

zhixian@SARA: ~_131

Enable mod_mono

mod_mono is enabled by running the following command:

sudo a2enmod mod_mono

zhixian@SARA: ~_133

Reference

http://www.mono-project.com/docs/getting-started/install/linux/

https://help.ubuntu.com/community/ModMono

Older Posts »

Create a free website or blog at WordPress.com.