Wednesday, 29 January 2014

Hardware and Drivers on Linux

How to see hardware details

An easy way is to see it using a GUI:
a) $ sudo apt-get install hardinfo
b) $ sudo apt-get install sysinfo

When thebrigthness does not work properly:

Some very usefull linux commands to see hardware/drivers details, (overall or specific)

For more specific information about drivers, use command dmesg:
dmesg will give us details about hardware drivers connected to, disconnected from a machine and any errors when hardware driver is loaded into the kernel

To see several details of the pci slots such as network card, sound card, etc:

$ lspci, all information together
lspci   -vmm   -->Shows Information in a more understandable format.

To see the, Kernel driver in use, add the -v parameter

For example, here we can see the details of a wireless device that present an error. Actually the wireless was not working on that moment.

$ lspci -v
08:00.0 Network controller: Intel Corporation Centrino Wireless-N 2230 (rev c4)
Subsystem: Intel Corporation Centrino Wireless-N 2230 BGN
Flags: fast devsel, IRQ 47
Memory at c1500000 (64-bit, non-prefetchable) [disabled] [size=8K]
Capabilities: [c8] Power Management version 3
Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [e0] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Device Serial Number 60-6c-66-ff-ff-43-d3-ed
Kernel driver in use: iwlwifi

Details for lsusb


How to see the modules or driver installed, add and remove new ones.

Monitor commands  
Use the command watch
$ watch ifconfig

Use command free to understand details about ram
$ free
More about ram


$ ip link show  -> will show details about the active connection : state DOWN or state UP

Details about a network card driver
............:~$ ethtool -i wlan0
driver: iwlwifi
version: 3.8.0-35-generic
bus-info: 0000:08:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no

* Complete network card software details like speed, modes, negotiations, link status etc.
.....$ ethtool eth0

* Complete network card hardware details.
....$  lshw -class network

Finally to detect errors,  you can run complete test from ubuntu for example from gui. It will internally run several of the command above.
Just write "System Testing" on ubuntu where you find for programs and click on continue and so on.

Note: You can use grep in your commands to filter lines and just see what is interesting for you.
$ grep "boo" file.html -> will find all the lines that have boo inside the file file.html
$ grep -v "boo" file.html -> will do the opposite. It will return all line except the ones that have boo.

Saturday, 25 January 2014

Adding Java to several browsers

According to the official Java documentation, since  the Java SE 6 update 10 release , Oracle introduced the a new Java Plug-in designed to work in the following browsers:
  • Internet Explorer 6 and 7 on Windows XP and Vista
  • Firefox 3 and up on Windows XP, Windows Vista, Solaris and Linux

When you download Java (jdk or jre), you will have a file called
Take into account that in a i386 architecture, its path would be something like

In contrast, in a amd64 architecture, the path would be something like:

That file have to be located inside the adequate directory of the corresponding browser and that is all.
Here you have the details depending on your browser:

1) Firefox
 * Go to the adequate firefox directory
   a) Find the application's general directory and enter to the plugins subdirectory
   b) Go to the directory from your home ~/.mozilla/plugins

* Create a symbolic link inside plugins where the necessary file from java is pointing to that plugins subdirectory.
  ln -s  <JDK>/<JRE>/lib/i386/ . 
* Restart firefox.

2) Chrome
* Go to the adequate directory
      cd /opt/google/chrome/plugins/ 
(if plugins subdirectory does not exist, create it.)

* Create a symbolic link inside plugins where the necessary file from java is pointing to that plugins subdirectory.
   ln -s <JDK>/<JRE>/lib/i386/ .

Note: O Chrome não suporta o Java 7 na plataforma Mac. 

3) Opera
* Go to the adequate directory
      cd /usr/lib/opera/plugins
* Create a symbolic link inside plugins where the necessary file from java is pointing to that plugins subdirectory.
   ln -s <JDK>/<JRE>/lib/i386/ .

In order to test if your browser has already java, you can go to:
and click in the "Verify Java version" button

That's all, restart your browser and you will have java working properly.

Monday, 20 January 2014

Avoiding certificate verification on a wireless connection

1. Go to /etc/NetworkManager/system-connections
2. Find your connection name
3. Edit the file which has the name of your connection.
4. In order to avoid verification, change the line
5. Try now.