Tutorial: How to play old DOS games on your chromebook

This is a quick recipe to play old DOS games like Sopwith or Alley Cat on your chromebook (or from your standard Chrome browser).

1. Install the DOSBox Chrome extension from here. First prepare a directory for your games.
In the application menu click on Files to start the file manager.
Click on the directory Downloads on the left.

Press CTRL-E to create a directory, name it for example dos

3. Download a games in your Downloads directory. For example Alley Cat or other games from http://www.dosgamesarchive.com/.
It should appear like that :

4. Uncompress the zip in dos.
Double click on the zip file, it should open it then drag the EXE from it in downloads on the left, don't drop it yet !, let downloads open then drop it in dos.
This should look like this :

5. Tweak DOSBox.
DOSBox is way too fast for those old games ! Start it and click on the tiny "?" on the bottom right (yeah it took me AGES to understand that it was not a help but a config menu !).

Here click on "Configure DOXBox (Advanced)" and insert a [cpu] section like this :

6. Import your dos directory in DOSBox
In the same configuration menu, in the "Disk Space Management" click on "Import Local directory to C:\ drive" and select the dos directory by double clicking on it and click "Open".

7. Close and restart DOSBox

8. Start your game !

CD dos

9.Optional: What if my game needs F keys ? (F1 F2 etc ...).
Go in your chromebook Settings, click on Keyboard settings and select "Treat top-row keys as function keys".
ESC will become F1, <- F2, -> F3 etc.


An AI engine for letterpress in golang

I just open sourced a thing I experimented with in golang few months ago.

Letterpress is a letter game on iOS and has a clone named Spell Strike on Android.

This is an AI engine that plays ... well way too well.

Don't spoil the fun: Enjoy responsibly !

You can find the repo here


Display the hidden output of a command in a separate tmux pane

Sometimes you want to see what is going on in a middle of a pipe between commands.

For example, vim calls a tool and crashes, the error message doesn't say anything because vim could not parse it.

Here is a trick to copy the output of the command in a separate tmux pane while preserving the original output.

Put a shell script at the place of the original command and rename the original command to here "original_cmd"

/bin/original_cmd | tee `tmux splitw -v -P -F '#{pane_tty}' read`

For example here it will execute "/bin/ls" normally on the top AND copy in realtime its output on a new pane below.

Happy debugging !


Taking over a resized tmux session.

So I use tmux quite intensively and I reuse my long lived session from my workstation and my laptop.

The thing is when you come from a low res screen to an high res screen you can land on a resized session like that :

Tmux is simply trying to accommodate to all the client currently connected. If you left open your session on your laptop at home or simply closed it quickly, you might be stuck in this situation for a while.

Here is how I unstuck myself from within tmux...

tmux detach -a

Or in your .zsh/bashrc as an alias

alias takeover="tmux detach -a"



Golang playground in Vim

I noticed I use the Go language playground quite a lot to try out the packages on different use cases but going back and forth between the snipped and vim was painful (vim muscle memory, copy paste etc ... this is annoying).

I found a vim plugin that actually call the page directly from a vim buffer.


I assume here you have pathogen already installed.

note: webapi-vim is a dependency

# cd ~/.vim/bundle
# git clone https://github.com/mattn/webapi-vim.git
# git clone https://github.com/mattn/goplayground-vim.git


The plugin is associated with the .go files so you need to open one (you actually don't need to save it)

# vim test.go

Type your snippet and [ESC]:Playground

... and boom ! Thanks mattn for the plugin !


Tiny & Big review

I noticed that a game landed in Gentoo portage :

Tiny and big is an interesting mix between a platform game, FPS, puzzle and physics game.

Simply put this is the best game I ever played on Linux. I played it with my sandy bridge despite the intel graphics beeing not supported and I had to run driconf (you need to emerge x11-misc/driconf) to enable S3TC texture compression.

The game was definitely playable despite a weird bug with the fonts, all the texts disappeared

So I missed the dialogs but even without them, the game is awesome : you play a little character in realistic physic world where you can cut huuge parts of the landscape, drag the parts with a cable or push them by sending it a little rocket in order to achieve your goal either in action mode and/or puzzle mode.

You can see some of the gameplay in the official trailer:

The game is a little bit short but I hope a follow up will be made. It is really nice to see such a nice game on linux from an independent studio.


Make your dotfiles follow you automatically when you ssh to a server

I finally took a little bit of my time to sort out this stupid problem.

For those who login often on remote servers, how horrible is it to see everything set to their default values once you are logged in ?

bash is your shell instead of zsh, there is no color, no completion, no syntax highlight, vim has none of your plugins available, nada !

The first thing to do is to make your configs as self-contained as possible : for example I use oh-my-ssh for zsh which contains the themes and plugins in its own .oh-my-zsh directory and same idea for vim with pathogen.

Then create a small script like this one that you can alias to your ssh command.

tar c -C${HOME} .oh-my-zsh .zshrc .vim .vimrc .tmux.conf | ssh $1 'tar mx -C${HOME}' 
ssh -t $1 "/bin/zsh"

Edit: OR this cleaner way thanks to mooism2 on hackernews by adding to a specific set of hosts in your .ssh/config

# For example for all your server
Host *
   PermitLocalCommand yes 
   LocalCommand tar c -C${HOME} .oh-my-zsh .zshrc .vim .vimrc .tmux.conf \
               | ssh -o PermitLocalCommand=no %n "tar mx -C${HOME} ; chsh -s /bin/zsh"

What does it do ?

First, it uses a trick to stream by ssh all the required files from your local home dir and decompress them to your remote home dir. I do it like that to avoid to have any special rights set up on sshd to be able to copy files etc ... Of course, depending on what matters for you, you need to modify the list of copied files. Note for the unusual m parameters : it is here to silence a warning you can get due to the time differences between hosts.

Then, it forces an interactive session and gives you the opportunity to select your favorite remote shell.

Another nice trick is to use a oh-my-zsh theme like "agnoster" and set you DEFAULT_USER in your .zshrc

Normal Prompt →
Remote User Prompt →
Remote Root Prompt →

So your prompt will set with you remoteuser@machine if it is a remote shell and a normal prompt if it is a local one.