do-er for hire. He started coding around 1971, over time he has written programs in 14+ languages, although Turbo Pascal remains one of his favourites. Brian organises Linuxing In London, co-organises London JavaScript Community and Covent Garden Pi Jam. He likes tea and speaking poor Spanish. He prefers community management to being a boring IT Manager and know-all! NB: Brian speaks in paragraphs. Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
should be done. How to operate a Linux system, what to do and what to avoid, covering the Linux command-line extensively. Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
The last word on everything about Linux. But, it will provide: A basic Raspberry 102, a hands-on approach to managing a Raspberry Pi system with Linux, and many of the gotchas! It will be the start of your journey to learnt about Linux. Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
line software installation. The power of the cli, basic commands, key files, performance tuning, etc Finally, you will be master of your own Raspberry Pi. NB: These commands should apply on almost any Debian or Ubuntu derived system, AWS, GCP etc but read the manual. Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
Linux commands should be in lowercase, Linux is case sensitive] A word about normal users and root access. Normally users can not, generally, break a Linux system but root (or superuser) can. sudo <command> sudo -i for a longer session but take extra care. Gotcha: Don’t CTRL-C system updates/upgrades etc or you’ll end up with a broken package management system, treat Linux with respect or it will bite back. Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
7 Advanced Options -> A1 Expand Filesystem Do changes and reboot NB: Best not be too smart with raspi-config, eg. Don’t overclock or you might break something and fry your Raspberry Pi! Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
App Store) sudo -i apt-get update && apt-get -V dist-upgrade Watch the output very carefully, initially Take a break, but remember don't interrupt apt-get or it might break your Linux system. A word on dependency management and libraries. Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
Type, passwd Pick a new password for the default pi account. 4.2 sudo -i passwd root 4.3 Type, adduser <your new username> Fill in 4.4 adduser <your new username> sudo Verify new user account has access to sudo, by logging out and logging in again, then type sudo -i from your new account. If in doubt check /etc/sudoers Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
are we online? Give me an up to date feel of all of the packages. apt-get –V install <package> Eg. apt-get –y –V glances apt-cache search chess >file more file grep <text> file apt-get is a frontend to dpkg and ALWAYS the best way, but dpkg -l (L) is useful. Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
CTRL-R The history command Writing the history buffer to a file history –w whatihavejustdone.txt history –c Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
ls – list files, eg. ls -alh mkdir – make a directory cd - change to a directory pwd - where am I cd $HOME – take me to the top level directory more – type something to the console mv – really renames files, use with care cp – copy files tail – the bottom of a file, eg. tail 200 nano – a simple editor rm – erases files, be careful, particularly when in root. rmdir – removed an empty directory diff – compare two files, eg. diff –y –w132 <file1> <file2> Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
touch anything in /etc unless you have to. Don’t delete anything from /usr/bin or /usr/sbin/ If you need to remove a package use apt-get purge <package> ls –rtcl /var/log is handy tail /var/log/syslog dmesg – watch like a hawk, use -T to make sense of time Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
very, very involved and a full time job. top – watch Tasks, topleft and free memory, q quits, h for help free – shows free memory, more readable with free –m df - look at your devices, e.g. df -h When you run out of memory Linux will start killing processes, run only what you need to execute. If in doubt, use glances, it is very good. Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
- halts the system sudo shutdown –r 2 - reboots the system sudo shutdown –c - cancel the shutdown Use these instead of the halt and reboot commands. Don’t just unplug the power! Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
clients and X servers (1984 - MIT, now seen as X11 - version 11) ssh to the server with the -XC options from Linux then invoke synaptic or firefox. Windows systems need to have an X client running (Xming or Cygwin). Macs might need security options fixing, for more modern systems see XQuartz project. The process load is on the Raspberry Pi, not your PC/laptop etc Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
home network, not anywhere else. apt-get update && apt-get –y –V install zenmap nmap –sP <IP range/24) eg. nmap -sP 192.168.1.0/24 Find your own IP address by typing, ifconfig Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
headless Raspberry Pi doesn't need a GUI (Graphical User Interface) X can be used if needed, as above. Turning off the desktop (GUI) frees up memory and the Raspberry Pi should go a bit faster. Networking a hassle? Just plug straight into your router with an RJ45 cable (no password setup required, it will be issued with an IP address on power up) Turn off and on X via raspi-config sudo raspi-config 3 Boot Options->B1 Desktop /CLI-> [your choice] Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
A: These are just draft ones, but the final version will always be at GitHub’s speakerdeck as BrianLinuxing. https://speakerdeck.com/brianlinuxing Q: How does TCP/IP work? A: TCP/IP is an immensely complex network protocol, but from our point of view we just need to know if you plug in a device it will request a TCP/IP address. That address is supplied by a DHCP server. In most instances that will be your home or office router. Q: What does DHCP mean? A: Dynamic Host Configuration Protocol Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
Foundation site is a good starting place, although many of the articles are over elaborate for beginners. Equally, the forums can be useful at times. Q: Isn't Linux too complicated to learn? Learning Linux is no more complicated than becoming familiar with another language or mastering the art of car driving. It takes patience, a degree of persistence but the rewards are immense. Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
Pimoroni Pi Borg The Pi Hut Pi Supply Again, the Pi Foundation site has a list. Q: Are there any courses I can do to learn about Raspberry Pis and Linux A: The Pi Foundation offers special courses to teachers etc and the Linux Foundation has various basic Linux courses too. Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
reading, tinkering and if you ruin the Raspberry Pi's file structure then you can always recreate it using the instructions in Raspberry Pi 101. Q: My commands never work under Linux on the command line. A: Linux is case sensitive, take extra care. Q: What does && and all of those funny Linux symbols do? A: They are called chaining operators, see https://www.tecmint.com/chaining-operators-in-linux-with-practical-examples/ Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]
A: Type, man <linux command> as a starter or typically <linux command> --help Q: You didn’t answer my question. A: Linux is complex operating system and can’t be rushed! Self study is always useful :) Q: I have many, many more questions where should I go? A: Let Google be your friend in this case :) Raspberry Pi 102 by Brian Byrne. Twitter: @BrianLinuxing Email: [email protected]