duminică, 29 ianuarie 2012

THINGS TO TWEAK AFTER INSTALLING UBUNTU 11.10 ONEIRIC OCELOT



Back when Ubuntu 11.04 was released, we wrote a post about stuff you may need to tweak or fix. Some of those tweaks still work but since this is a new version, there are new things that need tweaking so I've decided to make a new post with some popular old tweaks as well as some new ones.

Read on!



General tweaks (for both GNOME Shell and Unity)



Change themes, fonts and more with GNOME Tweak Tool


GNOME Tweak Tool

In Ubuntu 11.10 Oneiric Ocelot you can only switch between the default GTK themes by default. Also, there's no built-in GUI to easily change fonts or icon themes. But you can do this using GNOME Tweak Tool:
sudo apt-get install gnome-tweak-tool

Once installed, GNOME Tweak Tool should show up as "Advanced Settings" in the menu. Besides changing fonts or themes, GNOME Tweak Tool can also be used to enable/disable GNOME Shell extensions, tweak the desktop, various windows behavior or GNOME Shell.



No screensaver in GNOME 3.2


Screensaver

GNOME 3 doesn't have a screensaver, just a black screen. If you want to use a screensaver, you can use Xscreensaver - install it using the following commands (this will also remove gnome-screensaver):

sudo apt-get remove gnome-screensaver sudo apt-get install xscreensaver xscreensaver-gl-extra xscreensaver-data-extra

Then search for "Screensaver" in the menu and tweak its settings to your needs.

To add Xscreensaver to startup, open Startup Applications and add "xscreensaver -nosplash".


Let's also make the lock screen work (CTRL + ALT + L):
sudo ln -s /usr/bin/xscreensaver-command /usr/bin/gnome-screensaver-command

Alternatively, instead of the command above you can open System Settings > Keyboardand on the "Shortcuts" tab, under "System", change the "Lock screen" keyboard shortcut from CTRL + ALT + L to something else, then under "Custom Shortcuts", click the "+" button to add a new custom shortcut, under "Name" enter "Xscreensaver" and under "Command" enter "/usr/bin/xscreensaver-command", then click "Apply". And finally, click next to the newly created shortcut and press CTRL + ALT + L to assign it to it (or use any other keyboard shortcut you want, but make sure it's not already assign to something else).


To be able to watch a movie properly, also install Caffeine:
sudo add-apt-repository ppa:caffeine-developers/ppa sudo apt-get update sudo apt-get install caffeine python-glade2

To revert the changes (go back to the black GNOME Screensaver screen):
sudo apt-get remove xscreensaver xscreensaver-gl-extra xscreensaver-data-extra sudo rm /usr/bin/gnome-screensaver-command sudo apt-get install gnome-screensaver

If you've used the alternative method to assign CTRL + ALT + L to Xscreensaver lock screen, open System Settings > Keyboard again, remove the custom Xscreensaver command and assign CTRL + ALT + L back to "Lock screen" (under "System").



Nautilus search


Partially fix annoying Nautilus behavior that doesn't let you properly search by typing when there are a lot of files/folders: in Nautilus, select View > Statusbar.



Install Syanptic


Synaptic

Synaptic is not installed by default in Ubuntu 11.10 and while Ubuntu Software Center got many new features, it still can't do everything Synaptic can. Install Synaptic back using the following command:
sudo apt-get install synaptic



Disable Overlay Scrollbars


no overlay scrollbars

If you don't like the overlay scrollbars, you can remove them using the following command:
sudo apt-get remove overlay-scrollbar liboverlay-scrollbar3-0.2-0 liboverlay-scrollbar-0.2-0
Then, restart your computer (performing a logout only may not be enough).

To revert this change, install the packages back:
sudo apt-get install overlay-scrollbar liboverlay-scrollbar3-0.2-0 liboverlay-scrollbar-0.2-0
And restart your computer.



Missing features: web apps and file previewer


Two missing GNOME 3.2 features in Ubuntu 11.10 Oneiric Ocelot (for both Unity and GNOME Shell) are the web applications and Sushi quick previewer.


Epiphany web app

The first requires Epiphany 3.2.0 which is available in the WebUpd8 GNOME 3 PPA:
sudo add-apt-repository ppa:webupd8team/gnome3 sudo apt-get update sudo apt-get install epiphany-browser

Sushi file previewer

And the second - Sushi file previewer -, is available in the official Ubuntu repositories:
sudo apt-get install gnome-sushi




Longer battery life


Jupiter

I don't know if the kernel power bug is real or not, but many users have reported that using Jupiter or a tweak we've posted a while back, their laptop/netbook battery life increased. Install Jupiter using the following commands:
sudo add-apt-repository ppa:webupd8team/jupiter sudo apt-get update sudo apt-get install jupiter

If you have an EeePC, also install the following package for SHE support:
sudo apt-get install jupiter-support-eee

As for the other tweak, see this post: Linux Kernel Power Issue / Overheat Workaround.



No more Sun/Oracle Java


The "sun-java6" package is no longer available in the official Ubuntu 11.10 Oneiric Ocelot repositories due to the removal of the JDL license. Java 7 won't be in Oneiric either, but you still have 3 options:

- Install OpenJDK:
sudo apt-get install openjdk-7-jre

- Or Oracle (previously Sun) Java 6 from the LFFL PPA:
sudo add-apt-repository ppa:ferramroberto/java sudo apt-get update sudo apt-get install sun-java6-jdk sun-java6-plugin

- Or manually install Java 7 (JDK) in Ubuntu 11.10 Oneiric Ocelot.



Fix for Nautilus crashing on start


If Nautilus crashes, chances are this is because of the "nautilus-open-terminal" package, so remove it:
sudo apt-get remove nautilus-open-terminal

Then restart Nautilus:
nautilus -q



Autostart items


Nautilus autostart items Ubuntu 11.10

Some applications/services that used to be in the Startup Applications dialog are no longer there. That's because they are hidden now but you can still find them under/etc/xdg/autostart . So if you want to remove the startup sound or other hidden applications from starting automatically, remove their .desktop files from /etc/xdg/autostart (you'll have to run Nautilus as root: "gksu nautilus"). But make sure you make a backup of the files you want to remove firstly!



GNOME Shell tweaks


Fix ALT + F2


Fix alt f2 GNOME Shell

ALT + F2 doesn't work by default in GNOME Shell under Ubuntu 11.10 Oneiric Ocelot. To fix it, open "System Settings" and under Keyboard > Shortcuts > System, click "Disabled" next to "Show the run command prompt" and press ALT + F2 - this should set ALT + F2 for running the command prompt.



Easily change GNOME Shell themes


To be able to easily change the GNOME Shell theme, besides GNOME Tweak Tool you'll also need the User Theme extension, available in the WebUpd8 GNOME3 PPA:
sudo add-apt-repository ppa:webupd8team/gnome3 sudo apt-get update sudo apt-get install gnome-shell-extensions-user-theme

Then use GNOME Tweak Tool to activate the theme.

For more extensions, see: Official GNOME Shell Extensions Available In The WebUpd8 GNOME 3 PPA For Ubuntu 11.10.



Move icons from Message tray (bottom tray) to the Top Bar


GNOME SHell icons top bar

Some might find the notification area icons showing up in the Message Tray (at the bottom of the screen, hidden by default) annoying or confusing. But you can move the icon on the Top Bar using an extension:
sudo add-apt-repository ppa:webupd8team/gnome3 sudo apt-get update sudo apt-get install gnome-shell-classic-systray

Then press ALT + F2 and enter "r" to restart GNOME Shell and enable the extension using GNOME Tweak Tool, then restart GNOME Shell once again.



No shutdown menu entry


Alternative status menu gnome shell extension

By default, there's no shutdown entry in the status menu and you must press and hold ALT to be able to shutdown your computer when using GNOME Shell. But this can be changed by installing Alternative Status Menu extension which adds "Power off" and "Hibernate" to the status menu, visible at all time (and not just when pressing the ALT key). Install it:

sudo add-apt-repository ppa:webupd8team/gnome3 sudo apt-get update sudo apt-get install gnome-shell-extensions-alternative-status-menu

Then use GNOME Tweak Tool to enable the extension.



Fix Nautilus menu being displayed under the GNOME Shell top bar when using transparent GNOME Shell themes


Nautilus menu under gnome shell top bar

If you use a transparent GNOME Shell theme such as Zukitwo, the Nautilus menu shows up behind the top bar. You can fix this either by removing global menu (see below, under "Unity tweaks") or by disabling Nautilus from handling the desktop using GNOME Tweak Tool (under "Desktop", set "Have file manager handle the desktop" to off):

tweak tool handle desktop

Disabling Nautilus from handling the desktop means you won't have any icons on the desktop anymore. If this is a big deal to you, remove AppMenu (Global Menu) - but you won't have a global menu in Unity anymore (though that shouldn't be a big issue if you don't use Unity anyway).

To install GNOME Tweak Tool, see the first tweak in this post.



Automatic login to GNOME Shell instead of Unity


If you enable autologin, your computer will automatically login to Unity. But there is a way to get Ubuntu 11.10 Oneiric Ocelot to automatically login to GNOME Shell.

Firstly, enable Automatic Login: in System Settings go to "User Accounts", then click "Unlock", enter your password and click the button next to "Automatic Login". That will make Ubuntu automatically login to Unity. Let's make it automatically login to GNOME Shell instead:
sudo /usr/lib/lightdm/lightdm-set-defaults -s gnome-shell




Unity tweaks



Configure Unity (autohide, etc.)


CompizConfig Settings Manager UNity settings

Unity 3D can be configured through CompizConfig Settings Manager, but CCSM isn't installed by default so let's install it:
sudo apt-get install compizconfig-settings-manager

Using CCSM you can configure the Unity Launcher reavel mode and timeout, the Unity Launcher autohide (autohide, dodge windows, dodge active windows or disable autohide), various keyboard shortcuts, the new ALT + TAB switcher behavior, blacklight mode, panel and launcher opacity, launcher icon size and more.

A few quick stuff I for one always tweak using CCSM (open CompizConfig Settings Manager and click the "Ubuntu Unity Plugin"):

To disable launcher autohide: on the "Behavior tab" under "Hide Launcher", select "Never".

To disable mounted devices from showing up on the Unity Launcher: on the "Experimental" tab, under "Show Devices" select "Never".

By default, applications that usually take 75% of the screen are maximized automatically on start. To change this automaximize value, on the "Experimental" tab, look for "Automaximize value" - tweak this to whatever value you want.





Configure Unity 2D


Dconf editor

Some Unity 2D settings as well as other tweaks can be performed using "dconf-editor", part of the "dconf-tools" package. Install it using the following command:
sudo apt-get install dconf-tools

Then press ALT + F2 and enter: "dconf-editor" to launch it. You can find the Unity 2D settings under com > canonical > unity-2d.




Re-enable the systray (notification area)


Systray

You no longer need to whitelist Qt applications but you may still need the systray for other applications such as Shutter, Jupiter, etc. You can whitelist the systray using the following command:
gsettings set com.canonical.Unity.Panel systray-whitelist "['all']"

Then log out and log back in.




Disable Global Menu (AppMenu)


Disabled global menu ubuntu

Don't like the global menu? Get the menu back in the application window instead of using a global menu on the top panel:
sudo apt-get remove appmenu-gtk3 appmenu-gtk appmenu-qt

Then, restart your computer (performing a logout only may not be enough).

You can also disable the global menu without removing any package. See HERE.

To revert the changes, install these packages back:
sudo apt-get install appmenu-gtk3 appmenu-gtk appmenu-qt

And restart your computer.




Use a global menu for LibreOffice


Global menu libreoffice

By default, LibreOffice doesn't come with a Global Menu but you can manually install it:
sudo apt-get install lo-menubar

If you experience any issues with it, simply remove it:
sudo apt-get remove lo-menubar


Disable the user switcher indicator


No user switcher indicator

The user switcher indicator (or Me-User-Indicator or whatever is called) can be useful if multiple users log in on your computer but if it's just one user, you can get more space by disabling it. Presuming you've already installed the "dconf-tools" package: press ALT + F2 or open a terminal and enter:
dconf-editor

user switcher

Then navigate to apps > indicator-session and uncheck the box next to "user-show-menu", then restat Unity (ALT + F2 and enter "unity --replace") or log out and log back in.



Something went wrong! How do I reset Unity or Compiz?


You can easily reset Unity or Compiz using the following commands (be careful when using these commands and only use them if you really have to!):

- to reset the Unity launcher icons:
unity --reset-icons

- to reset Unity:
unity --reset

- to reset Compiz:
gconftool-2 --recursive-unset /apps/compiz-1 unity --reset


Using a different "shell"


By default, Ubuntu 11.10 Oneiric Ocelot uses Unity 3D (with Compiz). If you don't like it, you can try a different interface, while still using GNOME:


Unity 2D
Unity 2D

Unity 2D is installed by default and is used as the fall-back mode for computers that can't run Unity 3D. To use Unity 2D, log out and select "Ubuntu 2D" in the login screen:

Ubuntu Unity 2D




GNOME Shell
GNOME Shell

GNOME Shell is not installed by default but you can easily install it from the official Ubuntu repositories:
sudo apt-get install gnome-shell

Once installed, log out and select "GNOME" from the login screen:

GNOME SHell session




Classic GNOME 3 session
Classic GNOME 3 session

You can also use the GNOME 3 classic session. Install it using the following command:
sudo apt-get install gnome-session-fallback

And select "GNOME Classic" from the login screen:

Classic GNOME



I'll continue to update this post with more tweaks so keep an eye on it. If you've found some annoyance in Ubuntu 11.10 Oneiric Ocelot and know a fix / tweak for it, let us know in the comments! For more tweaks, also take a look at our previous post:Things To Tweak / Fix After Installing Ubuntu 11.04 Natty Narwhal.


sâmbătă, 28 ianuarie 2012

What is swappiness and how do I change it?

The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. Because disks are much slower than RAM, this can lead to slower response times for system and applications if processes are too aggressively moved out of memory.

* swappiness can have a value of between 0 and 100
* swappiness=0 tells the kernel to avoid swapping processes out of physical memory for as long as possible
* swappiness=100 tells the kernel to aggressively swap processes out of physical memory and move them to swap cache

The default setting in Ubuntu is swappiness=60. Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation. A value of swappiness=10 is recommended, but feel free to experiment. Note: Ubuntu server installations have different performance requirements to desktop systems, and the default value of 60 is likely more suitable.

To check the swappiness value

cat /proc/sys/vm/swappiness

To change the swappiness value A temporary change (lost on reboot) with a swappiness value of 10 can be made with

sudo sysctl vm.swappiness=10

To make a change permanent, edit the configuration file with your favorite editor:

gksudo gedit /etc/sysctl.conf

Search for vm.swappiness and change its value as desired. If vm.swappiness does not exist, add it to the end of the file like so:

vm.swappiness=10

Save the file and reboot.

How can I move the ubuntu window buttons to the top right of the window?

In this version Ubuntu 11.10 the close, maximize and minimize window buttons are placed at the top left of the window. If you would prefer them to be at the top right of the window, as in previous versions of Ubuntu and Windows, then follow these instructions:

  1. Press Alt+F2 to open the Run Application window.

  2. Type gconf-editor into the text box and click Run to start the Configuration Editor.

  3. Open /apps/metacity/general using the side pane and double-click the button_layout item.

  4. Change the value to say

    :minimize,maximize,close

    (the position of the colon determines which side of the window the buttons appear on).

  5. Click OK and the location of the windows buttons will change immediately.

Spice Up Ubuntu/Linux Terminal With Quotes ( or motd) Each Time It Is Started

Terminal can be boring at times. What if we could add little fun factor to dull terminal? That is what I was wondering since last few days. On Ubuntu/Linux a dynamic message just like motd or to be precise a welcome message can be displayed each time you start a terminal instance even when in GUI mode ( whereas /etc/motd message is shown only on tty or at remote logins.)

For example, greeting like in following image each time you start terminal :

terminal-cowsay0

Installation :

We are going to use two programs namely “fortune” which generates random quotes and “cowsay” which adds some pictures with bubble over its head, just like in cartoons published in newspapers.

sudo aptitude install fortune cowsay


Configuration :

Sample run of “fortune | cowsay -n”

terminal-cowsay1


If you wish to see messages like above but random ones each time you start a new Terminal, you have to edit /etc/bash.bashrc file. Open it with root privileges,

gksudo gedit /etc/bash.bashrc

and add following lines at the end of the file

# Spicing up Terminal fortune | cowsay -n echo

Open new Terminal instance and the quote/motd should be displayed.


Further Customization :

If you want to have static greeting message, add following at the end of /etc/bash.bashrc file

# Spicing up Terminal cowsay YourTextHere echo

which produces :

terminal-cowsay2


cowsay comes with more fun pictures. The list can be found at /usr/share/cowsay/cows/

terminal-cowsay3


If you like any of above cartoons, then your modified line to be added in /etc/bash.bashrc file will be :

fortune | cowsay -n -f tux.cow

terminal-cowsay4

Get randomized cows each time:


Enjoy your new spicy Terminal!

joi, 26 ianuarie 2012

TestDisk, Data Recovery


TestDisk is a powerful free data recovery software! It was primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally deleting a Partition Table). Partition table recovery using TestDisk is really easy.

TestDisk can

* Fix partition table, recover deleted partition
* Recover FAT32 boot sector from its backup
* Rebuild FAT12/FAT16/FAT32 boot sector
* Fix FAT tables
* Rebuild NTFS boot sector
* Recover NTFS boot sector from its backup
* Fix MFT using MFT mirror
* Locate ext2/ext3 Backup SuperBlock
* Undelete files from FAT, NTFS and ext2 filesystem
* Copy files from deleted FAT, NTFS and ext2/ext3 partitions.

TestDisk has features for both novices and experts. For those who know little or nothing about data recovery techniques, TestDisk can be used to collect detailed information about a non-booting drive which can then be sent to a tech for further analysis. Those more familiar with such procedures should find TestDisk a handy tool in performing onsite recovery.
Operating systems

TestDisk can run under

* DOS (either real or in a Windows 9x DOS-box),
* Windows (NT4, 2000, XP, 2003, Vista),
* Linux,
* FreeBSD, NetBSD, OpenBSD,
* SunOS and
* MacOS

Source files and precompiled binary executables are available for DOS, Win32, MacOSX and Linux from the download page
Filesystems

TestDisk can find lost partitions for all of these file systems:

* BeFS ( BeOS )
* BSD disklabel ( FreeBSD/OpenBSD/NetBSD )
* CramFS, Compressed File System
* DOS/Windows FAT12, FAT16 and FAT32
* Windows exFAT
* HFS, HFS+ and HFSX, Hierarchical File System
* JFS, IBM's Journaled File System
* Linux ext2 and ext3
* Linux LUKS encrypted partition
* Linux RAID md 0.9/1.0/1.1/1.2
o RAID 1: mirroring
o RAID 4: striped array with parity device
o RAID 5: striped array with distributed parity information
o RAID 6: striped array with distributed dual redundancy information
* Linux Swap (versions 1 and 2)
* LVM and LVM2, Linux Logical Volume Manager
* Mac partition map
* Novell Storage Services NSS
* NTFS ( Windows NT/2000/XP/2003/Vista/2008/7 )
* ReiserFS 3.5, 3.6 and 4
* Sun Solaris i386 disklabel
* Unix File System UFS and UFS2 (Sun/BSD/...)
* XFS, SGI's Journaled File System
Conclusions and how to use:
this tool can be used from ubuntu live cd and then installed using internet connection or you can use an ubuntu rescue remix live cd and there is a lot of documentation on how to use it here is a formel documication from ubuntu on how to use