RAM and dmidecode

January 27th, 2011 No comments

There is a very useful command on Linux systems called dmidecode. This is a command that speaks to a computer’s DMI; sometimes called SMBIOS (System Management BIOS). Basically this is an area of your computer that stores various pieces of information about your hardware.

You can just type dmidecode and put the output through a pager but if you look at the man page you can see the DMI type and specifically pick it.

So let’s see an example usage by finding out what sort of RAM my system has by looking at type DMI types:

  1. Physical Memory Array
  2. Memory Device
[root@marine ~]# dmidecode -t 16
# dmidecode 2.10
SMBIOS 2.3 present.

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

Handle 0x0022, DMI type 17, 27 bytes
Memory Device
        Array Handle: 0x0021
        Error Information Handle: Not Provided
        Total Width: 64 bits
        Data Width: 64 bits
        Size: 512 MB
        Form Factor: DIMM
        Set: None
        Locator: A0
        Bank Locator: Bank0/1
        Type: Unknown
        Type Detail: None
        Speed: Unknown
        Manufacturer: None
        Serial Number: None
        Asset Tag: None
        Part Number: None

Handle 0x0023, DMI type 17, 27 bytes
Memory Device
        Array Handle: 0x0021
        Error Information Handle: Not Provided
        Total Width: 64 bits
        Data Width: 64 bits
        Size: 512 MB
        Form Factor: DIMM
        Set: None
        Locator: A1
        Bank Locator: Bank2/3
        Type: Unknown
        Type Detail: None
        Speed: Unknown
        Manufacturer: None
        Serial Number: None
        Asset Tag: None
        Part Number: None

So you can see that I have a system with 2 banks and it is capable of a maximum of 1Gb (YES it is old). Each bank is carrying 512Mb of RAM. Unfortunately the output doesn’t indicate the type of RAM but maybe we can work it out by looking at another DMI type.

# dmidecode -t 2
# dmidecode 2.10
SMBIOS 2.3 present.

Handle 0x0002, DMI type 2, 8 bytes
Base Board Information
        Manufacturer:
        Product Name: RS/RX482SB400
        Version:
        Serial Number:

A quick google reveals that the motherboard supports “Dual DDR SDRAM”. You can see that the information obtain wasn’t that useful against my personal PC. You will obviously find that the results vary depending on the vendor providing the information (and in some cases valid information).

Nevertheless it is useful, for people who are running Windows this information is accessible to you as well with a great tool called CPU-Z.

SSH and Limits

January 18th, 2011 No comments

I was tasked to look at why a limit wasn’t being applied to a shell when using ssh. To let you understand lets have a look at what was being seen:

[user@host]$ ssh test -l user
user@test's password:
[user@test]$ ulimit -n
1024
[user@test]$ cat /etc/security/limits.conf
* soft nofile 4096
* hard nofile 4096

However switching to the same user you will see:

[user@test]$ su - user
Password:
[user@test]$ ulimit -n
4096

That the limit isn’t respect when logging in via SSH but when we switch user it is applied.

The reason for this is rather simple; the SSH is opening a shell that isn’t a login shell and therefore limits is not being applied. To correct this simply edit your sshd_config file and set it to use login shells.

[root@test]$ grep -i uselogin /etc/ssh/sshd_config
#UseLogin no

You can see that the entry is set by default to no; so simply edit the line and alter it to yes:

[root@test]$ sed -i.bak 's/#UseLogin no/UseLogin yes/' /etc/ssh/sshd_config
[root@test]$ grep -i uselogin /etc/ssh/sshd_config
UseLogin yes

Now reload your sshd.

[root@test]$ /etc/init.d/sshd reload
 /etc/init.d/sshd reload
Reloading sshd:                                            [  OK  ]

And test again:

[user@host]$ ssh test -l user
user@test's password:
[user@test]$ ulimit -n
4096

That’s it! Sometimes odd behaviour like this can be difficult to track down without having a good read of configuration files.

Tags: , , ,

Dropbox, Fedora14 and SELinux

November 17th, 2010 No comments

I just recently updated to Fedora 14 and came across an issue that many others have. Fortunately enough OpenSourceGeek provided me with an instant solution happy syncing :) !

Create GMail Mailing List Filter

October 26th, 2010 No comments

One of my friends was having trouble filtering a mailing list today with GMail. Turns out he didn’t know that GMail makes it simple:

  • Open on of the mailing list e-mail
  • Expand the “Show Details” link.
  • Click on the “Filter messages from this mailing list” link

That’s it instant filter, then you setup the label you wish and the actions. Just one more reason why I really love using GMail!

Tags: ,

Make Router Respond To Ping

October 23rd, 2010 No comments

I have a old “BT Voyager 2100″ router and wanted to enable ping. It turned out that the setting was in a bit of an unusual place (at least I thought so).

Open the router web interface, normally http://192.168.1.1/
Advanced > System > Remote Access

Then tick the “Ping” checkbox and apply.

After this the box will respond to ping.

Tags: ,

Switch to our mobile site