Category: linux howto

Useful things after installing Ubuntu


install multi-media codecs & MS fonts:

sudo apt install ubuntu-restricted-extras

 
enable click to minimize on dock:

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'

 
move the close/restore/minimize buttons to the left:

gsettings set org.gnome.desktop.wm.preferences button-layout close,minimize,maximize:

 
faster shutdown:

sudo nano /etc/systemd/system.conf

change and uncomment DefaultTimeoutStopSec=5s value and save, then:

sudo systemctl daemon-reload

 
fix Windows-Ubuntu dualboot causes wrong time displayed:

timedatectl set-local-rtc 1

 
Firefox settings:
close tab with double click:

about:config
browser.tabs.closeTabByDblclick true

fix volume level reduction caused by Firefox:

sudo nano /etc/pulse/daemon.conf

enable-remixing = no
flat-volumes = no

 

Reset SA password on SQL Server on Linux

1. stop service:

systemctl stop mssql-server

2. ensure the server is stopped:

systemctl status mssql-server

3. set new password:

/opt/mssql/bin/mssql-conf set-sa-password

4. start service and verify status of running service:

systemctl start mssql-server
systemctl status mssql-server

samba: add user to group

  1. add user to Linux system:
    adduser user1
  2. add user to samba:
    smbpasswd -a user1
  3. create group:
    groupadd group1
  4. add user to group:
    usermod -G group1 user1
  5. add user to different groups:
    usermod -G group1,group2,group3 user1

change the ownership of the folder:

chgrp group1 /path/OfYourSharedFolder

give read/write access to your shared folder:

chmod 770 /path/OfYourSharedFolder

SSH Key-Based Authentication on Debian

If you want to connect from Windows, first you need to generate rsa key files:

  1. open ZOC Tools/SSH Public/Private Key generator (you can use puttygen too)
  2. crate public/private keyfiles (id_rsa.pub, id_rsa)
  3. add content of generated “id_rsa.pub” file to: Debian server ~/.ssh/authorized_keys file
  4. edit and uncomment “PasswordAuthentication no” line in “etc/ssh/sshd_config” file
  5. now you can connect only with your generated “id_rsa” file

Install and configure SAMBA

1. Install samba:

sudo apt install samba

2. Adding samba user and password: (must be existing user in Linux)

smbpasswd -a nameOfYourSambaUser

3. Add your shared folder the end of /etc/samba/smb.conf file:

[share name]
path = /yourSharedFolder
writeable = yes
browseable = yes
force user = nameOfYourSambaUser

You need to give permissions for yourSambaUser to access yourSharedFolder:

chown -R nameOfYourSambaUser /path/to/yourSharedFolder

If you want access without password, replace “force user = nameOfYourSambaUser” with: guest ok = yes

4. Restart samba service:

sudo service smbd restart

xrdp on lubuntu without black srceen

Ive got black screen when tried connect to linux from Windows Remote Desktop Connection. Solution on Lubuntu 18.04:

  1. install xrdp server:
    sudo apt install xrdp
    sudo systemctl enable xrdp
  2. In the /etc/xrdp/startwm.sh, you will need to comment (#) the last two lines and add at the bottom of the file, the following line, and SAVE:
    lxsession -s Lubuntu -e LXDE

  3. Finally restart xprdp:
    sudo /etc/init.d/xrdp restart

Install TP-Link usb wireless adapter on Linux

Today I installed TP-Link TL-WN722N usb wireless adapter on Linux Debian system. Linux does not recognize this adapter by default so you need to install it manually.

Here is my method:

1. Open sources.list with sudo:

nano /etc/apt/sources.list

2. Paste this deb command in the end of file:

# Debian 8 "Jessie"
deb http://httpredir.debian.org/debian/ jessie main contrib non-free

3. Update the list of available packages and install the firmware-atheros package:

apt-get update && apt-get install firmware-atheros

4. Connect device to your system, or reboot

DeaDBeeF music player in Elementary OS

I switched from Windows 10 to Elementary OS. Elementary OS is very powerful, and I get much better performance and user experience than Windows 10.
I used foobar in Windows and DeaDbeeF is the best Linux music player alternative for me.

Install DeaDbeeF in terminal:

sudo add-apt-repository ppa:starws-box/deadbeef-player
sudo apt-get update

sudo apt-get install deadbeef

You can customize almost everything, convert, add album art column, show bitarate etc. like this:

I use Focusrite Scarlett 2i2 soundcard and it works perfectly in Elementary OS 5.1 Hera.

I set PulseAudio to 96kHz and 24bit  in /etc/pulse/daemon.conf

; default-sample-format = s24le
; default-sample-rate = 96000
; alternate-sample-rate = 96000