skip to main content - dyslexic font - mobile - text - print

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


Welcome to HPR the Community Podcast Network

We started producing shows as Today with a Techie 9 years, 4 months, 23 days ago. Our shows are produced by listeners like you and can be on any topic that "are of interest to Hackers". If you listen to HPR then please consider contributing one show a year. If you record your show now it could be released in 10 days.

Latest Shows


hpr1715 :: 48 - LibreOffice Calc - Cell Styles

How to use Cell Styles to control the appearance of your cells.


Hosted by Ahuka on 2015-02-27 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Series: LibreOffice | Comments (0)

Our next topic is Cell Styles. If you are already familiar with Styles from Writer, think of Cell Styles as the equivalent of Writers Paragraph Styles. Just as a single Writer document can have a variety of Paragraph Styles applied to different paragraphs (e.g. Headings, Lists, Paragraphs), a single spreadsheet can have multiple Cell Styles. And the same arguments for using Styles also apply. If you have consistently used Cell Styles in your spreadsheet, you can update the appearance easily just by changing the Style instead of needing to go through the file looking for every cell that needs to be adjusted. And by using Styles you can apply a large number of formatting choices to many cells with just a few mouse clicks. So it really does pay to learn how to use Cell Styles.


hpr1714 :: Vim Hints 001

Hints and Tips for Vim users - part 1


Hosted by Dave Morriss on 2015-02-26 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (0)

Introduction to Vim

This is the start of the Vim Hints series.

As a Linux user there are many editors available to you. Which one you want to use depends on your needs and the amount of time you want to dedicate to learning how to use it.

One of the editors from the early days of Unix is vi, written in 1976. Contemporary with it is Emacs, also originating in 1976. However, it seemed to become the norm (in my experience anyway) that vi rather than Emacs was provided as standard with versions of Unix, and this has often continued into Linux.

I originally started using Unix around 1988 and found vi available to me. I learnt how to use it in a rudimentary way since I knew I'd find it on any Unix systems I came across.

Many derivatives and clones of vi have been created. The one which has become the most popular and available is Vim, the name of which is an acronym for Vi IMproved, created in 1991 by Bram Moolenaar. This is what I use, and I have not wanted to learn another editor since adopting it, even though I have experimented with several. This is the editor we will be looking at in this series.

What's the series about?

The thinking behind this series is:

  • You may already be using Vim; there are features you may not be aware of that can be revealed here
  • You may be using a different, simpler editor; you might want to use Vim and gain from its advanced features

Of course, you may prefer to learn Emacs instead. That's fine; you should choose the tool that best suits your needs. Both Emacs and Vim have quite steep learning curves, but the broad range of capabilities you gain from knowing either is considerable.

I am not an expert in Vim. In fact I am continuing to learn new Vim features on a regular basis. However, I have been using it for many years and would like to share some of what I have learnt.

Why use Vim?

With simpler editors you can move about a file, add, remove and change text and save the results. The editor might have syntax highlighting and some degree of knowledge of the programming language you are typing. You might have spell checking as well.

With Vim and other more advanced editors you have all of this and a lot more. You can perform global changes throughout a file, process many files at once, add plugins to the editor to change its behaviour, and so on. Also, there is a language behind the scenes which can be used to build extensions.

Using Vim

Usually, typing the command vi at the command line actually invokes vim. Vim runs in vi-compatible mode by default, which results in Vim enhancements being unavailable.

Vim uses a configuration file, which is called .vimrc on Linux. (Vim will also run on Windows, OSX and other operating systems but we will not be covering these implementations in this series.) Vim also has a GUI interface invoked by the command gvim, and it has its own configuration file .gvimrc.

I you don't have a .vimrc create one with touch ~/.vimrc before you start. This will stop Vim running in vi-compatible mode. We will look at what the .vimrc can be used to do later.

You can start Vim on its own without pointing at a file, but normally you use it to edit a file, which need not already exist. So, to create a new file called testfile invoke Vim with the command: vim testfile

Once running, Vim shows the contents of the file. All the lines on the screen where there is no content are marked with a tilde "~" character. If you are creating a file the first line on the screen will be blank, and last line will contain the name of the file followed by "[New File]" and some other details which we will examine later:

"testfile" [New File]       0,0-1         All

All the rest of the lines will contain a tilde.

Vim is a modal editor. The mode you usually start in is normal mode where you can move around the lines of the file and perform actions, but nothing you type is actually written to the file. In fact, the keys you type are actually editing commands. This is one of the features of Vim that causes problems for new users.

Since this is a new file there is not much you can do other than enter text, and to do this you need to switch to insert mode. Do this by pressing the i key. The message -- INSERT -- will appear on the bottom line of the screen. Now type some text, pressing the Enter key at the end of each line.

You might notice that in insert mode you can press the arrow keys and move back to text you have already typed. This is a Vim feature and was not available in the original vi editor.

When you have finished entering text, press the Esc key to exit from insert mode. Now you can move around in normal mode, but remember that the keys you press are now commands not data to be entered into the file.

To move around in normal mode use the arrow keys or the home row keyboard keys: k to move up, j to move down, h to move left and l to move right.

This brings us to the last mode we'll look at: command mode. To enter this mode press the : (colon) key in normal mode. This moves the cursor to the last line of the screen, which starts with the colon you just typed. Here you can enter another class of commands. This time, we'll just look at how you can save the file and exit Vim.

Saving the file is achieved with the w command, and to exit from Vim the q command is used. These can be typed together, so :wq writes the file and exits.

If you were to use :q on its own, having entered data into Vim, this would not work. Vim prevents you from throwing away your work this way. If you really meant to quit without saving then the q must be followed by an exclamation mark ("!"). So :q! lets you exit Vim without saving.

Summary so far

  • Vim usually starts in normal mode
  • Arrow keys or h, j, k and l for left, down, up and right for navigation in normal mode
  • i enters insert mode
  • Esc exits from insert mode and reverts to normal mode
  • : in normal mode enters command mode
  • :w in normal mode writes the file
  • :wq in normal mode writes and exits
  • :q in normal mode exits but only if nothing was changed or added
  • :q! in normal mode exits regardless of any changes

Errata

  • I was wrong about the contents of the last line of the Vim screen in the audio. The notes have been corrected.

History

Books

Other resources


hpr1713 :: Fosdem 2015: Surveillance vs. Free Software

Interviews at the Free and Open Source devleopers meeting FOSDEM in Brussels.

Hosted by 2BFrank on 2015-02-25 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Series: Interviews | Comments (0)

Aaron Williamson

Free Software Law Expert Aaron Williamson held a brilliant talk on the history of internet surveillance in the USA at FOSDEM 2015. After the Paris terror attacks, many politicians want to increase surveillance. British Prime Minister David Cameron wants to read all our emails - even the encrypted ones. Is this the only answer to terror attacks? Aaron has a very strong opinion on this.

Mathias Kirschner, Free Software Foundation Europe

Matthias is the Vicepresident of the Free Software Foundation Europe. In our interview at Fosdem 2015, he explains the work and the goal of the foundation and how they do lobbying for Free Software in parliaments and government bodies.

Torproject - nos ognions

A member of nos-ognions.net, which is part of the Tor project, explains about exit nodes, transparency and surveillance.


hpr1712 :: What's in my Crate

What was in my crate when I went to a LUG to give a a11y presentation

Hosted by Mike Ray on 2015-02-24 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (0)

Back in the summer of 2014 I started going to the Surrey Linux User Group.

I was asked to give a short presentation about Linux accessibility and how, although I am totally blind, I still write code and muck about with Linux.

I was then asked to give the same presentation at the Portsmouth LUG.

This time I made it more comprehensive and took more kit.

So I take this opportunity to give my version of the "What's in my bag" shows that some folks have been doing. As I am unemployed, like a lot of blind folks, I have been unable to justify this before now because I don't lug an interesting collection of stuff to and from work.

Here's a simple bullet list about the crate and it's contents:

  • The crate is a 35 litre capacity 'Really Useful Box'
  • First in were 2 Dell Latitude D630 (64-bit) laptops
  • Next in was a Dell Inspiron (32-bit) laptop, clunky and slow
  • The three laptops were sandwhiched between 3-ply layers of bubble-wrap
  • Next in was a Seika 40-cell refreshable Braille display
  • Next was a clear polycarbonate, zip-up pencil case stuffed with audio leads
  • Then a 'Mesh' Bluetooth and line-in external speaker
  • And a Braun external speaker/FM radio/micro-SD boom-box
  • A four-way mains power splitter
  • The three AC adaptors for the laptops
  • On the top of the box, because it was too wide to go in, was a USB keyboard
  • Mobile phone charging battery 'brick', for the Raspberry Pi
  • A Raspberry Pi, a Banana Pi and some Arduino bits and pieces

Here's what I demonstrated with two of the laptops:

  • Trisquel Linux and accessibility in the Gnome desktop with Orca
  • Accessibility in the console with Debian and the Braille display on the Inspiron

The second Latitude was with me so I could get some sighted help with BIOS settings.

My thanks have to go to Tony Wood for the lift to and from both of these accessibility presentations. I could not have done either, especially the Portsmouth one without his help.

Thanks also to Lisi, the coordinator of the Portsmouth LUG and to the folks of that LUG for their enthusiasm.

Here's the link to the HPR show about my Raspberry Pi tts code fix:

http://hackerpublicradio.org/eps.php?id=1649



hpr1710 :: Windows Remote Desktop on GNU/Linux

A wrapper script for xfreerdp to make connecting to windows servers painless


Hosted by Ken Fallon on 2015-02-20 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Series: Bash Scripting | Comments (1)

Recorded using Easy Voice Recorder Pro

I wrote a bash script to connect to various different windows servers from my GNU/Linux desktops. I had a few different requirements:

  • I should be able to call it based on hostname.
  • All windows should be 90% smaller than my screen.
  • It should map my keyboard.
  • It should map my local disk.
  • It should quickly timeout if the port is not available.

You can get the full script here, but let’s walk through it:

The first line calls bash and then gets the server name from the symlink that is calling the script. The port is set as “3389”, but you can change that if you like.

#!/bin/bash
SERVER=`basename $0`
PORT="3389"

The next few lines finds the smallest vertical and horizontal sizes, even if you are running multiple screens. Then it calculates 90% of that to use as the size.

h=$(echo "scale=0;(($(xrandr | grep '*+' | sed 's/x/ /g' | awk '{print $1}' | sort -n | head -1 )/100)*90)" | bc)
v=$(echo "scale=0;(($(xrandr | grep '*+' | sed 's/x/ /g' | awk '{print $2}' | sort -n | head -1 )/100)*90)" | bc)
SIZE=${h}x${v}

Next we set the default username and password. I have it ask me for my password but I put it in here as an example.

PASSWORD='defaultpassword'
USERNAME='administrator'
WORKGROUP='workgroup'

In some cases the credentials may be different, so I have a case statement that will cycle through the servers and apply the differences. Depending on your naming schemes you may be able to use regular expressions here to filter out groups of servers.

case "${SERVER}" in
  *server*) echo "Server ${SERVER}"
    PASSWORD='work_password'
    USERNAME='administrator'
    WORKGROUP='WORKGROUP'
    ;;
 
  *colo*) echo "Server ${SERVER}"
    PASSWORD='colo_server_password'
    USERNAME='administrator'
    WORKGROUP='COLODOMAIN'
    ;;
     
  some_server ) echo "Server ${SERVER}"
    PASSWORD='some_server_password'
    USERNAME='some_server_password'
    ;;
  *) echo "No match for ${SERVER}, using defaults"
    ;;
esac

Next we use an inbuilt bash command to see if a remote port is open and timeout after one second.

timeout 1 bash -c "echo >/dev/tcp/${SERVER}/${PORT}"

I used to connect to rdp using the program rdesktop, but it is now of limited value due to the fact that there are many open bugs that are not getting fixed. Bugs such as Bug 1075697 - rdesktop cannot connect to systems using RDP version 6 or newer and Bug 1002978 - Failed to negotiate protocol, retrying with plain RDP . I then switch to using xfreerdp. This is the client that is behind remmina.

You can use xfreerdp /kbd-list to get a list of the available keyboard layouts.

if [ $? -eq 0 ]; then
  echo "${SERVER}:${PORT} is open"
  xfreerdp /v:${SERVER} /size:${SIZE} /kbd-type:0x00000409 /t:${SERVER} /d:${WORKGROUP} /u:${USERNAME} /p:${PASSWORD} /a:drive,pc,/ /cert-ignore &
else
  echo "${SERVER}:${PORT} is closed"
fi

Next you will need to be sure that your host names are available, either in dns or in your /etc/hosts/ file. For example:

10.1.0.1 server1
10.1.0.2 server2
10.1.0.3 server3
10.2.0.1 coloserver1
10.2.0.2 coloserver2
10.2.0.3 coloserver3
192.168.1.1 some_server

Edit the script to your liking and then put it into your a directory in your path, possibly /usr/local/bash or ~/bin/. You can then make symbolic links to the servers to the bash script, also in a directory in your path, using the command:

ln -s /usr/local/bash/rdp.bash ~/bin/some_server
chmod +x ~/bin/some_server

Which links the global rdp.bash script to your personal symlink, and makes it executable.

All that you need to do then is type the name of the server and a rdp screen should pop up.

In our example:

$ some_server

From there your Windows Server session should pop up.


hpr1709 :: Hacking Your Teeth

Advice on hacking your teeth

Hosted by MrX on 2015-02-19 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (0)

This podcast details my experiences with dentists along with a smattering of free advice.

Link to the commonly known sunscreen song http://en.wikipedia.org/wiki/Wear_Sunscreen

Wikipedia article about gum disease http://en.wikipedia.org/wiki/Periodontitis

Wikipedia page on Interdental tooth brushes http://en.wikipedia.org/wiki/Toothbrush#Interdental_brush

Teeth with gum disease, notice that the gum doesn't form a sharp point between the teeth http://www.kmperio.co.uk/editor/assets/049B193B-857E-4FE7-BAC6-48F695DEFCBE.JPG

Healthy gums, gum forms a sharp point between teeth. http://www.wisdomtoothbrushes.com/sites/default/files/styles/475_width/public/wisdom-oral-health-healthy-gums.jpg?itok=-KhFJ6Pb


hpr1708 :: GNU/Nano Editor

JWP emails in an episode on the Editor GNU/Nano


Hosted by JWP on 2015-02-18 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (0)

JWP Editor GNU/Nano
                :::                         The                   
  iLE88Dj.  :jD88888Dj:                                           
.LGitE888D.f8GjjjL8888E;        .d8888b.  888b    888 888     888 
iE   :8888Et.     .G8888.      d88P  Y88b 8888b   888 888     888 
;i    E888,        ,8888,      888    888 88888b  888 888     888 
      D888,        :8888:      888        888Y88b 888 888     888 
      D888,        :8888:      888  88888 888 Y88b888 888     888 
      D888,        :8888:      888    888 888  Y88888 888     888 
      D888,        :8888:      Y88b  d88P 888   Y8888 Y88b. .d88P 
      888W,        :8888:       "Y8888P88 888    Y888  "Y88888P"  
      W88W,        :8888:                                         
      W88W:        :8888:      88888b.   8888b.  88888b.   .d88b. 
      DGGD:        :8888:      888 "88b     "88b 888 "88b d88""88b
                  :8888:      888  888 .d888888 888  888 888  888
                  :W888:      888  888 888  888 888  888 Y88..88P
                  :8888:      888  888 "Y888888 888  888  "Y88P" 
                    E888i                                         
                    tW88D             Text Editor       

Website: http://www.nano-editor.org/

nano is a text editor for Unix-like computing systems or operating environments using a command line interface. It emulates the Pico text editor, part of the Pine email client, and also provides additional functionality. In contrast to Pico, nano is licensed under the GNU General Public License (GPL). Released as free software by Chris Allegretta in 1999, today nano is part of the GNU Project.

hpr1707 :: A tour round my desktop

A look at the applications I use, why I use them and the alternatives I've tried.

Hosted by Beeza on 2015-02-17 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (1)


hpr1706 :: Cross-compilers part 1

What is cross-compiling, and why I might want/need to do it

Hosted by Mike Ray on 2015-02-16 and released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. Comments (0)

Cross-compilers, Part 1

In this show I'll introduce the concept of cross-compiling software, explain what it is and why you might want/need to do it.

I'll also talk about a great piece of kit for creating cross-compiler tool-chains on Linux; crosstool-ng.

As with most of my shows, the show notes are far too long to fit into the restricted size, so there's an HTML version as well, at:

http://hackerpublicradio.org/eps/hpr1706/index.html

Here are some bullet-points:

  • cross-compilers, why and what?
  • crosstool-ng
  • Cross-compiler tool-chain generation gotchas
  • Raspberry Pi cross-compiling tool-chain generation with crosstool-ng
  • Compiling a kernel on a Pi takes 15 hours
  • On my not-so-screaming quad-core Debian machine it takes 15 minutes

Links:

There are a few files for this show, the ct-ng .config files downloaded from Arch Linux ARM and a README.md about them. The original markdown source of the full show notes is in the tarball as well http://hackerpublicradio.org/eps/hpr1706/282-Mike_Ray-hpr1706-Cross-compilers_Part_1.tar.gz.