Thursday, May 12, 2016

How to speed up and tweak Ubuntu 16.04

1.Unity Tweak Tool:

Unity Tweak Tool is a settings manager for the Unity desktop. It provides users with a fast, simple and easy-to-use interface with which to access many useful and little known features and settings of the desktop environment that one may want to configure.


To install unity tweak tool copy paste the the following commands into your terminal 

(ctrl+alt+t) :

sudo apt install unity-tweak-tool


then


unity-tweak-tool


(Unity Tweak Tool can be opened by doing a Dash search as well )






To speed up Unity go to General  set texture quality to fast under hardware acceleration and turn off animations .


2.Install Compiz Config :

Compiz is a compositing window manager for the X Window System, using 3D graphics hardware to create fast compositing desktop effects for window management. Effects, such as a minimization animation or a cube workspace, are implemented as loadable plugins.

To install CompizConfig , open a terminal (ctrl+alt+t) :


sudo apt install compiz compizconfig-settings-manager 


After the installation is done you can open the settings-manager 


from Dash .


Go to Composite and uncheck Detect Refresh Rate:



Hit back and return to the main configuration window . Next click on OpenGL and uncheck
Sync to VBlank. (caution using compizconfig-settings-manager as it can break your system)


3.Moving Temporary Files to Memory (RAM):

Before starting this process it’s a good idea to backup the fstab file:


sudo cp /etc/fstab /etc/fstab.bak


The next step is to edit fstab:

sudo gedit /etc/fstab 


Add the following lines at the end of the file :


tmpfs /tmp tmpfs defaults,noatime,size=1G,mode=1777 0 0

tmpfs /var/tmp tmpfs defaults,noatime,mode=1777 0 0
tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0 
tmpfs /var/log/apt tmpfs defaults,noatime 0 0




The first line mounts /tmp in memory with a size limit of 1 gig. This may be larger than you need. If you exceed this limit the swap area will be used.
The second line mounts /var/tmp into memory. The third mounts the logfiles in /var/log–note this means that a reboot will clear your log files which may not be what you want. The fourth line mounts the temporary files associated with apt into memory.
The new mount points will become active on your next reboot.

4.Control Startup Applications:
Ubuntu hides most of the system’s default autostart entries from this dialog. To view them, run the following command in a terminal:

sudo sed -i "s/NoDisplay=true/NoDisplay=false/g" /etc/xdg/autostart/*desktop

Don’t disable an autostart entry unless you understand what it does.
5. Tune Swappiness

If you have alot of RAM this tweak is for you . The swappiness value controls the Linux kernel's tendency to swap - that means moving information out of RAM and onto the swap file on the disk. It accepts a value between 0 and 100. In order to change swappiness value we need to edit /etc/sysctl.conf :

sudo gedit /etc/sysctl.conf
Look for vm.swappiness in the file and change its value. If it doesn’t exist, add it to the end of the file on a new line.

vm.swappiness=1 (1” is the minimum possible “active swapping” setting while “0” means disable swapping completely and only revert to when RAM is completely filled. Using these settings in low-spec systems of 2GB RAM or less may cause freezes and make the OS completely unresponsive)




Save the file after making the change.


Optional

6. Install Preload: 
Preload is an adaptive readahead daemon that prefetches files mapped by applications from the disk to reduce application startup time.

sudo apt-get install preload

7. Disable Ping Response:

sudo gedit /etc/sysctl.conf

and add the following line at the bottom page . Make sure there is no "#" ahead of the line as it will uncomment it :

net.ipv4.icmp_echo_ignore_all=1


Other network tweaks  

In the same file you can also add :

net.core.somaxconn = 1000
net.core.netdev_max_backlog = 5000
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_wmem = 4096 12582912 16777216
net.ipv4.tcp_rmem = 4096 12582912 16777216
net.ipv4.tcp_max_syn_backlog = 8096
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.ip_local_port_range = 10240 65535



Once you have completed editing the file save the file and close it.


Before network tweaks:



After:



Friday, May 6, 2016

Keep your Browser profile in RAM for reduced disk write and increased performance

Profile-sync-daemon (psd) is a tiny pseudo-daemon designed to manage your browser's profile in tmpfs and to periodically sync it back to your physical disc (HDD/SSD). This is accomplished via a symlinking step and an innovative use of rsync to maintain back-up and synchronization between the two. One of the major design goals of psd is a completely transparent user experience.

To install profile-sync-daemon open a terminal (ctrl+alt+t) and type in the following commands :

sudo add-apt-repository ppa:graysky/utils
sudo apt-get update
sudo apt-get install profile-sync-daemon

To edit the configuration open the this file via terminal :

sudo gedit /home/USERNAME/.config/psd/psd.conf


Uncomment (remove#)  #BROWSERS"" so it looks like this :

 BROWSERS "firefox chromium" 

This serves as an example , fill in the quotes with the browsers you are using. If you do not uncomment this line all the supported browser profiles will use tmpfs.
Beginning with version 5.54 of psd, native support for overlayfs is included. Uncomment the USE_OVERLAYFS="yes" line to enable it rather than the default full copy to reduce the memory costs and to improve sync/unsync operations.


Next we are going to use the parse command :

profile-sync-daemon parse 

The 'parse' option can be called to show users exactly what psd will do/is doing based on $/home/USERNAME/.config/psd/psd.conf as well printout useful information such as profile size and paths.


After installing and configuring profile-sync-daemon restart your PC .

Saturday, April 30, 2016

AMD open-source (Radeon) graphics driver on Ubuntu 16.04


First step will be identifying your graphics chip :
lspci -nn | grep VGA

In Ubuntu 16.04 LTS the open-source driver AMDGPU is enabled by default for the latest cards (https://help.ubuntu.com/community/RadeonDriver).

The next step will be adding the oibaf ppa and doing a system upgrade (ctrl+alt+t) :

sudo add-apt-repository ppa:oibaf/graphics-drivers (https://launchpad.net/~oibaf/+archive/ubuntu/graphics-drivers)
sudo apt install mesa-vdpau-drivers
sudo apt update

sudo apt upgrade 
sudo apt dist-upgrade 

AMD Radeon 9500 and newer GPUs are supported by the mesa-vdpau package.

For better results we will use "dpm" method to improve GPU power management.


For the most recent ATI/AMD graphic cards supported by the Radeon driver, DPM (Dynamic Power Management) should work automatically without additional steps.
Instead if you notice overheating problems and/or you have an old Radeon HD graphic card, you can enable DPM by adding a boot parameter. This should greatly help power consumption, especially when idle. To do so, edit /etc/default/grub and add the 'radeon.dpm=1' to the GRUB_CMDLINE_LINUX_DEFAULT line, so it would look something like:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash radeon.dpm=1"
After you save/quit the text editor, update grub:

sudo update-grub

You can use 3 profiles for DPM :
  • battery
  • balanced
  • performance
Balanced is the most useful one . To enable it type the following in a terminal :

sudo gedit /etc/rc.local

add the following lines in this file (above the line that says "exit 0")


echo balanced > /sys/class/drm/card0/device/power_dpm_state

Save the file and reboot your pc .

The GPU power management can also be configured using TLP which  brings you the benefits of advanced power management for Linux without the need to understand every technical detail. TLP comes with a default configuration already optimized for battery life, so you may just install and forget it. Nevertheless TLP is highly customizable to fulfill your specific requirements. These tweaks will also help with overheating issues!

To avoid any conflicts make sure laptop-mode-tools or cpufrequtils are not installed :


sudo apt remove laptop-mode-tools
sudo apt remove cpufrequtils
Reboot your PC.

To install it open a terminal and type in the following commands (ctrl+alt+t) :

sudo apt install tlp tlp-rdw

To edit tlp configuration type the following command into the terminal :

sudo gedit /etc/default/tlp

TLP comes preconfigured for battery saving , however I have added a more aggressive  power saving configuration, this will work very well on systems with multicore CPU's . Ubuntu is optimized to spread the load on all cores . Make sure to uncomment (remove "#" before editing a line to enable it)




For increased performance the "#CPU_BOOST" can be uncommented by removing "#". For powersaving there is no need for any changes to the existing line .






Save and close the file and start tlp :

sudo tlp start

To set tlp in Battery Mode type in sudo tlp batt , for AC Mode we can use the command sudo tlp ac .



Top 7 things to do after installing Ubuntu 16.04

1.Enable Partner Repositories : 

The partner repositories are another source of software , but for those with restrictive licenses that mean the general public cannot simply share them. These are official repo's that already are added but disabled in Ubuntu. This command enables them. Software&Updates can be accessed through system-settings or by doing a Dash search.



After enabling the repository we are going to do a system update & upgrade :




2.Adjust privacy settings :




 3.Installing firewall GUI for easier firewall control:

sudo apt install gufw (for firewall GUI)
sudo gufw



(To enable firewall via command line open a terminal and type in  sudo ufw enable) 


4.Install Synaptic & Gdebi package tools:

sudo apt install synaptic sudo apt install gdebi 

5.Enable DVD playback on Ubuntu :

Since Medibuntu is no longer available, you have to install libdvdcss2 repository manually. Download it from the link below:


6.Install VLC for video and audio playback: 

sudo apt install vlc 

7.Install ubuntu-restricted-extras : 

sudo apt install ubuntu-restricted-extras

Optional :

Flash player has become obsolete  and will be installed along with ubuntu-restricted-extras . Use the following command to remove it :

sudo apt remove flashplugin-installer


Wednesday, March 30, 2016

f.lux on Ubuntu

"Light at night is bad for your health, and exposure to blue light emitted by electronics and energy-efficient lightbulbs may be especially so.
Until the advent of artificial lighting, the sun was the major source of lighting, and people spent their evenings in (relative) darkness. Now, in much of the world, evenings are illuminated, and we take our easy access to all those lumens pretty much for granted.
But we may be paying a price for basking in all that light. At night, light throws the body’s biological clock—the circadian rhythm—out of whack. Sleep suffers. Worse, research shows that it may contribute to the causation of cancer, diabetes, heart disease, and obesity.
But not all colors of light have the same effect. Blue wavelengths—which are beneficial during daylight hours because they boost attention, reaction times, and mood—seem to be the most disruptive at night. And the proliferation of electronics with screens, as well as energy-efficient lighting, is increasing our exposure to blue wavelengths, especially after sundown." (http://www.health.harvard.edu/staying-healthy/blue-light-has-a-dark-side)

f.lux adapts the display settings based on your location to the time of day, warm at night and like sunlight during the day.
It can be installed on Ubuntu via ppa . To begin open a terminal (ctlr+alt+t) and use the following commands : 
sudo add-apt-repository ppa:nathan-renniewaldock/flux
sudo apt-get update 

sudo apt-get install fluxgui

Once installed you can launch the application from Dash and configure it using the GUI based indicator applet . 




The settings can be adjusted by right clicking the applet and selecting preferences : 


To work properly f.lux needs to know your coordinates (latitude and longitude)  


There are 5 temperature settings that can be adjusted to your own preference :  



Wednesday, March 16, 2016

How to install and use Bleachbit on Ubuntu


BleachBit is a free and open-source disk space cleaner, privacy manager, and computer system optimizer. 

"BleachBit quickly frees disk space and tirelessly guards your privacy. Free cache, delete cookies, clear Internet history, shred temporary files, delete logs, and discard junk you didn't know was there. Designed for Linux and Windows systems, it wipes clean a thousand applications including Firefox, Internet Explorer, Adobe Flash, Google Chrome, Opera, Safari,and more. Beyond simply deleting files, BleachBit includes advanced features such as shredding files to prevent recovery, wiping free disk space to hide traces of files deleted by other applications, and vacuuming Firefox to make it faster. Better than free, BleachBit is open source."(https://www.bleachbit.org/)

The latest version for Linux is 1.10 and these are the changes that have been made since version 1.8 :

  • Clean more localizations (thanks to Tristan Stenner).
  • Add localization codes (thanks to Tristan Stenner).
  • Add .rpm installation package for Fedora 22.
  • Fix memory cleaning on Ubuntu 15.10 and other distributions (reported by Richard Pearse).
  • Fix harmless error that localizations.xml is unusable (thanks to Tristan Stenner).
  • Do not show localizations at the base level (reported by BBUser).
  • Do not show Windows Explorer cleaner on Linux (reported by Tom├ís F. L.).
  • Fulfill Fedora license file location change.
  • Do not delete xauth under KDE (reported by mike).
  • Remove deprecated key encoding in bleachbit.desktop.
  • Drop support for Mandriva, which is dead.
  • Do not show cleaner is unusable message in the console (except when debug mode is enabled or in non-final releases).
Bleachbit (1.8) is available in the Ubuntu repositories and can be installed with a simple command via terminal (ctrl+alt+t ) :

sudo apt-get install bleachbit 

For a more up to date version (1.10) download the .deb file from here . The file can be installed by navigating to its location -> right click - > Open With -> Gdebi Package Installer -> Install .

If gdebi is not available on your system you can install it by using this command :

sudo apt-get install gdebi

Once installed Bleachbit can be launched from Dash . Proceed with caution when selecting the items you want to delete and make sure you understand what you are doing :









Tuesday, March 8, 2016

How to disable and remove Apport

Ubuntu 14.04 ships with Apport Error Reporting enabled by default, and as a result, you may experience Internal System Error popups inside Ubuntu. They are part of Apport, an internal debugger which automatically generate reports to submit for packages that crash. Apport can be disabled and removed by using the following commands in a terminal (ctlr+alt+t) :

sudo service apport stop 

sudo apt-get purge apport

"Apport is a system which
  • intercepts crashes right when they happen the first time,
  • gathers potentially useful information about the crash and the OS environment,
  • can be automatically invoked for unhandled exceptions in other programming languages (e. g. in Ubuntu this is done for Python),
  • can be automatically invoked for other problems that can be automatically detected (e. g. Ubuntu automatically detects and reports package installation/upgrade failures from update-manager),
  • presents a UI that informs the user about the crash and instructs them on how to proceed,
  • and is able to file non-crash bug reports about software, so that developers still get information about package versions, OS version etc." (https://wiki.ubuntu.com/Apport)


Apport is safe to remove as it "collects potentially sensitive data, such as core dumps, stack traces, and log files. They can contain passwords, credit card numbers, serial numbers, and other private material. This is mitigated by the fact that it presents you what will be sent to the bug tracker, and that all crash report bugs are private by default, limited to the Ubuntu bug triaging team." (https://askubuntu.com/questions/139424/is-it-safe-to-remove-apport)