0x79 - a blog

Work in progress.

Category: misc

Backup Linux with tar

A simple way to backup your entire linux machine is just to create a tar all files

tar -cvzpf backup.tar.gz --directory=/ --exclude=proc --exclude=sys --exclude=dev --exclude=run --exclude=tmp --exclude=boot .

We set the directory to create the archive from to / and include everything in the archive with the . at the end. Also exclude directories like /dev or /sys, which are machine or OS specific and don't contain any of our files.

Parameters:

  • -c create a new archive
  • -v verbosely list files processed
  • -z gzip files
  • -p preserve-permissions
  • --directory change to directory
  • --exclude file/directory
more ...

Remote-Controll Spotify using REST and DBUS

In a previous article we used DBUS to send control commands to the spotify client.

To remotely control spotify via the web, i wrote a little HTTP server which takes GET requests and "forwards" them via DBUS to the player. The program is written in python (see below) and takes requests on the following paths:

  • /playpause
  • /stop
  • /next
  • /previous

Next step is an android app to call our little webservice :)

import SimpleHTTPServer
import SocketServer
import argparse
import subprocess

parser = argparse.ArgumentParser()
parser.add_argument('--port', type=int, default=9000)
args = parser.parse_args()


class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
    cmd = "/usr/bin/dbus-send --print-reply …
more ...

What the Enigmail Wizard actually does

I just reinstalled Enigmail for Thunderbird and was wondering what settings are actually changed during by the setup wizard, in particular the preferences section, to "change a view default settings to make OpenPGP work better on you machine"

  1. Disable Loading IMAP parts on demand
    • sets mail.server.default.mime_parts_on_demand to false
      • From Thundebird KB:
        True (default): Fetch the minimum portion of the message needed.
        False: Fetch the entire message, including attachments regardless of whether they're needed.
  2. Disable flowed text (RFC 2646)
    • sets mailnews.send_plaintext_flowed to false
      • From Thundebird KB:
        True (default): Send plain-text messages with flowed attribute, allowing rewrap.
        False …
more ...

Changing Fullscreen Resoultion for Mincraft on Linux

If you have a low-end Laptop and want to run minecraft on a lower screen resolution you might want to use the following bash script to run minecraft

xrandr -s 800x600
java -jar /path/to/Minecraft.jar
xrandr -s 1366x768

This will:

  1. set your screen resolution to 800x600
  2. run minecraft
  3. as soon as you quit minecraft, it will reset to your desired screen resolution again
more ...