Enable TRIM On SSD (Solid-State Drives) In Ubuntu For Better Performance

TRIM allows the OS to “inform a solid-state drive (SDD) which blocks of data are no longer considered in use and can be wiped internally“. Without using TRIM, the SSD speed decreases after a while so if you have a solid-state drive that supports TRIM, you should enable it so your SSD remains fast over time.
This isn’t easy to benchmark because the performance decreases over time so you’d neet to check the SSD speed constantly for a few months to see exactly how the SSD is affected when TRIM is not enabled. But if your SSD read / write speed decreases a lot over time and you haven’t enabled TRIM, this may be way.
Some articles mention using online discard – enabling TRIM by adding the “discard” option to /etc/fstab -, but there are many who say this isn’t a good idea for most solid-state drives and you’ll get a pretty significant performance hit when trying to delete a large number of small files. So below I’ll let you know how to use both of these methods: online discard (not recommended) and the recommended way: using fstrim and a cron (anacron) job.
Note: the instructions below have been tested in Ubuntu, but they may (most probably) work with other Linux distributions as well.
Before enabling TRIM, you must make sure:
you’re using the Linux Kernel 2.6.33 or neweryour SSD supports TRIMthe partition(s) are EXT4 or BTRFS*
* Since not many people are using BTRFS, this post will only cover enabling TRIM on EXT4 partitions.
If you’re unsure if your SSD supports TRIM, you can run the following command:sudo hdparm -I /dev/sda | grep “TRIM supported”
Where “/dev/sda” is the solid-state drive (it may be /dev/sdb, /dev/sdc, etc. for you), and the command should return something like this: “Data Set Management TRIM supported (limit 8 blocks)” (if there’s no output, your SSD doesn’t support TRIM).

Category: Ubuntu | Comments Off on Enable TRIM On SSD (Solid-State Drives) In Ubuntu For Better Performance

Fix Facebook Not Working With Gwibber In Ubuntu 12.10 Or 12.04

Facebook doesn’t currently work with Gwibber (the Facebook feeds aren’t updated – bug HERE) and this bug affects Ubuntu 12.10, 12.04 and probably older Ubuntu versions as well.

Update: This bug also affected Ubuntu 13.04 (currently under development), but a fix was pushed a few minutes after publishing this post. Hopefully the fix will make it into older Ubuntu versions soon.
There is, however, a work-around which I can confirm it works for Ubuntu 12.10 Quantal Quetzal and 12.04 Precise Pangolin – so here’s how to apply it and get Facebook to work with Gwibber again!

gwibber facebook working

1. Open /usr/share/gwibber/plugins/facebook/__init__.py as root with a text editor – we’ll use Gedit so to open the file, run the following command in a terminal:
gksu gedit /usr/share/gwibber/plugins/facebook/__init__.py
2. In the newly opened file, search for the following code:

m[“privacy”][“description”] = data[“privacy”][“description”]
It should be on line 329 for Ubuntu 12.10 (with Gwibber 3.6.0-0ubuntu1) and on line 210 for Ubuntu 12.04. The line number may be different on other Gwibber / Ubuntu versions.
And replace that line with the following code:
if data[“privacy”].has_key(“description”):
m[“privacy”][“description”] = data[“privacy”][“description”]
else:
m[“privacy”][“description”] = “Unknown”Make sure the code is pasted exactly as it’s displayed above, including the spaces in the beginning, or else it won’t work!
Then, save the file. Here’s how the file should look after editing it:

gwibber facebook fix

3. Restart Gwibber Service:
killall gwibber-service
gwibber-service &Then close Gwibber if it was running, start it again and Facebook feeds should now update in Gwibber under Ubuntu 12.10 or 12.04.

Thanks to Ruben Rocha for the tip and Vinu Joseph (jvinu22) for the fix!

Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.



Category: Ubuntu | Comments Off on Fix Facebook Not Working With Gwibber In Ubuntu 12.10 Or 12.04

How To Find Out Maximum Supported RAM Or Number Of Available DIMM Slots In Linux

Dmidecode ubuntuIf you need a quick way to find out how much RAM your Linux system supports or to determine the number of DIMM slots available, you can use a command line tool called “dmidecode”.
To find out the maximum RAM capacity and the number of RAM slots available, use the following command:sudo dmidecode -t 16
The output should look something like this:
# dmidecode 2.11
SMBIOS 2.6 present.

Handle 0x0032, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 16 GB
Error Information Handle: Not Provided
Number Of Devices: 4

The “Maximum Capacity” is the maximum RAM supported by your system, while “Number of Devices” is the number of memory (DIMM) slots available on your computer.
To see complete memory information, including the info above along with currently installed memory information (RAM speed, size, etc.), use:sudo dmidecode -t memory
Here’s an example output for the command above:

# dmidecode 2.11
SMBIOS 2.6 present.

Handle 0x0032, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 16 GB
Error Information Handle: Not Provided
Number Of Devices: 4

Handle 0x0033, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 2048 MB
Form Factor: SODIMM
Set: None
Locator: ChannelA-DIMM0
Bank Locator: BANK 0
Type: DDR3
Type Detail: Synchronous
Speed: 1333 MHz
Manufacturer: Samsung
Serial Number: 7732E9D6
Asset Tag: 9876543210
Part Number: M471B5773DH0-CH9
Rank: Unknown

Handle 0x0035, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: ChannelA-DIMM1
Bank Locator: BANK 1
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: 9876543210
Part Number: Not Specified
Rank: Unknown

Handle 0x0036, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 4096 MB
Form Factor: SODIMM
Set: None
Locator: ChannelB-DIMM0
Bank Locator: BANK 2
Type: DDR3
Type Detail: Synchronous
Speed: 1333 MHz
Manufacturer: 830B
Serial Number: A74D1715
Asset Tag: 9876543210
Part Number: NT4GC64B8HG0NS-CG
Rank: Unknown

Handle 0x0038, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: ChannelB-DIMM1
Bank Locator: BANK 3
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: 9876543210
Part Number: Not Specified
Rank: Unknown

You can also use lshw (among others) for this (firstly, install it; in Ubuntu: “sudo apt-get install lshw):lshw -short -C memory

It’s important to note that Dmidecode reports system hardware information as described in the BIOS and does not scan your hardware, so in some cases the output can be wrong. Running dmidecode on my Dell XPS L702X non-3D laptop, the output says my system should have 4 RAM slots but in fact there are only 2 and only the 3D version of my laptop can have 4 RAM slots (and by the way, there are some Windows applications reporting the same thing).

Also see: How To Get Hardware Information In Linux

Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.



Category: Ubuntu | Comments Off on How To Find Out Maximum Supported RAM Or Number Of Available DIMM Slots In Linux

How To Find Out Maximum Supported RAM Or Number Of Available DIMM Slots In Linux

Dmidecode ubuntuIf you need a quick way to find out how much RAM your Linux system supports or to determine the number of DIMM slots available, you can use a command line tool called “dmidecode”.
To find out the maximum RAM capacity and the number of RAM slots available, use the following command:sudo dmidecode -t 16
The output should look something like this:
# dmidecode 2.11
SMBIOS 2.6 present.

Handle 0x0032, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 16 GB
Error Information Handle: Not Provided
Number Of Devices: 4

The “Maximum Capacity” is the maximum RAM supported by your system, while “Number of Devices” is the number of memory (DIMM) slots available on your computer.
To see complete memory information, including the info above along with currently installed memory information (RAM speed, size, etc.), use:sudo dmidecode -t memory
Here’s an example output for the command above:

# dmidecode 2.11
SMBIOS 2.6 present.

Handle 0x0032, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 16 GB
Error Information Handle: Not Provided
Number Of Devices: 4

Handle 0x0033, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 2048 MB
Form Factor: SODIMM
Set: None
Locator: ChannelA-DIMM0
Bank Locator: BANK 0
Type: DDR3
Type Detail: Synchronous
Speed: 1333 MHz
Manufacturer: Samsung
Serial Number: 7732E9D6
Asset Tag: 9876543210
Part Number: M471B5773DH0-CH9
Rank: Unknown

Handle 0x0035, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: ChannelA-DIMM1
Bank Locator: BANK 1
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: 9876543210
Part Number: Not Specified
Rank: Unknown

Handle 0x0036, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 4096 MB
Form Factor: SODIMM
Set: None
Locator: ChannelB-DIMM0
Bank Locator: BANK 2
Type: DDR3
Type Detail: Synchronous
Speed: 1333 MHz
Manufacturer: 830B
Serial Number: A74D1715
Asset Tag: 9876543210
Part Number: NT4GC64B8HG0NS-CG
Rank: Unknown

Handle 0x0038, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: ChannelB-DIMM1
Bank Locator: BANK 3
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: 9876543210
Part Number: Not Specified
Rank: Unknown

You can also use lshw (among others) for this (firstly, install it; in Ubuntu: “sudo apt-get install lshw):sudo lshw -C memory

It’s important to note that Dmidecode reports system hardware information as described in the BIOS and does not scan your hardware, so in some cases the output can be wrong. Running dmidecode on my Dell XPS L702X non-3D laptop, the output says my system should have 4 RAM slots but in fact there are only 2 and only the 3D version of my laptop can have 4 RAM slots (and by the way, there are some Windows applications reporting the same thing), however, the command is accurate about it supporting 16 GB of RAM.

Also see: How To Get Hardware Information In Linux

Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.



Category: Ubuntu | Comments Off on How To Find Out Maximum Supported RAM Or Number Of Available DIMM Slots In Linux

How To List Packages From A PPA / Repository In Ubuntu

A few weeks ago, we saw how to find out to which PPA / repository a package belongs to in Ubuntu / Debian. But how about getting a list of packages available in a PPA / repository?

Synaptic
To get a list of packages available in a PPA / repository enabled on your system (if the repository is disabled or not added on your system, it won’t show up here), firstly install Synaptic if you haven’t already:
sudo apt-get install synaptic
(or install Synaptic GTK3)

Then open Synaptic, select “Origin” on the bottom left, then select a PPA or repository on the left and it should list all packages in that PPA / repository for your Ubuntu version, both installed and not installed:
Synaptic origin
In the latest Synaptic built with GTK3, there are two entries for each PPA here, one that uses “/now” at the end, which displays the packages you’ve installed from a repository and another one which displays all the packages available in that repository.
Important: if the exact same package (including the package version) exists in two or more PPAs / repositories, it will only be listed for one repository entry in Synaptic. That’s why I’ve added other ways of doing this (see below), which list all the packages, even if the package exists in other PPAs / repositories.

Command line
You can also do this using a command like the one below, but this will only list the package names, without any additional info (no version, description, etc.):awk ‘$1 == “Package:” { if (a[$2]++ == 0) print $2; }’ /var/lib/apt/lists/*PPA-FIRST-PART*PPA-SECOND-PART*Packages
where “PPA-FIRST-PART” is the first part of a PPA, e.g. for the ppa:nilarimogard/webupd8 PPA, “PPA-FIRST-PART” is “nilarimogard” and “PPA-SECOND-PART” is “webupd8”.

Let’s try it out:
awk ‘$1 == “Package:” { if (a[$2]++ == 0) print $2; }’ /var/lib/apt/lists/*nilarimogard*webupd8*Packages
And here’s the terminal output:

list packages ppa terminal
(I’ve tweaked the original command – see the credits -, to remove duplicate lines which would occur on 64bit systems with multi-arch support).
This works for regular repositories too, e.g. to see all the packages available in the proposed repository:awk ‘$1 == “Package:” { if (a[$2]++ == 0) print $2; }’ /var/lib/apt/lists/*proposed*Packages
Or, to see the packages available in the security multiverse repository:
awk ‘$1 == “Package:” { if (a[$2]++ == 0) print $2; }’ /var/lib/apt/lists/*security*multiverse*Packages

Using Y PPA Manager
Y PPA Manager, a small application I’ve created, can list all the packages available in each PPA added on your system. It doesn’t work with regular repositories (just Launchpad PPAs) though and the PPA needs to be enabled on your system for this to work. So it’s not perfect.
But there are advantages over Synaptic / the command above:
unlike Synaptic, it lists all the packages in a PPA, even if the exact same package (exact version) is available in multiple PPAs;unlike the command above, Y PPA Manager displays the package version next to the package name.
List packages PPA Y PPA Manager
To lists all the packages in a PPA, install Y PPA Manager:
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt-get update
sudo apt-get install y-ppa-manager
Then launch Y PPA Manager, double click “Manage PPAs”, select the PPA and click “List packages”.

some info via AskUbuntu & UsemosLinux

Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.



Category: Ubuntu | Comments Off on How To List Packages From A PPA / Repository In Ubuntu

Add a "New Empty File" Entry To Nautilus 3.6 Context Menu

As you probably know, a small but useful feature – at least for me -, was removed from Nautilus 3.6 (and newer): the context menu option to create a new empty text file. So here’s a quick tip on how to get this feature back.
nautilus 3.6 new empty file
Nautilus 3.6 is not used by default in Ubuntu 12.10, but it can be installed from the GNOME 3 PPA.

The instructions below will add a “New empty file” entry to the Nautilus 3.6 context (right click) menu by using a tiny extension. To do this, open a terminal and copy/paste the following commands:mkdir -p /.local/share/nautilus-python/extensions
gedit ~/.local/share/nautilus-python/extensions/nautilus-acme.py
In the file that opens in Gedit (nautilus-acme.py), paste the code from HERE, then save the file.
And finally, restart Nautilus using the following command:
nautilus -q
You should now have a “New empty file” context menu entry in Nautilus 3.6 like in the screenshot above (tested with 3.6, but it might work in newer versions like 3.7).

Update: for an alternate method using “Templates”, see THIS AskUbuntu post.
thanks to notes & snippets for the extension!

Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.



Category: Ubuntu | Comments Off on Add a "New Empty File" Entry To Nautilus 3.6 Context Menu

Add a "New Empty File" Entry To Nautilus 3.6 Context Menu

As you probably know, a small but useful feature – at least for me -, was removed from Nautilus 3.6 (and newer): the context menu option to create a new empty text file. So here’s a quick tip on how to get this feature back.
nautilus 3.6 new empty file
Nautilus 3.6 is not used by default in Ubuntu 12.10, but it can be installed from the GNOME 3 PPA.

The instructions below will add a “New empty file” entry to the Nautilus 3.6 context (right click) menu by using a tiny extension. To do this, open a terminal and copy/paste the following commands:mkdir -p ~/.local/share/nautilus-python/extensions
gedit ~/.local/share/nautilus-python/extensions/nautilus-acme.py
In the file that opens in Gedit (nautilus-acme.py), paste the code from HERE, then save the file.
And finally, restart Nautilus using the following command:
nautilus -q
You should now have a “New empty file” context menu entry in Nautilus 3.6 like in the screenshot above (tested with 3.6, but it might work in newer versions like 3.7).

Update: for an alternate method using “Templates”, see THIS AskUbuntu post.
thanks to notes & snippets for the extension!

Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.



Category: Ubuntu | Comments Off on Add a "New Empty File" Entry To Nautilus 3.6 Context Menu

How To Find Out To Which PPA Repository A Package Belongs To

There are various reasons why you may need to find out to which PPA a package belongs to, for instance, in case a package in a PPA breaks something on your system, if you want to install a package which is already installed on your computer on some other machine but you don’t know the PPA you’ve used to install it and so on.

So here’s a quick tip on how to find out to which PPA a package belongs to.

Category: Ubuntu | Comments Off on How To Find Out To Which PPA Repository A Package Belongs To

GNOME Shell: How To Enable Notifications In The Lock Screen

gnome shell lock screen notificationsGNOME Shell 3.6 got a neat feature which allows notifications to be displayed in the lock screen.

The lock screen notifications are turned off by default in GNOME Shell 3.6 due to privacy concerns, although the actual notification text is not displayed in the lock screen and only the number of notifications and the application reponsible for sending the notifications show up. So here’s a quick tip on how to enable it. Open a terminal and copy/paste the following command:gsettings set org.gnome.desktop.screensaver show-notifications true
This can also be done by using Dconf-editor, by navigating to org > gnome > desktop > screensaver and enabling “show-notifications”.
After enabling this option, you’ll get music player controls and the number of unread notifications in the GNOME Shell lock screen, like you can see in the screenshot above.
If you want to disable the notifications from showing up in the GNOME Shell lock screen, use:gsettings set org.gnome.desktop.screensaver show-notifications false
Thanks to Dylan McCall for the tip!

Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.



Category: Ubuntu | Comments Off on GNOME Shell: How To Enable Notifications In The Lock Screen

Ubuntu Multi-Monitor Tweaks (Full Screen Flash Fixes, Span Wallpaper Across Monitors, More)

If you are using a multi-monitor setup in Ubuntu, here are a few tips which should help you fix some annoyances, like:
get full screen flash videos to be displayed on any monitorget flash videos to remain full screen while working in the other desktopa tweak to move windows to a different display using keyboard shortcutshow to extend the wallpaper across monitors or use a different wallpaper for each monitor

Move window to a specific display using a keyboard shortcut
Ubuntu (with Compiz/Unity) lets you move a window to a specific virtual desktop using keyboard shortcuts, but by default, this doesn’t work if you want to move a window to a specific monitor.
There is, however, an easy way of easily moving windows to a specific display using keyboard shortcuts so here’s what you must do.
Firstly, install CCSM if it’s not already installed:sudo apt-get install compizconfig-settings-manager
Then open CompizConfig Settings Manager, search for the “Put” plugin (it’s under Window Management) and enable it. Then, click the plugin so we can change some of its settings.
ccsm put plugin
On the “Bindings” tab, click on “Disabled” next to the “Put to Next Output” keyboard shortcut, check the “Enabled” box and then assign it a key combination that’s not already in use. I’ve used Ctrl + Tab (click on “Grab key combination” to set a keyboard shortcut). Then click ok and you’re done.
Now, focus a window and press the keyboard combination you’ve used above: the window should move to the other workspace. If you only have to monitors, this should be enough, as it moves any window from one monitor to the other. If you have more than 2 monitors, you can assign keyboard shortcuts for “Viewport Left” and “Viewport Right” and so on, under “Put to adjacent viewport”.

Get full screen flash videos to work on any monitor
In some cases (or maybe always?), full screen Flash videos show up on the primary monitor, even if you’ve clicked the full screen button while using some other monitor. The above solution works with these full screen Adobe Flash videos too: click a video, then press the key combination you’ve set up and the video should move to the other display.
So there you have it, now you can move the full screen flash videos on any monitor you want.

Get Flash videos to remain full screen when working (clicking) in the other desktop
The above solution fixes full screen Flash video showing up on the wrong display, but there’s another annoying issue with Flash: if you’re watching a full screen video on one monitor and want to work on another monitor, the flash video exists full screen. Basically, unless the full-screen flash video is focused, it exists full-screen.
There are some fixes and workarounds for this full screen Flash exiting when it’s unfocused too:
1. The first one is using an extension which resizes Flash videos to fill the whole browser window and you can then set the browser to full screen by pressing F11 or selecting View > Full screen:for Google Chrome / Chromium: MaximizeFlashfor Firefox: Flash Game Maximizer (the button to resize video to fit the whole browser window is on the addon bar so to show it, select View > Toolbars > Addon Bar). This extension doesn’t work properly with YouTube though but you can set YouTube to use HTML5 by going to http://youtube.com/html5firefox flash full windowAfter getting the video to fill the whole browser window, hit F11 or select View > Full screen

2. Below is another solution for this issue, that fixes Adobe Flash for any browser, except Google Chrome.
The reason flash videos exit full screen when clicking anywhere on the other monitor is because that’s the behaviour wanted by Adobe. Adobe Flash is not open source, but we can still modify its code using a tools such as GHex.
To install GHex in Ubuntu, use the following command:sudo apt-get install ghex
Now, find out where your Flash plugin is installed using the following commands:sudo updatedb
locate libflashplayer.so
The “locate” command above should return the full path to libflashplayer.so. Copy it because you’ll need it for the next command:gksu ghex /path/to/libflashplayer.so
Where “/path/to/” is the path to libflashplayer.so you’ve copied above (usually it should be /usr/lib/flashplugin-installer/libflashplayer.so or /usr/lib/adobe-flashplugin/libflashplayer.so)

Now, editing a binary with GHex is tricky, so read everything carefully.

Category: Ubuntu | Comments Off on Ubuntu Multi-Monitor Tweaks (Full Screen Flash Fixes, Span Wallpaper Across Monitors, More)