New update script using apt rather than apt-get

My plan is to migrate everything to this syntax. This is the first one. #!/bin/bash echo “updateall v.1.3 for Raspian” #Run this as a normal user. Your admin password will be asked for if required. sudo apt update sudo apt upgrade -y sudo apt full-upgrade -y sudo rpi-update echo “The script has now finished running.”

Non-interactive Debian upgrade script

This could be run as a cron job on any Debian based system (tested on Debian, Ubuntu, Raspian). #!/bin/bash export DEBIAN_FRONTEND=noninteractive yes ” | apt-get -y -o DPkg::options::=”–force-confdef” -o DPkg::options::=”–force-confold” dist-upgrade See http://slave27.local/debian-handbook/sect.automatic-upgrades.html for more details.

Converting .epub to .mobi

This assumes the source file is DRM free, and that the machine already has calibre installed. for book in *.epub; do echo “Converting $book”; ebook-convert “$book” “$(basename “$book” .epub).mobi”; done

Merging PDF files

The best graphical PDF merging tool for Linux is probably pdfmod. It’s in the Ubuntu repositories, and can do anything Preview can do as far as merging/exporting PDF files from multiple sources. For command line merging, pdftk does the job well. The syntax would be something like: pdftk *.pdf cat output combined.pdf Which would merge … Read more

Adding cowsay to login

To get an interesting picture and quote each time you log in to a terminal session add the following to /etc/profile: echo;fortune | cowsay -f dragon;echo This requires fortune and cowsay to be installed first (through apt or homebrew depending on platform). The optput should look something like: _________________________________________ < Caution: Keep out of reach … Read more

Installing Motion on Ubuntu

Install motion: sudo apt-get install motion Enable motion to start at boot: sudo nano /etc/default/motion Find the line that says start_motion_daemon=no and change it to start_motion_daemon=yes. Enable the stream to be viewed from other computers on the local network, and also make the output a little bigger: sudo nano /etc/motion/motion.conf Change the following values: daemon … Read more

Pandoc commands

I wrote about Pandoc last year, but I’m using it more and more and I’ve found myself editing the original post a fair few times. This is the updated 2016 version that gathers together useful commands I’ve learned so far. Last year I found myself needing to do a lot of document conversion, and maintaining … Read more