Sunday, 17 September 2017

Raspbian back ups and shrinking

After backing up a 16GB SD card from my Raspberry Pi, it wouldn't restore on any other card, even though they are all 16GB???

Here is what I did: 

1:  Shrink the image on the SD card - use gparted to look at the image, select the main partition, then select resize and slide the arrow to just before where your image is written, (the darker part) leave about 10MiB of blank space to be sure your not going to overwrite your image and apply. 

2: Back up the image from SD card  sudo dd bs=4M if=/dev/sdb of=raspbian.img
this creates a backup image in your home folder 

3: Cut off the unused space from your backed up image with the following method.

a) fdisk -l myimage.img - this outputs the start and end of the image.

b) Use the end figure of the image in the next command to cut off that amount from the backup.
I will use the figure 4434269 as an example in the command below but make sure you 
replace my figure with your own one

c) run the next command to cut off the unused space on your image
 truncate --size=$[(4434269+1)*512] myimage.img 

(make sure you replace 4434269 with your fdisk end figure)

Now you can copy your image to another card to test, you should have saved a nice amount of space,
my image is now small enough to use an 8GB card card.

Tuesday, 16 May 2017

Ransomware precautions

lots of talk about the wanacry encryption virus that has spread lately, if you do the next steps regularly you should cut down your chances of getting hit, no need for paid antivirus, the default windows defender is fine and has been updating to keep up with this on a daily basis.

1 keep all devices updated & antivirus updated
(this will include patches to help prevent viruses)

2 don't open email attachments or pop ups.
(one of the easiest ways to get infected)

3 don't run as admin user
(most malware etc. will not install on your system if your running as a normal user without admin privileges)

4 back up offline and keep backup device offline.
(If you do get infected, you can wipe your hard drive and start again with your backup nice and safe, the virus will also encrypt your backup/s if connected to your network or PC in any way, so keep separate) a complete image backup is best, it's just 10 minutes to install the whole system back to the way it was this way and worth the planning ahead.

Sunday, 16 April 2017

Robot list

Iv'e been building robots lately, because I'm forgetful this is a checklist of stuff to install on SD cards.

1 Flash raspbian
2 Add ssh file to boot menu (so I can immediately login from SSH)
3 Add WiFi config file (so I dont have to set up on gui).
4 Add python files such as line follower program and set preferences to run as program

Boot and login via SSH

1 Run sudo raspi-config ...
change password
enable camera
enable SSH
enable I2C
enable remote gpio

2 Install explorer hat (or whatever motor controller your using)
3 Install inputs (sudo pip install inputs)
4 Update and reboot
5 Check everything works.


My WiFi config for quickness: (wpa_supplicant.conf)

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network=
{
ssid="your ssid"
psk="your ssid password"
key_mgmt=WPA-PSK
priority=10
}

Saturday, 1 April 2017

My favorite Raspberry Pi projects

A list of my favorite Raspberry Pi projects.

PiDP-8
A clone of the PDP-8 computer, the face plate and switches are available as a kit from "Obsolesence guaranteed" website, it's an expensive kit at just over £100 (Raspberry Pi not included) with lots of tinkering longevity, avoid if you don't like soldering and a good few hours work, but the end result will give you a thing of retro beauty.


ISS-Above
A simple ISO image from ISS-Above, which you copy to an SD card, put in your Pi, connect to a monitor or TV for an out of this world live feed from the International space station, watching the sunrise it truly magnificent. 


Volumino
Limitless internet radio stations to listen to whatever your taste in music. I found "volumino" to be a great choice to write to an SD card, you will need some sort of Pi add-on to connect to speaker/s such as a Pirimoni speaker hat or for more power a Hi-Fi Berry amp, a nice simple interface, set your board type and wireless settings from your PC, phone or tablet, then lay back and enjoy a bit of Zen radio, bliss!


Retro Pi
The amount of games available for the Retro Pi image is staggering, I have a 32gb SD card almost full! Add different rom's once you have set up the main Retro Pi image for a trip back in time to Sonic the hedgehog or a classic ZX Spectrum game.


Pi Desktop
The latest Raspbian pixel image is perfectly usable for an every day computer now, the early Pi's were slow but the Pi 3 with Raspbian is a lot more polished, decent learning software by default and Minecraft is always great fun.

Friday, 31 March 2017

Arduboy

Learning to write code has never been so much fun!

The Arduboy is a credit card sized Game boy style console with a basic OLED 128x64 screen, which has an Arduino chip at it's heart (ATmega 32u4), so it can be programmed in the same way as an Arduino using the Arduino IDE.

I originally bought this as a learning platform, writing a game I could share as the end result I had a good incentive to give this a go, the first thing I came across was a friendly and helpful community and website (Arduboy)
I found programming hard (and still do) but found it's important to aim for something that you have an end goal to and to keep motivated, for me the Arduboy was it, I have never learnt as much about programming than when I just dived in and started to give it a go, reading all the books in the world doesn't make up for experience, I had and still do have a large amount of errors in my code, but it's getting better, my friend Les Pounder taught me about failing F.A.I.L = First attempt in learning, and you sure need to be prepared to some "why on earth isn't this working" moments, but please keep going, it's worth it!

If you have or are going to get an Arduboy, please enjoy my game, click on the title below.

Boris goes skiing

A big thank you to my friend Mike McRoberts (The Arduino guy) for all your help.

Friday, 8 April 2016

International Space Station on the Raspberry Pi 2

Having a play with ISS above, a very cool Raspberry Pi image for the raspberry pi 2, to view international space station cameras, tracking and info.

ISS above website

However not having access to rasp-config setting and no GUI to update I used my phone with SSH juice (lots of similar apps available) to update and make the connections a bit safer as follows.

Your IP address will be shown on the screen a few seconds after starting ISS above.

sudo apt-get update 
Updates your raspberry Pi.

sudo apt-get dist-upgrade
Upgrades your Pi and installs security patches.

sudo apt-get install ufw 
installs UFW (uncomplicated fire wall) .

$ sudo ufw default allow
This sets the default policy to allow, this will allow your connection from any port to your Raspberry Pi after your firewall is enabled.

$ sudo ufw enable
Starts the firewall.

$ sudo ufw allow 22/tcp  
Allows incoming TCP connections to port 22 (for SSH).

$ sudo ufw allow 80/tcp  
Allows incoming TCP connections to port 80 to access settings via a browser.

$ sudo ufw default deny
This changes the default policy to leave only used ports open. 

$ passwd
Change the default "raspberry" password to something less obvious. 

$ sudo reboot
reboots your Pi.

Saturday, 8 August 2015

Windows 10 privacy


Here are some privacy adjustments I made before connecting to the internet and having Microsoft spy on me too much!

I will list the options as they appear in the settings and menus, so you can follow along with another device.

After downloading/installing (this takes ages) choosing location/keyboard layout, you will get to the internet settings screen, don’t connect yet, choose the option to skip.

Select custom settings - (don’t choose express settings.)

Browser and protection screen - switch everything to off.

Personalization screen - switch everything to off.

Make it yours screen - skip this step.

Now Windows will load into the desktop environment, once Windows 10 is loaded, go to Settings - Privacy and disable everything.

General settings - switch all to off.

location - off.

Speech, inking and typing – Turn off Cortana.

Feedback to Microsoft - never in the first box, basic in the second box.

Windows update - automatic update, then open advanced settings - how updates are delivered - switch off update from more than one place.

Windows defender - real time protection - on. cloud based protection - off. sample submission - off.

Network and internet – Wi-Fi – Manage Wi-Fi – Wi-Fi sense – both off.

Then go to the search bar and type in cortana, in cortana settings disable it by switch both options to off.

You can connect to the internet now.

Open your browser - in the Edge browser go to settings - advanced settings – switch on do not track, and block third party cookies.

If you are signed in with your Microsoft account, Microsoft will store your information, passwords, Wi-Fi password etc, if your not happy with this, sign in with a local account (just a user-name) not linked to an email account.


/Sones




Raspbian back ups and shrinking

After backing up a 16GB SD card from my Raspberry Pi, it wouldn't restore on any other card, even though they are all 16GB??? Here is...