Pages - Menu

Thursday, May 4, 2017

Commandline auto-login in Ubuntu 16.04

This is based on how RetroPie does its autologin and autostart which you can find in scriptmodules/supplementary/autostart.sh in the RetroPie-Setup source.

This works in Ubuntu and Raspbian, it probably works in any systemd distro.

mkdir -p /etc/systemd/system/getty@tty1.service.d/

Create a file at /etc/systemd/system/getty@tty1.service.d/autologin.conf with contents:

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin USERNAME --noclear %I \$TERM


Replace USERNAME with the actual username to login.

You can now reboot and test this.

If you want to start something on startup, then create a file /etc/profile.d/10-runthing.sh with contents like:

if [ "$(tty)" = "/dev/tty1" ]; then
    THING
fi


Replace THING with the command to run. You could run tmux so you never forget. You could compile DOSBox so it runs on the framebuffer and you appear to have a DOS computer, which is why I wanted to do this.

Friday, March 24, 2017

3D Modelling Software on Ubuntu 16.04 (OpenSCAD, FreeCAD, gCAD3D, Blender)

In addition to the previous post with 3D printer control software, you will likely want something to make models with!

OpenSCAD


This modeller uses a C-like programming language to create models. For example, to create a 20mm cube you type cube([20,20,20]);

Install with:

sudo add-apt-repository ppa:openscad/releases
sudo apt update
sudo apt install openscad


Run with openscad

I also find the scad-utils repository to be useful, the morphology plugin has a fillet tool: https://github.com/openscad/scad-utils

OpenSCAD website: http://www.openscad.org/
OpenSCAD documentation: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language

FreeCAD


A graphical modeller. This has many more features than OpenSCAD though I don't like the interface as much. A good workflow might be to make shapes in OpenSCAD and then import into FreeCAD to polish.

Install with:

sudo add-apt-repository ppa:freecad-maintainers/freecad-stable
sudo apt update
sudo apt install freecad

Run with freecad

FreeCAD website: http://www.freecadweb.org/
FreeCAD documentation: https://www.freecadweb.org/wiki/Main_Page

gCAD3D


This looks like a simpler version of FreeCAD

A deb package download is provided on the website for 32-bit and 64-bit.

Once downloaded, install with:

sudo dpkg -i gCAD3D*.deb

Run with gcad3d

gCAD3D website: http://www.gcad3d.org/
gCAD3D documentation: http://www.gcad3d.org/doc/html/index_en.htm

Blender


I have not played with this much yet, but it's very popular

Install with:

sudo add-apt-repository ppa:thomas-schiex/blender
sudo apt update
sudo apt install blender

Run with blender

Blender website: https://www.blender.org/
Blender support and docs: https://www.blender.org/support/

Saturday, March 4, 2017

3D Printing Software on Ubuntu 16.04 (Cura, Slic3r, Pronterface, Repetier Host)

I recently got a cheap 3D printer and wanted to get started printing with Ubuntu. Some of the software is not so obvious to install, so here's how I got these popular applications going:

Cura


Cura is available in the https://launchpad.net/~thopiekar/+archive/ubuntu/cura PPA. To install, just:

sudo add-apt-repository ppa:thopiekar/cura
sudo apt update
sudo apt install cura

Launch with the cura command.

Cura website: https://ultimaker.com/en/products/cura-software

Slic3r (Slicer)


The version in repos is the latest (1.2.9) at the time of writing, however the package is missing some dependencies. This installs all that's required:

sudo apt install slic3r wx-common libopengl-perl libwx-glcanvas-perl

Launch the GUI with the slic3r --gui command

Slic3r website: http://slic3r.org/

Pronterface (aka Printrun)


This requires python-wxgtk2.8 which is removed in Ubuntu Xenial 16.04, and the replacement python-wxgtk3.0 does not work well with Printrun.

There are some instructions around the internet suggesting to install the Wily 15.10 version, but that led to messy dependencies for me.

Luckily, WebUpd8 package python-wxgtk2.8 for 16.04 in their PPA, thanks!

First, install the dependencies Printrun requires with:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt update
sudo apt install python-serial python-wxgtk2.8 python-pyglet python-numpy cython python-libxml2 python-gobject python-dbus python-psutil python-cairosvg git


Now change to the directory where you want the application to be and fetch the software with:

git clone https://github.com/kliment/Printrun.git

To run, change to the Printrun directory with cd Printrun and run the python pronterface.py command.

Pronterface website: http://www.pronterface.com/

Repetier Host


This uses Mono to run the Windows binary, install requirements with:

sudo apt install monodevelop libmono-system-serviceprocess4.0-cil

Download and uncompress:

tar xf repetierHostLinux_1_6_2.tgz
cd RepetierHost

Run with:

mono RepetierHost.exe

Repetier Host website: https://www.repetier.com/

Saturday, August 13, 2016

DOSBox Full Screen with proper Scaling and Aspect Ratio

It's quite confusing to get DOSBox to display games properly on modern hardware, partially because CRT monitors often displayed in non-square pixel modes, and partially because modern LCD displays don't scale well or support all the resolutions that CRTs did.

This post discusses the settings required in dosbox.conf to get DOS games displaying well.

fullresolution

Set this to your screen's native resolution such as fullresolution=1920x1200

output

The default surface cannot scale, so set this to output=overlay which can scale. If you have a decent graphics card you could also try output=openglnb

aspect

Set aspect=true to ensure the game is not stretched

scaler

Simple scaler=none will work, but you can experiment with the other scalers to see which performs well and which you like the look of.

The full config options are described at http://www.dosbox.com/wiki/dosbox.conf

Sunday, August 7, 2016

Another Steam Update breaks Ubuntu Xenial 16.04


As of the recent Steam update, Steam will not launch and the following is displayed:

$ steam
Setting up Steam content in /home/username/.local/share/Steam
Running Steam on ubuntu 16.04 64-bit
STEAM_RUNTIME is enabled automatically
Installing breakpad exception handler for appid(steam)/version(0)
libGL error: unable to load driver: r600_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: r600
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

You can fix it with:

mv .local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6 .local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6.old
mv .local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19 .local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19.old
mv .local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6 .local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6.old
mv .local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6.0.19 .local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6.0.19.old

This is yet another instance of the C++ libraries in the Steam Runtime not being compatible with the free software radeon driver for AMD (ATI) graphics cards:

https://github.com/ValveSoftware/steam-for-linux/issues/3273

I had a previous fix for this when they just packaged the i386 C++ library, but now they're packaging both the i386 and AMD64 C++ library, so my fix needed updating.

If Valve package one more C++ library that'll be 3 separate libraries: Half-Life 3 confirmed.