Tag Archives: ubuntu

Enable Root User ( Super User ) in Ubuntu

Question: I’m unable to do su – on Ubuntu. It says “su: Authentication failure”. How do I fix it? Also, is it possible for me to login to Ubuntu using root account directly?

Answer: Let us address these two question one by one.

Warning: Enabling root is not recommended. If possible, you should always try to perform all administrative tasks using sudo.

Question 1: I’m unable to login using su command. How to fix this?

By default, root account password is locked in Ubuntu. So, when you do su -, you’ll get Authentication failure error message as shown below.

$ su -
Password:
su: Authentication failure

Enable super user account password on Ubuntu

First, set a password for root user as shown below.

$ sudo passwd root
[sudo] password for ramesh:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Now with the new password you can login as super user with su command

$ su -
Password:
#

Disable super user account password on Ubuntu

Later if you don’t want to use su anymore, you can lock the root user password using one of the methods shown below

$ sudo passwd -l root

( or )

$ sudo usermod -p '!' root

Step 2: In the Security tab, click on the check box “Allow local system administrator” as shown below. After this change, reboot the system and login directly using root account.

How to disable-enable touchpad in ubuntu terminal

终端环境下可以通过以下命令来禁用/启用笔记本触控面板:

STEP 1: Determine the device id (the device name should be something with touchpad or glidepoint)

xinput list

STEP 2: Disable it (e.g. here the device id is 13)

xinput set-prop 13 "Device Enabled" 0

you can also dis/enable some other devices.
You may run the command during session startup

Original link: https://help.ubuntu.com/community/SynapticsTouchpad

Creating .deb-Packages With Checkinstall and install nodejs

Checkinstall is a nice tool to create simple .deb-packages that you can use in your local network (e.g. if you have to install the same piece of software on multiple computers running Debian). It lets you compile and install software from the sources like before, but with the difference that you end up with a simple Debian package which also means that you can easily uninstall the software you just compiled by running:

dpkg -r pkgname

I will demonstrate the use of checkinstall by compiling and installing the anti-virus software ClamAV on a Debian system.
This howto is meant as a practical guide; it does not cover the theoretical backgrounds. They are treated in a lot of other documents in the web.

This document comes without warranty of any kind!

1 Install Checkinstall

apt-get install checkinstall

2 Install nodejs latest

apt-get install python g++
mkdir ~/nodejs && cd $_
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd `ls -rd node-v*`
./configure
# make install
checkinstall -D make install

This even works on the computer you compiled nodejs on! This is a nice way to install software from the sources and remove it if you are unsatisfied with the result.

NOTE: man dpkg for details pkg manager in ubuntu.

# install *.deb file
dpkg -i PACKAGENAME

# list all package installed
dpkg -l

# list files of a Debian package without install
dpkg --contents PACKAGENAME

Upgrading from Ubuntu 12.04 LTS to Ubuntu 12.10

update-manager -d

To upgrade from Ubuntu 12.04 LTS on a server system: ensure that

vim /etc/update-manager/release-upgrades includes 
Prompt=Normal.

Install the update-manager-core package if it is not already installed; launch the upgrade tool with the command

sudo do-release-upgrade -d 

and follow the on-screen instructions. Note that the server upgrade will utilize GNU screen and automatically re-attach in case of e.g. dropped connection problems.

Offline upgrade options via alternate CDs are no longer offered for Ubuntu Desktop and Ubuntu Server. Please ensure you have network connectivity to one of the official mirrors or to a locally accessible mirror and follow the instructions above.

Split ubuntu terminal with Terminator

To install terminator, simply use apt-get:

$ sudo apt-get install terminator

Customize it to your personally habit

$ cat ~/.config/terminator/config

[global_config]
  enabled_plugins = LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
  handle_size = 1
[keybindings]
  new_tab = <Alt>t
  next_tab = <Shift><Alt>t
  split_vert = <Alt>d
  split_horiz = <Shift><Alt>d
[profiles]
  [[default]]
    scrollbar_position = hidden
    use_system_font = False
    font = Monospace 9
    background_darkness = 0.98
    background_type = transparent
    background_image = None
    show_titlebar = False
    copy_on_selection = True
[plugins]

Setting terminator’s initial window size:

$ cat ~/.bin/terminator

#!/bin/bash
# Override the souce execute with customize screen size

SHELL_PATH="/usr/bin/terminator"
if [ -f "$SHELL_PATH" ]; then
    "$SHELL_PATH" --geometry=1208x520
else
    gnome-terminal
fi

save above script as terminator, also make sure in $PATH, such as ~/bin/terminator.

You can use the following keys to split your terminal views

* _Ctrl-Shift-E_: will split the view vertically.
* _Ctrl-Shift-O_: will split the view horizontally.
* _Ctrl-Shift-P_: will focus be active on the previous view.
* _Ctrl-Shift-N_: will focus be active on the next view.
* _Ctrl-Shift-W_: will close the view where the focus is on.
* _Ctrl-Shift-Q_: will exit terminator.
* _F11_: will make **terminator** go fullscreen.

Set this terminator as default terminal <Ctrl+Alt+T>

To change the shortcut and not default terminal

  1. search for keyboard
  2. go to shortcuts and custom shortcuts
  3. press the plus sign to add new shortcut (in this case terminator)
  4. when told that the shortcut ctrl+alt+t is already in use press “reasign”

search for keyboardadd new shortcutreasign

If you go to the Keyboard shortcuts, you will notice under the Launcher section that Ctrl+Alt+T is tied to the “Launch Terminal” action. You can create a Custom Shortcut to your preferred Terminal, and bind that shortcut to it instead.


END enjoy it!

Ubuntu clear recently used files

In Unity, the recent documents that you see in the Files lens are logged using Zeitgeist.

$ rm ~/.local/share/zeitgeist/activity.sqlite
$ zeitgeist-daemon --replace

DISABLING ALL LOGGING. Copy these three lines to a blank text file:

CREATE TRIGGER IF NOT EXISTS no_logging_uri AFTER INSERT ON uri BEGIN DELETE FROM uri ; END;
CREATE TRIGGER IF NOT EXISTS no_logging_event AFTER INSERT ON event BEGIN DELETE FROM event ; END;
CREATE TRIGGER IF NOT EXISTS no_logging_text AFTER INSERT ON text BEGIN DELETE FROM text ; END;

Let’s suppose you named the file as triggers.sql. The next thing to do is apply these triggers on the activity database:

$ cat triggers.sql | sqlite3 ~/.local/share/zeitgeist/activity.sqlite

If you want to restore the standard functionality simply remove the database (it will be recreated without the triggers):

$ rm ~/.local/share/zeitgeist/activity.sqlite

The Classic desktop (and the lists of recently used files in most applications’ File menus) stores a record of your recently used documents in ~/.local/share/recently-used.xbel. You can just delete this file using the file manager or copy and paste the following code into a terminal:

$ rm ~/.local/share/recently-used.xbel

To DISABLE this feature, RUN this command on your Terminal:

$ touch ~/.local/share/recently-used.xbel
# Then, make the file immutable:
$ chattr +i ~/.local/share/recently-used.xbel