Category Archives: Ubuntu

Configure Active Directory authentication with SQL Server on Linux

Microsoft just released the adutil in public preview which is a CLI based utility developed to ease the AD authentication configuration for both SQL Server on Linux and SQL Server Linux containers.

We don’t need to switch to a Windows machine to create the AD user for SQL Server and setting SPNs.

In the following steps I will try to install a SQL Server instance on Linux using just the Linux CLI tool adutil.

We will need 2 VMs:
  • tf-wincore01.lab.local – Domain Controller (DC) running on Windows Server 2019 Core (will
    host the lab.local domain)
  • tf-ubuntu01.lab.local – Ubuntu 18.04 LTS – SQL Server Instance on port 20001 will be
    installed here

I will be creating a brand new environment for this test and I am using Terraform to provision the VMs .

Prepare the Domain Controller

Once the VMs are created we need to configure the domain controller:

Let’s setup our zones:

Note that this AD configuration is just the bare minimum for our lab and it’s not fit for a Production environment!

Join the Linux host to the domain

It’s now time to join the Linux box to our new domain. The yaml file used by netplan needs to point to the domain:

Confirm the configuration and apply it.

In my case, the file looks like this:

/etc/resolv.conf file should also point to the domain:

Next, we install the packages that will allow us to join the machine to the domain:

Let’s also set the hostname:

We are now ready to join the machine to the domain:

This command:

  • creates a new computer account in AD
  • creates the /etc/krb5.keytab host keytab file
  • configures the domain in /etc/sssd/sssd.conf
  • updates /etc/krb5.conf

Let’s verify that we can now gather information about a user from the domain, and that we can acquire a Kerberos ticket as that user. The following example uses id, kinit, and klist commands for this.

Install adutil

We now need to install the adutil so we can interact with the Domain Controller directly from the Linux box.

Create a domain user using adutil

Let’s try to create a regular AD user:

At this point adutil cannot list the users, but we can check if an account exists in the AD

Install SQL Server instance on the Linux host

From this point on, I can proceed at installing the SQL Server instance on the Linux host:

Create an AD user for SQL Server and set the ServicePrincipalName (SPN) using adutil

SQL Server instance is running and let’s now create an AD user for SQL Server and set the ServicePrincipalName (SPN) using the adutil tool.

Test the connections and the authentication scheme

Let’s create an AD-based SQL Server login:

Connecting as a domain user from the Linux box:

Let’s verify the authentication scheme:

Conclusion

Our setup is now complete and we managed to perform all the required operations from a Linux machine. The same can be applied to provision SQL Server running on Linux containers. This also should apply if you’re running in the cloud.

Enable transmission-daemon logging to file

If you use transmission-daemon on your Raspberry Pi and want to have logs to a file, you can follow a few simple steps to accomplish this:

Edit the service file:

Change the ExecStart line to look like this:

You can choose between these options:

systemctl will complain that the service file was changed. Run:

to reload units.

Create the log file and assign the correct ownership and permissions:

Restart the service:

Have fun!

Add syntax color to crontab editor

You might be wondering why you don’t have syntax coloring when you are editing crontab entries.
This can be solved very simply by specifying your editor before starting crontab:

The change can be made persistent across the whole system if you add that line on the /etc/bashrc file.
You you only need this change for certain users only, add the line to their local ~/.bashrc files.

Set default gnome terminal size in Lucid Lynx

Use these commands to change the default gnome terminal size:

XMLStarlet: command line XML toolkit

XMLStarlet is a set of command line utilities (tools) which can be used to transform, query, validate, and edit XML documents and files using simple set of shell commands in similar way it is done for plain text files using UNIX grep, sed, awk, diff, patch, join, etc commands.

This set of command line utilities can be used by those who deal with many XML documents on UNIX shell command prompt as well as for automated XML processing with shell scripts.
Ubuntu allready has it in the repos, so issue the following command in your terminal to install it:

Vacuum your Firefox 3

This tip will hopefully speed up your Firefox 3 by optimizing it’s database.
Firefox stores your browsing data using SQLite – self contained, small footprint database.
Having database store your browsing data has one drawback, you have to optimize the database from time to time to get rid of old, deleted data, re-index the columns etc.
Otherwise you keep all the junk data mixed in with your real data.
In SQLite is the statement to do this called VACUUM. So here’s how to vacuum your Firefox:

1. Download sqlite command line client for your platform. In Ubuntu, go to yout terminal and issue the following command:

2. Turn off your Firefox
3. Go to your profile folder
4. Issue the command:
* For Linux

* For Windows

Enjoy!

Turn off or limit the Recent Documents feature in Ubuntu

If you want to turn off the Recent Documents feature in Ubuntu, all you have to do is create a .gtkrc file in your home directory.

Then add gtk-recent-files-max-age=0 to this file.

This is documented here.
This will also work in any other linux distribution running Gnome.
Enjoy!

Ubuntu One coming to Windows

At PyCon 2010, Ubuntu One development team will focus on helping Ubuntu users who also use a Windows box. This is great news!
Source.

Disable splash screen in Ubuntu 9.10 Karmic Koala

You can disable the splash screen and instead view details about your boot process by following the next steps:
1. Edit grub

2. Locate the following line

and remove quiet and splash.
After that, the line should look like this:

3. Save and exit.

4. Now update the grub:

That’s it!

Karmic Koala Beta on ThinkPad T61 (continued)

After the latest updates, enabling touchpad on/off key (fn-f8) is now working. There are some annoying gdm random restarts without a trace in the logs. I suspect it’s the nvidia proprietary driver and I hope it will be fixed soon.
Here is a better approach to enable the Active Protection System in your ThinkPad: