Ubuntu Tidbits

  • strict warning: Non-static method view::load() should not be called statically in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/views.module on line 906.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/views_handler_argument.inc on line 744.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/views_handler_filter_boolean_operator.inc on line 159.
Leeland's picture

== Table of Contents ==

__TOC__

== From Red Hat to Ubuntu ==

* Rosetta [https://help.ubuntu.com/community/SwitchingToUbuntu/FromLinux/RedHatEnterpriseLinuxAndFedora switching to Ubuntu from Red Hat Enterprise Linux, Fedora, and Centos]

== Disable Blank Console Screens ==

I have a number of Ubuntu server that boot up in text mode (both VMs and physical boxes). Once they boot I usually access them via ssh sessions so almost never try to type to console directly. However, it is rather annoying to want to see what is being sent to the console because I have to click and hit a keyboard key. So I had to find a way to permanently disable the blank screen feature for the consoles.

Now when you are logged in this is simple to do just enter the command:

$ setterm -powersave off -blank 0

No more screen blanking. However, I need my servers to never blank regardless of sessions or logged in or not. Especially directly from boot when showing the basic login prompt.

The answer to this is to use the [http://packages.ubuntu.com/lucid/console-tools console-tools] package that allows console options to be controlled.

To stop the screen blanking both the screen saver (BLANK_TIME setting) and the power management standby (POWERDOWN_TIME setting) settings need to be disabled. If these two settings are set to zero (0) in the file /etc/console-tools/config the features will be completely disabled. Alternatively a local settings file called /etc/console-tools/config.d/disable-blank-console can be created containing the following two lines to achieve the same affect.

POWERDOWN_TIME=0
BLANK_TIME=0

Actually you can name the file anything you want so long as the name consists of only upper/lower case letters, numbers, underscores, and hyphens.

== Resizing Windows is Hard ==

Gnome windows in Ubuntu 10.x and 11.x are amazingly hard to resize. The issue is the Gnome draggable boarder is only 1 pixel wide. This is a well known issue and in the works to get correct in Natty (but since Natty release has happened and it is still an issue it should be fixed "soon"). Any way this is all documented at [https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/160311 Bug #160311 Resizing windows by grabbing window borders is difficult]. There are two workarounds. The first is to change the size of the window edges in Gnome by editing /usr/share/themes/Ambiance/metacity-1/metacity-theme-1.xml:

=== Workaround #1 ===

Edit /usr/share/themes/Ambiance/metacity-1/metacity-theme-1.xml. Set the following values in frame_geometry_normal as desired (3 works pretty good). Note this requires restarting x-windows (logout + login) for the change to be used.

<distance name="left_width" value="3"/>
<distance name="right_width" value="3"/>
<distance name="bottom_height" value="3"/>

=== Workaround #2 ===
Use the Keyboard shortcuts to adjust window sizes.

With the window to changed the size of selected/active. Press Alt + F8 to start resizing. Use arrow keys to resize.

Pressing Return will save the resize, escape will revert back to original size.

== VMware issues ==

=== piix4_smbus ... Host SMBus controller not enabled ===

In VMware instances from Ubuntu 8 to the current 11.x I often see the boot error message:

piix4_smbus 0000:00:007.3: Host SMBus controller not enabled!

This is because VMware doesn't actually provide that level interface for CPU access. From Kernel documentation for "i2c-piix4" (<kernel source>/Documentation/i2c/busses/i2c-piix4):

"The PIIX4 (properly known as the 82371AB) is an Intel chip with a lot of functionality. Among other things, it implements the PCI bus. One of its minor functions is implementing a System Management Bus. This is a true SMBus - you can not access it on I2C levels. The good news is that it natively understands SMBus commands and you do not have to worry about timing problems. The bad news is that non-SMBus devices connected to it can confuse it mightily. Yes, this is known to happen...

This error can be fixed by adding the extra line to the bottom of /etc/modprobe.d/blacklist.conf:

blacklist i2c_piix4

== VMware Workstation direct shared folders with host PC ==

VMware Workstation provides a the ability to create shared folders so that the Ubuntu virtual machine (VM) directly access data on your host PC.

Original Article : http://www.howtogeek.com/howto/ubuntu/how-to-share-folders-with-your-ubu...

The process is:
# Confirm VMWare shared folders module is running with the command

lsmod | grep vmhgfs

#* If not start it and add it to the boot modules:
#*# Start it with the command

sudo modprobe vmhgfs

#*#: * If that fails you need to install VMWare tools see http://www.howtogeek.com/howto/ubuntu/install-vmware-tools-on-ubuntu-edg...
#*# Add 'vmhgfs' to the /etc/modules file with the command

sudo vim /etc/modules

# Edit the VM settings VM > Settings -> Options (tab)
# Possibly need to reboot
# Mount the shared folder using the vmhgfs filesystem type

sudo mount -t vmhgfs .host:/vmshare /mnt/local

# Profit

'''NOTES:'''
# I have not found a way to make it auto-mount. Adding it to fstab causes boot errors because the vmware modules are not yet loaded.
# On my installation of Ubuntu 11.6 the vmhgfs did not show on a reboot. However, it is not actually loaded until it is needed. Once I issued the command

sudo mount -t vmhgfs .host:/vmshare /mnt/local

it did show up for a lsmod.

== Upgrade From Command Line ==

Needless to say I believe in staying on or darn close to the most current versions. This is for security and for future support reasons. I try to NOT take the most current builds right away (I let the rest of the universe beta test the hyper new stuff).

Problem servers have no GUI and I get to them via ssh. So naturally wanted to use the nice update/upgrade utilities from the command line. Thankfully there is a supported way:

To upgrade the applications and libraries this will do:

$ sudo apt-get update
$ sudo apt-get upgrade  

To upgrade the kernel / OS level this is the way:

$ sudo apt-get update
$ sudo apt-get dist-upgrade

== Run Level / inittab ==

Ubuntu doesn't exactly have a run level it uses [http://upstart.ubuntu.com/ upstart]. There is no real difference between the original run levels 3-5 on Ubuntu.

Ubuntu / Debian Run Levels:
* 0 - Halt
* 1 - Single
* 2 - Full multi-user with display manager (GUI)
* 3 - Full multi-user with display manager (GUI)
* 4 - Full multi-user with display manager (GUI)
* 5 - Full multi-user with display manager (GUI)
* 6 - Reboot

You can find the current run level with the command

runlevel
N 2

== Set Hostname and Static IP Address ==

Edit the files:
* /etc/hostname
* /etc/hosts
* /etc/network/interfaces
* /etc/resolv.conf

== Service Management ==

* Starting services immediately :

sudo invoke-rc.d {service-name} start

* Stopping services immediately :

sudo invoke-rc.d {service-name} stop

* Enabling a service at boot :

sudo update-rc.d {service-name} defaults

* Disabling a service at boot :

sudo update-rc.d {service-name} purge 

=== sysv-rc and sysv-rc-conf ===

http://www.cyberciti.biz/tips/how-to-controlling-access-to-linux-service...

'''Install sysv-rc-conf''' :

sudo apt-get install sysv-rc sysv-rc-conf

* Starting services immediately :

sudo service {service-name} start

* Stopping services immediately :

sudo service {service-name} stop

* Enabling/Disabling boot services :

sudo sudo sysv-rc-conf &

:: [[image:sysv-rc-conf.jpg]]

== Booting Configuration ==

=== Boot to Text Command Terminal ===

Ubuntu 9+ defaults to booting to the X-Window tty () terminal. For Ubuntu server installations where not running X this is annoying because you have to hit to shift to the text terminal. To make Ubuntu directly boot into a text console/command line instead of a X-window do the following.

# Open /etc/default/grub with your text editor with root privilege

sudo vi /etc/default/grub

# Alter the line

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to say

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash text"

# Update GRUB 2 to use the new configuration with the commane

sudo update-grub

When using GRUB2 there is an additional problem (detailed here https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/695658)

The GRUB2 directive "vt.handoff=7" needs to set to "vt.handoff=1" otherwise the system boots to a blank screen and looks dead until ALT-F1 is hit.

# Open the file /etc/grub.d/10_linux

sudo vi /etc/grub.d/10_linux

# Alter the reference to vt.handoff=7

GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT vt.handoff=7"

to either remove it or set it to a lower number (vt.handoff=1 works best)

GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT vt.handoff=1"

.
# Update GRUB 2 to use the new configuration with the commane

sudo update-grub

=== Change Boot TTY Resolution ===

https://help.ubuntu.com/community/ChangeTTYResolution

Using [https://help.ubuntu.com/community/Grub2 GRUB 2] (Ubuntu 9.10 and later):
# Find out what resolutions are available
## Interrupt boot
##* interrupt boot process and display the menu by holding down the SHIFT key until the menu displays on boot - GRUB 2 searches for a depressed SHIFT key signal during boot. If the key is pressed or GRUB 2 cannot determine the status of the key, the menu is displayed.
## press c at the GRUB 2 menu
## enter the command set pager=1 to scroll one page at a time.
## enter the command vbeinfo to find out the available resolutions.
## enter esc Exit back to the menu to finish booting
# Open /etc/default/grub with your text editor with root privilege.
# Add the following new line using your preferred resolution-depth from the list that vbeinfo gave you. It should be like this if you have a 1280x800 screen:

GRUB_GFXPAYLOAD_LINUX=1280x800

# Save the file and exit. (If you can't save the file you haven't opened it as root, go back and execute gksudo gedit /etc/default/grub providing your password.)
# Execute the command

sudo update-grub

# Restart your computer

== GRUB 2 ==

* [https://help.ubuntu.com/community/Grub2 Ubuntu GRUB 2 documentation]
* [http://www.gnu.org/software/grub/manual/ official GRUB 2 manual at GNU site]

== Enable Ctrl+Alt+Backspace ==

Since Ubuntu 9.04, the Ctrl-Alt-Backspace key combination to force a restart of X is disabled by default (to eliminate the problem of accidentally triggering the key combination). However, Ctrl-Alt-Backspace option has been made a X keymap (XKB) option, replacing the X server "DontZap" option and allowing per-user configuration of this setting. As a result, enabling or disabling the Ctrl+Alt+Backspace shortcut can be done from the keyboard preferences on a per user basis.

Enabling Ctrl-Alt-Backspace for Ubuntu 10.+

# Select "System" -> "Preferences" -> "Keyboard"
# Select the "Layouts" tab and click on the "Options" button near the bottom of the dialog.
# Locate and open "Key sequence to kill the X server"
# Enable "Control + Alt + Backspace" by clicking the check box.
# Close all the dialogs.
# Profit

Thread Slivers eBook at Amazon