Things to do after installing ubuntu 12.04 – PART II

By default, Ubuntu comes with everything that is necessary for everyday use, but as each user has different preferences, this article will describe some things that can be done after installation. For the first part of this article you might want to check out: http://www.electronsonline.com/Things-to-do-after-installing-ubuntu-1204.html

 

SYSTEM CONFIGURATION

It is advisable to take a walk through the “System Configuration” menu where the user will find many options to configure Ubuntu. By default it is shows as part of the Launcher (launcher bar). It can also be opened it from the icon at “Shutdown> System Settings” on the right top panel.

In addition to the menu options mentioned above, there are many applications that can be installed to customize an Ubuntu installation, one of them is remarkable:

MyUnity – it is essential if the user wants a graphical tool for managing the system appearance (Desktop Themes, Icons, Cursors and appearance and behavior of the panel, Dash and Launcher (launcher bar) of Unity.

Installation: Search for myUnity in the Software Center:

sudo apt-get install myUnity

 

gnome-tweak-tool – (Advanced Gnome  Configuration).Graphical tool to manage GNOME 3. Works with both Unity and Gnome-Shell.

Installation: Search for advanced settings in the Software Center:

sudo apt-get install gnome-tweak-tool

DESKTOP ENVIRONMENTS AND GRAPHICAL INTERFACES

 

Tint2 – For those who want a lower panel with a list of open windows running with Unity. It is lightweight and configurable.

Installation: Search for tint2 in Software Center:

sudo apt-get install tint2

And for those users who do not like Unity, they can install different Desktop Environments and Shells:

 

Classic desktop – Gnome desktop clone running under Gnome 2.x and 3.x, maintained by Ubuntu.

Installation: Search for gnome panel in Software Center:

sudo apt-get install gnome-panel

 

Gnome Shell – Desktop with Gnome Shell 3.x, replaces Unity

Installation: Search for gnome shell Software Center:

sudo apt-get install gnome-shell

 

Cinnamon – Linux Shell created by Mint. Adds a bottom panel and a menu of applications to Gnome 3.x, among other things.

Mate – Fork of the missing Gnome 2.x (no support or development) which provides an alternative to those who do not want to use Gnome 3.x

 

Compiz

Compiz is installed by default, but there is lack of a configuration tool that really gets all the power of the 3D effects.

Installation: Search for compizconfig  in the Software Center:

sudo apt-get install compizconfig-settings-manager

UNITY SETUP

 

Activate the CTRL + ALT + BACKSPACE keyboard shortcut to restart X

It has been turned off by default for long, this shortcut allows the user to restart the X server (graphical) when a problem causes the system to stop responding correctly so that it can get to the login screen (username and password).

Follow these instructions to activate it:

Open the “System Configuration> Keyboard Distribution” and click the “Options” button (bottom right).

A window, displays the “Key sequence to kill the X server” and check the “Ctrl + Alt + Backspace” box.

UNZIP FILES IN ZIP AND RAR FORMATS.

 

zip and rar  must be installed.

Installation: search for 7zip in Software Center:

 sudo apt-get install p7zip-full p7zip-rar rar unrar

MOUNTING AN IPOD:

Installation: search for ipod in software center:

 sudo apt-get install gtkpod

To learn more about this application visit their official website.

BASIC SOFTWARE COMPILATION.

Sometimes it is required that the user compiles a piece of source code (.deb files) to get an executable.

To use commands such as “gcc” and “make”

sudo apt-get install build-essential

The user can also install the kernel development libraries necessary for certain packages:

sudo apt-get install linux-headers-`uname-r`

AVANT WINDOW NAVIGATOR

Even though it is not required to install any dock when having Unity Bar launchers, there is a way to install this magnificent dock for those who really want it.

Installation: search for avant window navigator in the Software Center:

sudo apt-get install avant-window-navigator

TEMPERATURE MONITORING OF HARDWARE

Installation: search for lm-sensors and hddtemp in software Cente:

sudo apt-get install lm-sensors hddtemp

 

Conky

Conky is a tool to monitor the system in a very lightweight way, while also being powerful and configurable, won several Linux awards, for being “more useful and better maintained.”

Installation: search for conky in the software Center:

sudo apt-get install conky

 

Screenlets

The screenlets are small desktop widgets that allow for having additional features in the desktop such as: clocks, battery consumption, weather, etc..

 

Installation: search for screenlets in the software Center:

sudo apt-get install screenlets

If you enjoyed this article, You might head to part III at: Things to do after installing ubuntu 12.04 PART III

July 27th, 2012 by admin in Ubuntu | No Comments

Bash – Introduction and configuration files

In this article on the shell Bash, we will try to explain in a simple way how to configure, operate and program in Bash. There are other command interpreters that are fully functional and powerful, but we will focus on Bash as it is the most used.

Every UNIX system administrator in general and Linux in particular, should learn a minimum of programming tasks in Bash so that he can automate and manage tasks and jobs in the system. There are many options, and once you take a liking to this programming language, you can not imagine a day as administrator without using these techniques.

Programming in Bash is easy (although it can be tough at the beginning for some people) and uses are unmeasurable. Like with many other aspects of learning, it mostly a matter of trial and error, sometimes making the question: “what would happen if I change this?”.

INTRODUCTION

 

A command line interpreter is a program that works as an interface to the operating system. It handles translation of user commands into instructions that the operating system can understand and vice versa, translate the result returned by the operating system into a language that users can understand.

Bash was written by the GNU Project and belongs to the user interface or text-mode category.

This article assumes that you already have Bash installed on your system (by default most distributions install and configure Bash shell prompt as the system command line interpreter). To use Bash you have to use the system in text mode or open a command line console in graphical mode.

HOW TO CONFIGURE THE COMMAND LINE INTERPRETER

The distribution we use configures Bash automatically, so we can start using it immediately. But if we change or add additional configuration parameters, it is good to know how to do it.

There are three files in the user home folder that have a special meaning for the Bash shell. These files allow the user to configure the environment of its account automatically as it enters the system, when it starts a subshell or executes commands when it exits the system.

The names of these files are .bash_profile, .bashrc and .bash_logout. If none of these files exist in the user home folder, /etc /profile is used by the system as the bash configuration file.

bash_profile is the most important of the three. It is read and the commands contained in it, executed, each time the user enters the system. Any change in this file will have no effect until you exit and enter the system again. An alternative so that you do not have to leave the system is to run this command: source bash_source.

Bash allows two synonyms for this file .bash_login (derived from the C shell) and .profile (derived from the Bourne and Korn shell). If .bash_profile does not exist, the system first tries with .bash_login and then .profile. Only one of these files is read, even though they exist simultaneously.

 

# .bash_profile example

 

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

 

# User specific environment and startup programs

 

BASH_ENV=$HOME/.bashrc

USERNAME=””

PATH=$PATH:/usr/local/pgsql/bin

MANPATH=$MANPATH:/usr/local/pgsql/man

PGLIB=/usr/local/pgsql/lib

PGDATA=/usr/local/pgsql/data

 

export USERNAME BASH_ENV PATH MANPATH PGLIB PGDATA

 

.bashrc is read when the user starts a subshell, writing for example bash in the command line. This allows us to run different commands for entering the system or for the execution of a subshell. If the user needs the same commands to enter the system and executing subshells, we can include the following line in .bash_profile:

    source .bashrc

# .bashrc example

 

# User specific aliases and functions

 

alias ll=”ls -l –color”

alias lal=”ls -la –color”

alias faq=”cd /home/tom/THE_CORNER/FAQ/”

alias php=”cd /home/tom/THE_CORNER/PHP/”

 

# Source global definitions

if [ -f /etc/bashrc ]; then

. /etc/bashrc

fi

.bash_logout is the file read by Bash when we leave the system. We can make a script, for example to delete the temporary files created in our last session or to register the amount of time we have been using the system. If .bash_logout does not exist, no command will be executed when leaving the system.

   # .bash_logout example

 

clear

 

Recommended reading:

July 23rd, 2012 by marcos in Ubuntu | No Comments

How to configure sound or audio in Ubuntu 10.04, Ubuntu 9.10 And Later (10.04 – 10.10)

First of all, I would like to point out that most of the times audio problems are due to misconfiguration.

 

Since Ubuntu 9.10, there is a default configuration tool called “Pulseaudio” with a new interface that we can configure to match our sound preferences.

 

Right click on the speaker icon next to the hour and choose “Sound Preferences”. We find the following tabs:

  • Output volume -> will be in all tabs and is the main volume. We must disable “silence” as it comes enabled by default.
  • Sound Effects -> To set up alerts.
  • Hardware -> We can choose the profile of your sound card and make it work one way or another depending on the capabilities of our sound card. Depending on the option we choose, we will be will enabling or disabling the correspondign “alsamixer” controls. Example: HDA-Intel has many profiles up to  5 +1 Surround, but I have two front speakers and the default “Analog Stereo Duplex” works perfectly.
  • Input -> We set “connector” to the device that allows us to input sound into the machine, such as microphones, cd player … to record sound from a phone conversation for example. We can also set  volume and input level to test whether the device is working properly. We must disable “silence” as it comes enabled by default.
  • Output -> We set “connector” to choose among sound output devices like normal speakers, headphones, or others.
  • Applications -> shows the applications that are currently playing or recording sound.

 

 

If we do not do well with PulseAudio we can remove it and stick with ALSA which is the configuration tool bundled with Ubuntu 9.04 and earlier

 

Most people have no problems with pulseaudio, but several readers mentioned they have issues they never had before with Alsa. Many of these problems are related to the topic of microphones and audio capture (eg Skype).

 

There are plenty of guides that show how to completely remove pulseaudio from the computer and reinstall Alsa as we had in previous versions of Ubuntu.

SET THE SOUND CONTROLS WITH ALSAMIXER

 

We can enable or disable the sound controls of our card through the terminal with the following command:

alsamixer

 

 

We see there are several controls:

Card -> Model name of your sound card.

Chip -> The processor of our sound card.

View -> We navigate using the “tab” key:

 

Playback: Controls for playback and sound output.

Capture: Controls to set capture or recording.

All: All the controls.

 

Below we find all the controls that should be set using the keyboard:

 

Right and Left arrow in keyboard -> we move through the different controls from left to right and vice versa

“m” key -> activate or deactivate control. MM means deactivated, OO means activated.

Arrow up and down in keyboard -> raise and lower the volume.

“Escape” Key -> Exit alsamixer and save the configuration.

 

Note: If we install gnome-alsamixer, we will have a graphical interface to modify sound options rather than the console-mode alsamixer.

 

 
 

TIPS

 

Some cards have many controls (Surround, Center, LFE, Side, CD ..) depending on whether you have 5 +1 sound, 7 +1 sound  and more. Also, control names may vary according to the sound cards.

 

But we will focus on the typical sound of a home computer, which most common controls are:

Master: The Volume that must be activated and set to the highest value.

PCM: It is also volume and must be set to the highest value.

Front: Speakers that are usually plugged into the computer and must be activated and set to the highest value.

Line Input: For playback devices, must be turned on and volume down (when not in use).

Microphone: Mostly used in phone conversations. Must be enabled and the volume down (when not in use).

Speaker: This control must be always on.

Capture: This is for sound recording, shown in the recording tab and must be activated and set to the highest level.

 

 

We should also verify that the following libraries are installed so that the audio jacks (to which connect microphones and other) remain operative:

alsaplayer-jack

libjack0

libavc1394-0

libiec61883-0

libfreebob0

 

To do this:

  1. We go to System – Administration – Synaptic Package Manager.
  2. Make sure that “All” to the left of the window is selected.
  3. Press “Reload” to update the repositories.
  4. In “Quick Search” enter the name of the packages one by one.
  5. If they are not installed (white square), we double click to select them.
  6. Once all the packages are selected to install, we click on the “Apply” button (with an A on it) and voila, we have all installed.

FOR UBUNTU 9.04 AND PREVIOUS VERSIONS

 

To configure Alsa, we click on the audio icon (speaker) at the top panel next to the date.

Press “Volume Control” and we will get the mixer window with several tabs.

Scroll down (if necessary) to “Preferences” and activate, if they were not on, all the controls you have for your sound card.

To make sure all the sound settings are working as expected we go to System – Preferences – Sound and click on “test” for all controls.

 

July 21st, 2012 by marcos in Ubuntu | Comment (1)

Downloading flash videos to /tmp folder in Ubuntu 10.02 and above

With Ubuntu versions prior to 10.02, video files we watched on our browsers by using the flash plugin could easily be found in the /tmp/ folder. Giving the found file a human name and moving it to our home folder would make it all the way to enjoying those videos offline. But after the Flash Player plugin update to version 10.02 on Ubuntu 10.10 flash videos no longer appear in /tmp.

The story has changed, those of us who were used to download Flash videos, by looking for them in the mentioned directory and then copy the files to some other folder without any additional software, we’ve found that the technique no longer works because the files are no longer stored in that directory.

Note: Successfully Tested with Firefox and Chromium in: Ubuntu 10.10 amd64 (64bit) with 64bit flashplugin, Ubuntu 10.10 amd64 (64bit) with 32bit flashplugin, Ubuntu 10.10 i386 (32bit), Debian Squeeze (stable) and Debian Wheezy (testing), Ubuntu 11.04 and 11.10 (32bit and 64bit). Also tested in Ubuntu 12.04 (32bit and 64bit).

 

EXPLANATION OF HOW DID WE FOUND OUT

 

1. We started playing any Youtube video.

2. Knowing that temporary files are stored under the name of “Flash” + a code of numbers and letters, we opened a terminal and looked for any Flash file with the command “lsof

lsof |grep Flash

 

The terminal showed the following (takes a bit, be patient):

npviewer. 2235     usuario   11u      REG                8,3  6923916     654482 /tmp/FlashXXUt9wzs (deleted)

 

So we realized that the file is “deleted” even before it is completely played.

Note: Ubuntu 12.04 does not show the video file, only the library “/usr/lib/flashplugin-installer/libflashplayer.so”. See solution at the end.

 

2. We run the command again before full reproduction to see if there are any changes:

lsof | grep Flash

 

And the terminal shows:

npviewer. 2235     usuario   11u      REG                8,3 20948620     654482 /tmp/FlashXXUt9wzs (deleted)

 

That way we confirm the file size has increased considerably (from 6923916 to 20948620), so that the file, even if being shown as “deleted”, it is there and is being modified. There must be a symbolic link that lets us get to it.

 

3. We run a search for the link in the /proc/ folder, which is where virtualization files are saved in Linux, with:

ls-l /proc/2235/fd/11

 

2235” is the number of process in the 2nd column.

11” is the file descriptor without the letter that follows in the 4th column.

The command outputs the following:

lrwx------ 1 usuario usuario 64 2011-02-13 18:07 /proc/2235/fd/11 -> /tmp/FlashXXUt9wzs (deleted)

 

Meaning there is a link to the file ( even if it is shown as “deleted”), so all what’s left is copy the that file.

 

4. I copy it to the home directory with the command:

cp /proc/2235/fd/11 video.flv

“video.flv” is the name we give to this video.

We open the personal folder and there is the video and we reproduce it without problems.

 

SIMPLIFIED METHOD

 

Of course you do not have to do everything we’ve done and would be just suffice to:

 

1. Start playing the video, and before it finishes loading completely, locate the file to determine the number and descriptor of the process with:

lsof |grep Flash

 

The terminal will show something like:

plugin-co 2925   kaos1204  DEL       REG                8,6          2232428 /usr/lib/flashplugin-installer/libflashplayer.so

 

We no longer see the temporary file of the video, only the library at “/usr/lib/flashplugin-installer/libflashplayer.so”. To solve this, right click on the video and select “Pop out”.  After opening the new window and before it finishes loading run the command “lsof | grep Flash” and that will show, first of all, the library name and secondly, the temporary file, which is what we care about:

plugin-co 2925   kaos1204  DEL       REG                8,6          2232428 /usr/lib/flashplugin-installer/libflashplayer.so
plugin-co 2925   kaos1204   42u      REG                8,6  1746126  141520 /tmp/FlashXXSccA9R (deleted)

 

2. When the video is finished loading, without closing the browser window, copy the file  to your home directory with the command:

cp / proc/2925/fd/42 video.flv

You must replace 2925 and 42 with the values you obtained with the previous command.

We can then start downloading videos without having to install anything.

July 19th, 2012 by marcos in Ubuntu | No Comments

Monitoring sensors and temperatures in Ubuntu 12.04

Checking  the temperature of your hardware (processor, graphics card, hard drive …) is important to know how our computer is doing and if you have problems with high temperatures, either by  degradation of the materials in contact with the micro or simply by a fan that stopped working.

 

To prevent any of these problems, we will see how to monitor the temperatures of a machine running Ubuntu 12.04.

 

INSTALL THE REQUIRED LIBRARIES TO DETECT SENSORS

 

To detect motherboard and processor Sensors we need to install the “lm-sensors” library  (lm-> is a lowercase) in a terminal with the command:

sudo apt-get install lm-sensors

 

To detect sensors for the hard drives need to install “hddtemp” by typing the following in command:

sudo apt-get install hddtemp

 

Note: During the installation of “hddtemp” you will have to select “YES” to all options.

Note: when the installer asks if we want to run the hddtemp daemon at startup (to detect the sensors from the system boot), select “YES”.

 

Hddtemp listens a port, so you must have root privileges to listen. To view the hard disk temperature when using applications from our users session, we must give appropriate permissions:

sudo chmod u + s /usr/sbin/hddtemp

Warning: Doing it this way can create a security hole, if you don’t have your firewall properly configured. It is recommended NOT to grant these permissions and run the command from the terminal as explained below (for conky, there is a separate trick, also explained below).

 

Command to reconfigure hddtemp, just in case something went wrong or if it is required to change some settings:

sudo dpkg-reconfigure hddtemp

Note: The first question made by the wizard is to grant permissions. Select NO if you do not want to give them.

 

 

DETECT SENSORS

 

Once all the required libraries are installed, Ubuntu will detect the sensors in the computer with this command:

sudo sensors-detect

 

Begins asking questions and showing the option recommended by Ubuntu (in capitals). Select it by typing the letter and pressing Enter or simply pressing Enter.

Note: Try not to blindly press Enter because in the end is asks “Do you want to add these lines to /etc/modules Automatically? (Yes / no)”. This causes the system to automatically load the sensors libraries on reboot.

Reboot the system and you are ready to go.

 

Possible Error

There are people that have problems using the default sensor order set by ubuntu, it is then recommended to change that order in the  /etc/modules file, for example:

Among the information that is given to us at the end of the sensors detection (before the last question) look between the lines that say “cut here”, it says something like this:

# —- Cut here —-

# Chip drivers

it87

CoreTemp

# —- Cut here —-

So choose No to the previous default configuration option and change the order manually, like this:

# —- Cut here —-

# Chip drivers

CoreTemp

it87

# —- Cut here —-

 

APPLICATIONS TO MONITOR SYSTEM TEMPERATURES

 

Terminal or Console

We monitor the temperatures of the motherboard and processor from the terminal with the command:

sensors

And the hard disk (/dev/sda) with:

sudo hddtemp /dev/sda

Note: If we have more hard drives (/dev/sdb, /dev/sdc, …), change “/dev/sda” with the corresponding command.

 

Psensor

Available at the Software Center, allows for graphically monitor the temperature of the hardware.

 

Features:

  • Monitors sensors in the motherboard, processors, dedicated graphics cards (GPU), hard drives, fans and CPU usage.
  • You can set an alarm so that you are alerted with an information balloon when temperature reaches a certain value (at your option).
  • Graphic window of temperatures, fan speed and cpu usage.
  • Configuration of colors and sensors that we want to show.
  • Icon in the top panel with quick access to information

 

 

Installation:

sudo apt-get install psensor

 

Execution: Press Start (1st launcher bar with Ubuntu logo) and write psensor

  • In the Psensor menu you can find:
  • Application Preferences (background color, time of monitoring and configuration of the interface (window).
  • Preferences for the sensors (information and alarms)
  • Sensors can also be directly monitored from the thermometer -shaped  icon in the top panel, without having to open a new window:

 

Conky

Conky is a lightweight and configurable monitor for the system, that shows a lot of information on the desktop, including temperatures.

To monitor the temperature of the HDD in Conky, I use “netcap” (a powerful application for the terminal). The command to enter would be like:

nc localhost 7634 | cut-c30-31

“Loclhost nc 7634” is to listen on port 7634 with “Netcap” (nc) and then use the pipe “|” to filter the results by adding the command “cut” (c) to delimit the variable characters (30 and 31) of the temperature, that depend on your hard drive.

For example, you can run in your terminal:

nc localhost 7634

It outputs something like this:

|/Dev/sda|TOSHIBA MK5059GSXP|38|C|

What you want is temperature: 38. The position (including spaces) in which both characters are 3 and 8 must be count (in this example “3” is the character number 30 from the line returned by the terminal and “8” is the number 31)

 

I do the same for the “Core” (processor cores), using the “sensors” command.

July 17th, 2012 by marcos in Ubuntu | No Comments

Remote Desktop on Ubuntu

Remote Desktop allows us to see and even control the desktop of another computer from your PC. For example, we have a shop and want to view and control some video security cameras that are connected to a computer from another point in our house.

 

 

Warning

 

This can be done by means of a local network and over the internet, but only if the computer you want to view and control has a static IP.

Nowadays, almost everyone is behind a “rooter” that provides a dynamic IP, which varies each time the system boots. If that is the case, rooter settings must be changed from a web browser by entering the following in the address bar: http://192.168.0.1/ (for example) and change the type of IP (static). Port  5900 should be open also, which is the one to be used, as the rooter usually has a firewall.

Each rooter has a different way of configuration, so a little googling or a call to support service may be required.

 

CONTROLLING A COMPUTER WITH UBUNTU FROM ANOTHER ONE WITH UBUNTU

 

From now on, and to avoid confusion, the computer to be controlled will be called “SERVER” and the computer from which the user connects will be the “CLIENT”.

 

Ubuntu uses the “VNC” protocol but there is another protocol, called “SSH + NX” that can be used with encryption. In this article the VNC option will be described as it is the one that is installed.

 

 

Configuring the Server

The first thing to do is to configure the server to give the appropriate permissions, so that a remote user can access it. By clicking on “System -> Preferences -> Remote Desktop” a window will open, showing the following settings:

 

Share” frame:

Activate “Allow other users to view your desktop” and the system begins checking the computer connectivity. This may take some time and will provide with the IP address to be used to connect to the server (do not forget).

Allow other users to control your desktop” -> must be activated if it is required that the client has full access. If the client should only have “view” permissions, this option must be deactivated. This would be the case if it is wanted to show someone how to do something in Ubuntu, for example.

Security” frame:

Each access to this computer must be confirmed”-> To be activate in the case that there is always someone on the Server computer (i.e, if we want to teach someone what we do), but no one is usually present so it is important to consider not to activate it.

Require user to enter a password” -> Typical configuration is to activate it and write (8 characters). If this is not set, anyone who knows the server IP, will be able to control the computer, which is not usually desired.

Configure the network to automatically accept connections” -> Typically activated, so that the port  5900 is open and the system is configured properly.

Notification Tray” frame:

Always show an icon.

Show an icon only when someone is connected.

Never show an icon.

When the window is closed the server is already configured and ready for the client to connect.

 

Access From The Client

 

Clicking on “Applications -> Internet -> Remote Desktop Viewer” will open the viewer, clicking on “Connect” will open another window to configure the connection:

Protocol -> must be set to VNC

Host -> to be filled in with the IP provided by the sytem when configuring the Server. If the server is on a LAN, clicking on Search will look up other computers so that they can be selected.

Full screen.

VNC Options -> View and scale only.

The client is ready to connect.

 

Screen Refresh Problems When Extra Effects Are Enabled

A typical problem is that the screen does not refresh on the client viewer. The client user moves the mouse and the pointer moves on the server, but the screen does not refresh properly.

This can be quickly solved by setting “visual effects” to “none“on the client, but any other configuration (normal or extra) doesn’t work.

A definite solution would be to get to gconf-editor-> desktop -> gnome -> remote_access and check “disable_xdamage”.

July 15th, 2012 by marcos in Ubuntu | Comment (1)

Manage users and groups in Ubuntu 12.04

There are two ways to manage users and groups in Ubuntu:

1. Graphical -> The simplest way.

2. Command line text -> More technical but more powerful, several things can be done at once.

 

THE GRAPHICAL WAY IN UBUNTU

 

With Ubuntu 4.12, graphical user interface is now called “user accounts” and some options have been removed. Basically, users can only create/delete users, manage account type, language, password and startup options.

If options from earlier versions are needed, the “gnome-system-tools” package must be installed. This can be achieved by means of the software center or by typing the following in the command line:

sudo apt-get install gnome-system-tools

This package contains the following applications:

Users and groups -> This is the former “users and groups” tool.

Date and time

Network options

Services

Shares (NFS and Samba)

 

After running the install command, a shortcut called “Users and Groups” can be accessed from the Dash (Super key or by pressing the first “Start” launcher  in Unity bar).

Users and Groups

 

1. To add a new user:

 

Click the “Unlock” button and enter the root password.

Click + Add User and the User Accounts Editor window opens.

 

The most important fields in the “Account” tab are:

User name. Do not use spaces or ASCII characters

Actual name. This is optional

Profile: Choose between Administrator, Desktop User, and Unprivileged User (this creates a user with the default privileges, although it can be subsequently modified).

Password: Can be manually set (enter it 2 times) or let Ubuntu automatically generate it.

“Contact Information” tab:

The location of the office and telephones can be entered here. This is optional.

“User Privileges” tab:

You can grant or deny privileges to the new user, such as access to audio devices.

“ADVANCED” tab:

The home folder directory, the shell, the main group and user ID are set automatically depending on the selected profile, so they should not be modified.

 

2. To modify an existing user:

 

Select the user to edit and click the Properties button. A window similar to the one used to add new users, allows for modification.

 

3. To delete an existing user:

 

Select the user or users to be deleted and press the Delete button on the Users tab. Due to the importance of this data, an confirmation window will be shown for each user to be deleted.

 

For security reasons, the home directory of the deleted users will not be removed.

 

4. To add a new group:

Click on “Manage Groups” and then click the “Add Group” button, a new window pops up, requesting for data of the new group:

Name of the group.

ID of the group.

Optionally, you can specify which users belong to this group.

 

5. To modify an existing group:

Click on “Manage Users”, select the group and click the Properties button. A window similar to “Add group” pops up, and data can be modified from there.

 

6. To delete an existing group:

Click on “Manage Users”, select the group and press the Delete button. Due to the importance of this data, you will be prompted for each group you want to delete.

 

MODE TEXT WITH THE TERMINAL

 

To manage users, the sudo command must be issued. These are the task specific commands:

 

Adding Users And Groups

To add a user:

sudo adduser username

The system will request  additional information about the user. By default, it creates a group with the username which will be the default group for that user. This behavior is configured in /etc /adduser.conf.

To add a user to the system by setting “users” as their primary group:

sudo adduser – ingroup users username

 

To see the manual pages for the adduser command.

sudo adduser man

 

Groups are useful when the number of users is large and heterogeneous. Groups simplify administration. Creation of groups is done with the addgroup command:

sudo addgroup groupname

 

To add a new or existing user to an existing group:

sudo adduser username groupname

 

2. Remove users and groups

userdel and groupdel are used respectively to remove users and groups. For example: To delete the user john:

sudo userdel john

If the -r option is also indicated the system deletes the user’s home directory and all its contents:

sudo userdel-r john

 

To delete the group teachers:

sudo groupdel teachers

 

3. Modify users and groups

 

To modify users and groups, the usermod and groupmod are used.

Change the user’s home directory for john to /home/faculty/john. Also, use the -m option to move the content from the old directory to a new location.

sudo usermod -d /home/profs/john –m

 

To change the initial user group john to be teachers.

sudo usermod -g teachers john

 

To change the username john to the new name is george.

sudo usermod -l george john

 

To change the name of the teachers group to students.

sudo groupmod -n student teachers

July 13th, 2012 by marcos in Ubuntu | No Comments

EVOLUTION: Configure a G-Mail account in Ubuntu

Evolution is the default mail client installed in Ubuntu. More than just an mail client, it’s a complete groupware tool that allows the user to manage contacts, tasks, notes and calendars. Evolution can be started in three different ways:

Click on the (envelope) icon in the top panel.

Go to Applications menu -> Internet -> Evolution Mail.

Executing the following command in a terminal window: evolution

 

G-MAIL SETTINGS AND EVOLUTION

Evolution must be setup to manage your Gmail account.

NOTE: Hotmail is very restrictive but Evolution has adapted itself and what used to be a puzzle, is now simple. Check out later for an article on setting a hotmail account with Evolution.

 

 

Pop Mail Settings in Gmail Account

First of all, a Gmail account must be set in order to receive emails in Evolution.

To do this:

1. Log into the Gmail account and load the inbox.

2. Click on the “Settings”, right in the inbox.

3. Select “Forwarding and POP/IMAP” in the top bar

4. Under “POP Download”, there are three options:

Enable POP for all mail (even if already downloaded) -> this option will make Evolution download all the mail from the inbox or that is stored on the server.

Enable POP for mail that arrives from now -> most appropriate option, to receive new mail only.

Disable POP -> default option

Select any of the first two previous options

5. Choose between “keep a copy on server” or “deleted after download”

6. Click on “Save Changes”

 

 

 

Set Up Evolution To Receive G-Mail Messages

1. Evolution Welcome window opens, click Forward.

2. This program allows for restore from a file previously created with Evolution.

3. Enter name and email address to be used.

Check the box “Make this my default account (if available)” if desired.

The two spaces below can be left blank.

Click Forward.

 

4. Set incoming mail options, leaving them as follows:

Mail Type: POP

Server: pop.gmail.com: 995

User: username@gmail.com

Use secure connection: SSL

Authentication type: Password

Remember my password: Optional.

 

 

 

5. Receiving Options can be left as default, or can be modified for example, to not having to manually delete mail.

6. Configure outgoing mail as follows:

Server type: SMTP

Server Configuration / Server: smtp.gmail.com: 465

The server requires authentication: Check the box

Security: SSL

Authentication / Type: Plain

User: username@gmail.com

Remember password: Optional.

 

 

 

7. Enter the name to be used to identify the account.

 

8. Select  the time zone.

An Evolution account has been configured, now the user can start receiving mail and reply.

 

Evolution Components

 

There are four available areas when Evolution is open:

 

Zone 1: Folder tree showing distributed mail.

Zone 2: List of emails in a specific folder.

Zone 3: Displays the selected message from the list above.

Zone 4: There are a number of buttons that allow the user to change the operating mode of Evolution. Available modes are Mail, Contacts, Calendar, Notes, Tasks:

Contacts to store information about user’s contacts. There are many types of data that can be associated with a particular contact, even a photo. Interestingly, if we set a date of birth, the Calendar component will show the contact’s birthday.

 

With Calendar, the user can schedule meetings and events that it needs to be aware of. It can be set to notify the proximity of an event. Data from online calendars like Google Calendar can be imported.

 

Notes are a kind of digital Post-It. All kind of information we collect can become calendar events. They are also fine for quick notes of things that the user is dealing with.

 

Tasks: When the user has pending things to do, the best option is to point them in this component to avoid forgetting. At any time, status of a task can be checked.

 

The calendar system is integrated with Evolution, so that it shows Tasks and Quotes of the day we select.

 

Activating Spam Detection In Evolution

 

Evolution detects spam. In fact, the folder tree contains a folder with an icon that looks like a crumpled piece of paper. The spamassassin package must be installed, it’s the filter that Evolution uses to decide if a message is spam or not.

 

Installation:

sudo aptitude install spamassassin

 

After installing the package, it must be configured to run in daemon mode. To do this, edit the file /etc/default /spamassassin as root. Issue the following command in a terminal:

 

sudo gedit /etc/default/spamassassin

 

And the line that says:

 

# Change to one to enable spamd

ENABLED = 0

 

Has to be changed to:

 

# Change to one to enable spamd

ENABLED = 1

 

Now start the daemon with the following command:

sudo /etc/init.d/spamassassin start

From now on the process will run when the computer starts. Evolution must be restarted if it was running.

July 11th, 2012 by marcos in Ubuntu | Comment (1)

Firestarter Firewall in Ubuntu, installation and configuration

Iptables is the default firewall in Ubuntu and is a very powerful tool. The problem is that when it comes to perform administration tasks, the syntax is complicated and difficult to understand. For this reason, Gufw and Firestarter were created (it is a server level firewall for “humans”), which is simpler.

 

GUFW FIREWALL

Gufw can be installed from a terminal window with the following command:

sudo apt-get install ufw Gufw

 

By default, Iptables and ufw run from startup, allowing all outgoing connections and denying all incoming connections.

 

Gufw, the graphical interface for ufw, is ideal for normal users with little knowledge.

It can be run from System -> Administration -> Firewall Configuration.

The simplest way to add a rule:

Simple: To add a specific port, choose between allow, deny or limit.

Enter the port number.

Select TCP, UDP or both.

Click on “add”.

 

To remove rules, select Delete.

 

FIRESTARTER FIREWALL

More powerful than Gufw, it also consumes more resources.

Can be installed from a terminal window with the following command:

sudo apt-get install firestarter

 

To run it, go to Applications -> Internet -> Firestarter.

 

The first time the Firestarter is executed, a configuration wizard appears, showing a welcome message. Click Continue.

 

 

Another window pops up, showing an Internet connection form (to know what network connection the system using, issue an ifconfig command in a Terminal). The user can choose if the firewall should allow external connections (recommended) and if the IP address of the computer is assigned via DHCP.

Click Forward.

Another window appears so that the user can decide to share the Internet connection with other computers in the network by means of NAT (Check this option if the computer the DHCP server and delivers Internet connection to other computers in the network.

Click Continue.

 

Last window appears, from which the user can start the firewall.

 

By default Iptables and its user interface Firestarter allow all outgoing connections and deny all incoming connections.

 

The first tab shows the status of the firewall, with direct readout of active connections. Shows connections that have been rejected. Rules shows the rules of the firewall configuration, which can be browse by selecting from the following options:

Rules for incoming traffic: permission to enter.

Rules for outgoing traffic: used to prevent out connections.

After setting this option, right click on the bottom panel, and select “Add Rule” from the context menu.

To allow access to specific ports, click on Allow service/port/to, which opens a window where the user must specify the port to be open:

* Name: description of the port to be open.

* Port: Port to open (a range can also be specified: i.e. 4662-4672).

* Origin: If it is necessary to specify a particular IP to allow traffic from. Typically left blank.

* Comment: A comment (optional) describing what the port will be used for.

 

After entering the required information, click the “Add” button and the rule will be applied. If the user doesn’t know which ports an application uses and it is not working properly, it is probable that the firewall is denying traffic, not having set an explicit rule for it. In this case, the Events tab can used to know the connections used by the application and then grant necessary permissions.

 

To allow traffic from the local network and be able to share files between computers, select “Allow connections” from the host. In the opening screen, the user can enter the private IP, the name of the machine or network it wants to allow full access from.

 

Example to open ports for aMule

1. While the firewall is running, click on “Rules” and select “Edit – Rules” for incoming traffic.

2. Select the text box below and click on “Add Rules”.

* aMule requires two ports to be open, meaning that two rules have to be set:

Specify that the firewall will allow incoming connections to port 4662(TCP), set the name to aMule and click on “Add”.

Do the same for port 4672(UDP).

* For Transmission, only add port 51413 (TCP)

 

If it is required that Firestarter runs every time an Ubuntu session starts, it should be added to the list of startup programs in System -> Preferences -> Sessions -> Startup Programs.

July 9th, 2012 by marcos in Ubuntu | No Comments

Install Xampp on Ubuntu 11.04

XAMPP is a web server that is used to develop applications in PHP, with connection to a SQL database (LAMPP = Linux + Apache + MySQL + PHP + Perl)

 

Installing an Apache web server is not easy for newcomers and is even more complicated if it is required to add MySQL, PHP and Perl.

 

XAMPP is an easy to install and use Apache distribution that contains MySQL, PHP and Perl. It’s really simple to install and use, but keep in mind that it is not intended for use in production (explained at the bottom of the article).

 

It is also a multiplatform GNU project, currently distribute for: Linux, Windows, Mac OS X and Solaris.

 

Official Website: http://www.apachefriends.org/en/xampp.html

 

 

INSTALLING XAMPP

 

– Download the last version of XAMPP from the web. The web page detects the OS and architecture (32 or 64 bits). At present the package to the latest version is: xampp-linux-1.7.4.tar.gz

 

– Once it is downloaded, unzip it to the /opt directory from a terminal with the following command:

sudo tar xvfz xampp-linux-1.7.4.tar.gz-C /opt

 

Note: Make sure that the file name matches the one you downloaded.

XAMPP is already installed in /opt/lampp

 

Note: Tested on Ubuntu 11.04 and 10.10 (32bit and 64bit) with no problems.

 

To uninstall:

sudo rm-rf /opt/lampp

 

Set permissions to the /opt/lampp/htdocs

(This is where web pages files are stored)

 

1. Grant write permissions to /opt/htdocs by issuing the following command:

sudo chmod a + w /opt/lampp/htdocs

 

2. Create a symbolic link between that directory and a location in the user’s home directory, eg /home/user/websites, so that it has its project in the personal folder:

sudo ln -s /opt/lampp/htdocs/home/user/Sites

Note: replace “user” with the real username.

 

Commands to be used with Xampp:

Start xampp:

sudo /opt/lampp/lampp start

Restart xampp:

sudo /opt/lampp/lampp restart

Stop xampp:

sudo /opt/lampp/lampp stop

 

If it all goes well, the user will see something like:

Starting XAMPP for Linux 1.7.4 …

XAMPP: Starting Apache with SSL (and PHP5) …

XAMPP: Starting MySQL …

XAMPP: Starting ProFTPD …

XAMPP for Linux started.

 

Before the user can start developing applications, it must always perform that previous step to start Xampp.

However, there is a GUI (graphical user interface) that allows for a quick start of all services.

It’s called Xampp Control Panel and opens with the following command:

sudo /opt/lampp/share/xampp-control-panel/xampp-control-panel

If the following error is shown when launching XAMPP from the terminal:

Error Importing pygtk2 and pygtk2-libglade

The solution is to install the corresponding library:

sudo apt-get install python-glade2

 

 

 

CREATE A LAUNCHER IN THE HOME MENU

 

For the application to show under “Applications – Other” in Ubuntu 10.10 and above and in Ubuntu 11.04 Dash applications, create a .desktop file in /usr/share/applications/:

sudo gedit /usr/share/applications/xampp-control-panel.desktop

 

Paste the following code in the file:

[Desktop Entry]

Comment = Start / Stop XAMPP

Name = XAMPP Control Panel

Exec = gksudo python /opt/lampp/share/xampp-control-panel/xampp-control-panel.py

Icon [en_CA] = /opt/lampp/xampp.png

Encoding = UTF-8

Terminal = false

Name [en_CA] = XAMPP Control Panel

Comment [en_CA] = Start / Stop XAMPP

Type = Application

Icon = /opt/lampp/xampp.png

Save and close.

 

All what’s left is to try to see if it runs without problems.

Open the browser and type the following in the address bar:

http://localhost

The XAMPP welcome screen should open.

 

Create a php file and display its result in the browser:

The PHP files must be stored in the htdocs directory: /opt/lampp/htdocs (the user also has access to this directory by using the previously created link in its personal folder: /home/username/Sites/htdocs).

 

For example, to see the output of a file called “test.php”, enter the following in the browser address bar:

http://localhost/test.php

 

SECURITY

 

As mentioned before, XAMPP is not intended to be used in a production environment, it is just for a local development environment. XAMPP is configured to be as open as possible, allowing the developer to work without restrictions. This is great for development environments, but could be fatal in a production environment.

 

List of security vulnerabilities in XAMPP:

 

The MySQL administrator user (root) has no password.

The MySQL daemon is accessible via network.

ProFTPD uses “lampp” password  for “nobody” user.

PhpMyAdmin is accessible through the network.

MySQL and Apache run under the same user (nobody).

 

Most security vulnerabilities can be fixed by executing the following command:

sudo /opt/lampp/lampp security

 

This starts the security control, making the XAMPP installation secure.

 

July 7th, 2012 by marcos in Ubuntu | No Comments