Linux (28) Python (13) Raspberry Pi (5) Bugs (3) Install (3) C (2) Brainf**k (1) HTML (1) Maths (1) Sorts (1)

Monday, 29 June 2015

How to monitor your CPU on debian or ubuntu systems.

There are many reasons to want to monitor your CPU maybe if you are over-clocking(making sure your CPU hasn't caught fire after running Prime95),or you might just be interested to look at your CPU temps a, there is lots of different reasons and this is a post to show you how.

For both of these programs lm-sensors is required and can be installed with a

sudo apt-get install lm-sensors

If you get a run sudo apt-get update which will update the package lists.
You then need to run sudo sensors-detect and follow the instructions this command is finding all the monitoring devices that are available on your hardware.
If you follow the standard instructions you should be fine

Installing xsensors:
Install with a simple apt-get.
sudo apt-get install xsensors
Wait for it to install then run 
This should open up a program looking something like this:

 This shows the temperature of the hardware in your computer. It doesn't however have very much detail but you may like it if you are just looking for a simple program.

 If you want something with more detail I would recommend psensors. I will show you how to install it now.

Installing Psensor: 
Install with a simple apt-get.
sudo apt-get install psensor
Wait for it to install then run
This should open up a program looking something like this:
 I Prefer psensors as it has more information about the hardware.
It also has a nice graph which compares temperatures.

Average temperatures:
CPU idle temp about 40C
CPU normal temp 50C
CPU stress temp 65-75C(some may run hotter especially Haswell chips in the 80C-90C)
If your CPU is running hot you might want to check that the cooler is working properly i.e fan isn't clogged with dust and heatsink is attached properly.
You also could re apply your thermal paste.

Saturday, 20 June 2015

How to install Raspian on the raspberry pi.

There are lots of different ways of installing Raspian to a sd card like win32diskimager and usb image writer but a even easier way is with dd.

Things I am going to show you:
  1. How to locate your sd card in the command line.
  2. Where to download the image from.
  3. How to install the image to the sd card using dd.
1. Locating your sd card in the command line.

To do this first open up a terminal and type:
sudo fdisk -l
You should get something like that, now locate what your sd card is named. Mine here is called "/dev/mmcblk0"
yours might be something different but make sure to pick the right one as if you choose the wrong one you could corrupt your hard drive.
Try to look for the size of the sd card.
Take note of the name of your device.

2. Downloading the image.
To download the image, goto and find the most recent raspian image.
Download and extract the image file.

3. Installing
To install the image to the sd card first we need to unmount the sdcard.
sudo umount /dev/mmcblk0
You should use the name of your device.(Make sure you have the correct device or your hard drive could be damaged)
Then we need to be in the same folder as the extracted image.
Now to write the image to the sd card type
sudo dd bs=4M if=path/to/image of=your/device
After running this command(it may take a while depending on your sd card) you should be ready to go.

How to use apt-get on debian or ubuntu systems.

The advance package tool also known as APT is a tool that is used for the easy installation, removal and upgrading of software on Debian/Ubuntu systems.

Things that I will show you how to do:
  1. Search for packages using apt-get
  2. Update system package lists
  3. Upgrade software packages
  4. Install and remove specific software packages
  5. Check for broken dependencies

1. Search for packets that you would like to install using apt-get.
This command can be used to search for packets and find the specific name so that it can be installed. It also gives a short description on what each piece of software is.
apt-cache search
apt-cache search google-chrome  

2. Update system package lists.
This command downloads the package lists from the repositories to get info on the new packages available. 
sudo apt-get update

The "sudo" command is needed as you need to be root to update the packages as protected files are accessed.

3. Upgrade software files.
This searches for any updated software that is currently installed on your computer.
sudo apt-get upgrade 

"sudo apt-get update"
This command should be run before running this command to get a fresh package list.

4.  Install and remove specific packages.

sudo apt-get install <package name>

sudo apt-get remove <package name>

This removes just the package.

Purge remove:
sudo apt-get purge <package name>

This removes the config files and the package.