viernes, 12 de agosto de 2016

Using rsync to copy a movie and start watching inmediately

Sometimes I want to watch a movie that is on my home server. With standard copy you have to wait for the whole file to be transferred.

The following bash script does it:

#!/bin/bash
rsync -aP --inplace user@x.y.z:/home/mydir/"${1// /\\ \\}" .


Usage
myscript 'filename perhaps with spaces in it'

Explanations
--inplace makes the file inmediately accessible for playing.
The strange items instead of $1 escape spaces in the filename.
Do not forget the trailing dot '.'

martes, 9 de agosto de 2016

WiFi disabled by hardware switch

On my compaq presario cq60 laptop, WiFi gets sometimes off and there is no way to reactivate it: the network manager keeps saying "WiFi disabled by hardware switch". The hardware button does nothing. In fact, when working correctly the hardware LED is sometimes red, sometimes blue but keeps working!

This is probably a driver issue.
Things to try

rfkill list all
rfkill unblock all

But these do not work for me.

What does work is shut down the PC and, while restarting, press thousands of times the WiFi button.