Nice Job AMD. Heat Sink Failure

8. February 2013 18:55

 

This seemed to happen today to my computer at work. Which is odd since there was not even any graphics load on the board at the time. The machine was running linux and a different graphics card was in use at the time. I guess the AMD heat sinks are just not up to spec. The reason why I would say that is because the other identical graphics card also had a heat sink failure which caused the board to fail. The result was the machine locking up then failing to post on reboot. Though I don't think I have ever seen a heat sink split in quite this way before!

 

 

Note: The other card had a different failure. It's heat sink had failed on the leg of the heat sink that attached it to the board.

E-mail Kick it! DZone it! del.icio.us Permalink


Linux - List / Copy group membership for users

12. December 2012 08:00

 

A quick guide on how to copy group member ship in linux to another user. Which can be useful when setting up new users on a linux machine to make sure that users. It is also a way to find out what groups a user is a member of.

 

Part 1 - Get a list of groups

 

To get a list of groups as user is a member of can be done by reading the /etc/group file and doing a little bit of processing. This can be done using the following command.

 

grep -E "(:|,)<username>(:,|$)" /etc/group|cut -f1 -d:

 

The complex expression above is built to match specific username in each line of the file. Of which there is 3 different cases ":<username>"  ",<username>,"  ",<username>". So we search for the specific username beginning with a ":" or a "," and also ending in a "," or a "$" which is a newline. Then it cuts on the first field using ":" as a separator.

 

This will output  a list of group that "<username>" is a member of

 

Part 2 - Add another user to the same list of groups

 

Since we know that addgroup can be used to add a user to a group by doing "addgroup <username> <groupname>" then we can expand the above to add a username to each group in the list like this

 

for i in `grep -E "(:|,)<username>(:,|$)" /etc/group|cut -f1 -d:` ; do

  addgroup <newuser> $i

done

 

This will then make sure that the user <newuser> is a member of all the same groups that <username> is.

 

You should take care using the above as you may give somebody access well beyond what you thought you might have by giving them access to additional groups.

 

E-mail Kick it! DZone it! del.icio.us Permalink


Linux - ssh key authentication.

8. December 2012 08:00

 

Getting ssh key authorization to work in linux

 

Client Side

 

On that machine that is acting as the ssh client you should run the following command to generate a public / private key pair. It will prompt you for the location of a file to be stored the default should be acceptable unless you already have another key generated.

 

ssh-keygen

 

Generating public/private rsa key pair.

Enter file in which to save the key (/home/<username>/.ssh/id_rsa):

Created directory '/home/<username>/.ssh'.

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /home/<username>/.ssh/id_rsa.

Your public key has been saved in /home/<username>/.ssh/id_rsa.pub.

The key fingerprint is:

5b:78:75:c2:58:0e:ff:89:c7:8c:0f:38:64:c0:e2:6b username@raspberrypi

The key's randomart image is:

 

You need to keep the private key private as this is what is going to effectively be your password. It doesn't matter if somebody see's the public key. It is setup this way so you can be granted access to a machine without ever having to exchange a password over the wire. As an example you could email the public key to another admin who already has access to the machine to install the key.

 

Server Side

 

On the machine that is acting as the ssh server you will need to copy the public key string that will have been generated on the client side in location "/home/<username>/.ssh/id_rsa.pub".

 

Once you add this to the file "/home/<username>/.ssh/authorized_keys" that the ssh authentication should work. If you are using multiple private keys and have a long list of authorization keys on the server it can be wise to comment which keys are from where. This is so that if there is an issue with a "privacy" of a key you know which one to remove at a later time.

 

 

Now that ssh works you can login to the machine by using ssh <username>@address. The username part can be omitted if the username on the destination host is the same as the current machine you are working at. As an added bonus it also will mean that scp will work if it is enabled on the server.

 

 

E-mail Kick it! DZone it! del.icio.us Permalink


Linux - sudo without a password

4. December 2012 12:00

 

If you are tired of typing your password all the time and want to be able to sudo without using a password you can modify the sudo configuration so that you can always execute a command as root without a password.

 

Method 1 - For a single user

 

Edit the /etc/sudoers configuration file.

 

Add a line like this replacing the <username> with the correct user of course

 

<username> ALL=(ALL) NOPASSWORD: ALL

 

Method 2 - For multiple users

 

Create a new group on the system eg sudo or sudoers nu using the following command

 

groupadd <groupname>

 

Then add the usernames you want it to work for by using the following command

 

addgroup <usernames> <groupname>

 

Edit the /etc/sudoers configuration file and add the group to not use a password.

 

%<groupname> ALL=(ALL) NOPASSWORD: ALL

 

 

The above should work on debian and should only be used for trusted users as you have just given them root access without a password so some care should be taken!

E-mail Kick it! DZone it! del.icio.us Permalink


Raspberry Pi - Networking Performance

1. December 2012 11:03

 

 

I put together a simple program call tcp-bandwidth which measure performance over a data stream sent from the client to the server. So to do this test you will require two linux machines. eg the rasberry pi and another machine to act as a client or server.

 

Running the tool.

 

Download tcp-bandwidth-2012-12-01.c

 

Compile it using

 

gcc -Wall -O2 tcp-bandwidth.c -o tcp-bandwidth -lrt

 

You will need to repeat this on both the pi and the main machine.

 

 

On the pi run

 

./tcp-bandwidth 5000

 

On the main machine run

 

./tcp-bandwidth <pi ip address> 5000

 

Results - Machine -> PI

 

Speed: 6.529282 MBytes/Sec

Speed: 6.404114 MBytes/Sec

Speed: 6.443649 MBytes/Sec

Speed: 6.745232 MBytes/Sec

Speed: 6.453972 MBytes/Sec

 

  

On the main machine run

 

./tcp-bandwith 5000

 

On the pi run

 

./tcp-bandwidth <ip address of machine> 5000

 

Results - PI -> Machine

 

Speed: 6.398438 MBytes/Sec

Speed: 6.335938 MBytes/Sec

Speed: 6.109375 MBytes/Sec

Speed: 6.250000 MBytes/Sec

Speed: 6.320312 MBytes/Sec

Speed: 6.351562 MBytes/Sec

 

 

From this we know that the pi is capable of sending data at speeds > 6MBytes / sec or around 50MBit/sec. On an un-tuned tcp stack with the arm running at 700Mhz. Using around 30% cpu time (messured using top)

 

I would be interested if other people ran the tests and posted some of the results. If you do please include the client -> server speed, server -> client speed, cpu speed, whether its a 256Mb / 512Mb pi and if you have done any tuning / modifications of the Linux networking stack.

 

If people send in results i will put together a list of known configurations and performance results. Unfortunatly I have limited networking hardware to test with and is under load from other things in the enviroment which are probably knocking my results slightly.

E-mail Kick it! DZone it! del.icio.us Permalink