How to fix “error: VM is paused due to host power management” error

Sometimes, when Vagrant VM in Virtualbox can stuck in this state and you cannot resume execution at all.

Turns our it happens only when your host machine hibernated or suspended while Vagrant VM was running. And that also should co-oncide with Ubuntu’s systemd missing some dbus event.

You can notice that after such failed restore your network is also missing and you need to restart it manually.

The solution?

Easy – suspend and wake up your host once again and VMs will be in a running state automatically.

Here is more discussion.

How to Run Fullscreen Games In Linux With Dual Monitors

Sometimes video games under Linux go crazy and full screen mode starts on totally wrong monitor. And basically there is no way to tell wine which monitor to use.

This work around worked for me

  1. disable monitor which you do NOT want to be used
  2. start game in full screen mode and let window manager/wine/whatever remember it’s position
  3. enable second monitor back
  4. fix display positions

 

Visual way

On Ubuntu just go to ‘System configuration’/’Displays’, display your monitor you do not want game to use and then run game. After it remembers settings, turn monitor on back again.

Command line way

Some people like it hard way, so here is how to do it from command line.

Step 1

To find our which monitors do you have just run xrandr command

Screen 0: minimum 320 x 200, current 3520 x 1080, maximum 8192 x 8192
LVDS connected primary 1600×900+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1600×900 60.1*+
….
HDMI-0 disconnected (normal left inverted right x axis y axis)
VGA-0 connected 1920×1080+1600+0 (normal left inverted right x axis y axis) 510mm x 290mm
1920×1080 60.0*+
….

You are interested to find display names – they are in bold.

Then issue following command to turn off the monitor

xrandr –output VGA-0 –off

Step 2

Run game as usual in fullscreen mode.

Step 3

Turn monitors back and assign primary/secondary roles

xrandr –output VGA-0 –noprimary –auto
xrandr –output LVDS –primary

–auto argument tells xrandr to fidn mode suitable for monitor best and turn it on.

Step 4

You may need to run ‘System configuration’/’Display’ control panel to fix display mirroring/position.

Afterwards the game should start on correct display.

 

 

 

Listing Google Container Registry images and tags

Docker is amazing tool when it works and supports what you need. And it is a living hell, when it does not. It takes some amount of trying and searching to find working solution 🙂

Docker get integrated with Google Cloud and allows you to push and pull images to private repositories. But there is no easily found, documented way to list images that you have in a project in Google Cloud and what tags you have for each image.

You can see that information from Google Console, but there is no build-in docker command to do that.

Fetching image information from Google Container Registry

You need to have gcloud installed and authenticated.

Replace

  • ZONE – with zone where your images are hosted (eu, us, asia)
  • PROJECT_NAME – name of your project
  • IMAGE_NAME – name of the docker image you want to explore

Getting list of images from GCR

curl -u “oauth2accesstoken:`gcloud auth print-access-token`” https://ZONE.gcr.io/v2/PROJECT_NAME/tags/list | json child | json -a

Getting list of tags for specific image from GCR

curl -u “oauth2accesstoken:`gcloud auth print-access-token`” https://ZONE.gcr.io/v2/PROJECT_NAME/IMAGE_NAME/tags/list | json tags | json -a

You will need to install utility json beforehand

npm install -g json

 

 

 

Updates to the blog

I recently deleted this blog entirely because there is so much things happening, so I do not think previous one was relevant to me anymore.

I finally feel free to say that I’m interested and involved in so much different domains. It includes programming and IT, which I love and continue my involvment in. It includes design and art – I was painting for some time and now I’m more into product design – we launched leather goods ‘Smiles Bags‘ company  with my wife and I design products and also doing a lot of designs for our brand. It includes psychology and people communication – which I will cover in this blog more deeply. This list is anywhere far from complete, so it will grow over the time 🙂

 

 

SOLVED fglrx on ubuntu 14.04 and wine problems

If you have fglrx display driver, run 64-bit system and run 32-programs under wine you may face problem with OpenGL.

Sometimes 32-bit windows programs (under wine) which use OpenGL stop working giving criptic error messages.

The problem is that they lost correct 32-bit Mesa driver. Following commands fix the problem:

rm /usr/lib/i386-linux-gnu/mesa/libGL.so.1
ln -s /usr/lib32/fglrx/libGL.so.1 /usr/lib/i386-linux-gnu/mesa/libGL.so.1

Making Dropbox and DejaDup friendly

Is your Ubuntu works slow just after the login or when your backups running?

it’s may be because Dropbox or DejaDup (called ‘Backup’ in Ubuntu) are doing a lot of raeding from a drive.

This two commands solve all the issues, making both programs run with as low priority as possible.

Making Dropbox friendly (especially if you have over million files in your Dropbox folder):

ionice -c 3 -p `pgrep dropbox`
renice 20 `pgrep dropbox`

Making DejaDup/duplicity  friendly

renice 20 `pgrep duplicity` `pgrep deja-dup`
ionice -c idle -p `pgrep duplicity`
ionice -c idle -p `pgrep deja-dup`

Have fun! and fast working computer 🙂