Linux Mint: easy way to fix bootloader (grub) after windows installation

Today I had an issue with grub after I installed windows on my laptop in addition to Linux.
And I found a really easy way to fix grub after that.
Here it is:

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && (boot-repair &)

That’s it!

fstab options for ntfs partitions in Linux Mint

I gor errors while tried to mount ntfs partitions in linux mint.
So I checked fstab and fixed things.

This is output from fstab:

# /windows was on /dev/sda3 during installation
UUID=B86E55A46E555C66 /media/windows ntfs   defaults,nls=utf8,umask=000,uid=1000

Continue reading

Quick hint: analyzing mysql general query log

I had a long running transaction and general log enabled.
So I wanted to check which queries caused transaction to be running for a long time.

If you have thread id for a long running transaction:
(you can get it from “mysql> show engine innodb status;” or pt-deadlock-logger in case of deadlock)
then you can grep log by thread id and then use pt-query-digest and analyze log

sudo grep -i " <thread id> " <genera-log-filename> > somefile.txt
sudo pt-query-digest --type genlog  somefile.txt

How to change hostname in Linux Mint

Recently I changed hostname in my Linux Mint desktop and then I got the error each I tried to run something with “sudo”, for example:

$ sudo sed -i 's/maya/nadia/g' /etc/apt/sources.list
sudo: unable to resolve host garage

It means that I didn’t change hostname appropriately.
Continue reading