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




Sunday, 5 July 2015

Family Friendly

Open DNS family friendly works by replacing you Internet service provider's domain name system (DNS) servers.

You can either change the DNS in your router settings, so all devices that connect to it automatically use open DNS, blocking adult, phishing and anonymity websites.

Or change to open DNS in one or more devices directly, so you will be blocking adult websites with only the the device/s you chose to use it on.

This will not stop all unwanted content or viruses, but will block all known websites that have adult or unsuitable content. So please be careful what you click on, and email attachments that you open. 

Router settings:
Log onto you router by entering 192.168.1.1 into your search tool-bar, then enter your admin user name and password, usually admin, admin or admin, password. Then go to DNS settings, usually under advanced or dynamic DNS settings, then replace the primary and secondary DNS servers with.

Primary        208.67.222.123
secondary    208.67.220.123

Then save your settings, reboot your router and check to make sure adult sites are blocked.

PC settings:
go to settings/control panel, then network settings, then replace the DNS servers with the ones above, then save your settings, reboot and check adult content is blocked. 

The single PC option is great for a children's PC.

More router security settings can be found here.

/Sones


Friday, 9 January 2015

Inspirational children

I recently had the opportunity to talk to a class in a local primary school about the Raspberry Pi computer and basic programming with Scratch and Python.

What a great class of children!

I'm a shy person so public speaking is something I have always avoided, the children quickly put my nerves to calm with such great input and questions, I done it for the kids to learn and have fun, but my thanks truly goes to the children as I have gained lessons from them in the process.

Here's an outline of the talk:

1 - Introduction to the Raspberry Pi

2 - Coding what it's used for / how it's used / coding in everyday life + a demonstration of traffic lights with LED's

3 - Other Raspberry Pi projects (Bird box camera, nature camera, weather balloons in space)

4 - Robots, brought my one along for a demo (should have got the kid's to name it!)

5 - Hacking Minecraft, this went down really well, they would have been happy doing this for the rest of the day.

A big thank you to my good friend Les Pounder for help and ideas for using Minecraft to inspire. (http://bigl.es/

Monday, 12 May 2014

How to text install crunchbang 11 (waldorf)

When trying to install CrunchBang 11 on my Asus 701 4gb eee PC, there was no option to text install, this is because of a bug in the Debian installer, this is how to fix the problem.

Install CrunchBang 32 bit to a USB drive, (I used USB installer in Linux mint).

Boot PC and press ESC to enter boot order menu, then select boot from USB.
Once loaded, use curser keys to highlight install. (Don't press enter yet) then press tab key, this will bring up the installer commands, press the space bar once then type "vga=normal" then press the space bar once, then type "fb=false" then press enter.
This will start the text install, where you can follow the instructions, to install as normal.

/Sones

Sunday, 9 February 2014

Windows XP alternatives

All versions of windows XP will no longer be supported from April 8th 2014

This means there will be no more system updates and security vulnerabilities will not be patched (made safe) leaving XP unsafe to use on the internet.

The bad guys/girls will be ready and waiting, knowing that there will be plenty of XP machines online to exploit, so ignoring this will leave you open to all sorts of nasties.

I’ve seen a few anti-virus companies offering support for a fee, I’m not sure how secure this will be, alarm bells are ringing with me.

What can we do about it?

First of all, back up all your documents/photos etc to a safe place.

You can use an XP machine safely offline, such as a word processor or games machine, if this suits your needs.


You could upgrade to a later windows operating system as long as your computer has the correct specifications to run windows 7 or 8, in my opinion windows 7 is much more user friendly, stable and sensibly laid out if you can get hold of a copy.

You could simply buy a new computer with a later version of windows or an Apple computer.

You could leave windows and buy a chrome-book, they are cheaper than a windows machine and although they have their limitations, they also have lots of advantages, such as more secure and easier to maintain.

Or my favourite option, recycle and install a free version of Linux onto your computer, this will completely wipe your windows operating system and all your files, but if your computer will be no good anyway, what do you have to loose?

These are my favourite Linux distros:

1 Xubuntu: (xubuntu.org) a lightweight version of Ubuntu, good for a Linux beginner, easy to use.


2 Peppermint: (peppermintos.com) again good for beginners, easy to use menus, Google chromium browser as default, good for older hardware.

3 Crunchbang: (crunchbang.org) Lightning fast, minimal, fuss free, not aimed at the beginner, but learn a few Linux terminal update commands and you will be up and running in no time.

4 Mint: (linuxmint.com) cinnamon version is beautiful looking, very easy to use, not as lightweight as the others so will work better on more powerful PC’s (4gb ram or higher).

Loads more versions of Linux can be found on distro watch (distrowatch.com).

/Sones