Monday, September 5, 2016

Teambuildings, conferences and pulling your hair out over simple update

So, you've been invited to spend a weekend with your company colleagues. There is also a conference event scheduled at destination. You can learn something, meet new people, exchange ideas, have fun. Well yes, splendid, lets do this.

Early morning, still dark, driving by bus. Developers like developers, still dreaming without it's first coffee. So everyone got back to sleep. First words could be heard over a coffee on a gas station. And adventure begins...

Arrived at our destination. Smell of sea, fresh wind and warm sun were so overwhelming so decision has been made to go to beach and relax first. Couple of drinks and conversations are on fire. Couple of minutes later, first phones got into action with some texting and taking photos. Amazing how we made without them so far :)

Next step conference. While listening to presentations of various subjects I've decided to take some time and update my Tumbleweed. Of course you don't do it on work days and weekends you use for some other activities so it was a perfect time. Well at least it was looked like one... :)

Booted my openSuSE Tumbleweed, set valid repositories and with confidence started Software application and clicked 'Update and Restart' under Updates section. Fast restart, and then hang on boot.. Waited for couple of minutes. Nothing. WiFi for sure, I was thinking. Never mind, lets do this again manually with zypper.

Restart has booted it again. Started zypper update process.
$ zypper up

And here we go. God ol' zypper working just fine. 1/1227 packages. Well that will take some time. And than it showed error stating he can't write to disk. Why not? Let's try again. This time only 200 packages. Should be fast. Going nicely and again at the end same error. So you can download and install some packages but others can't? Is it a repo problem?
Oh, presentation is over. Launch time, never-mind I'll continue later..

Conference day was coming to the end. One more try and now I got error again stating can't write to disk but this time on first package. Than in occurred to me to check disk. Quick:
$ df -h 
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb6        40G   39G  50MB  100% /

So it was problem all along. Trying to delete some unused journal logs to free some space.
$ journalctl --vacuum-time=0d

$ df -h 
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb6        40G   36G  50MB  100% /

Hm, I have available space but usage is on 100%? Is my filesystem corrupted?
No, as it turns out root is on btrfs partition and it behaves differently as opposed to traditional filesystems. It has the concept of allocating space on the underlying device, but not actually using it for files.

Also root partition was filled with update snapshots. To check the problem volume use:
$ btrfs subvolume list /

To delete snapshot you do not need use:
$ btrfs subvolume delete -c path

Where path is from previous command subvolume list that says "snapshot". We are using -c flag to commit changes immediately to btrfs file system.
Finally, after reboot zypper update passes.

Last presentation is over, and this reminds me again why I don't do updates on work days :D
And now, after-party and some team strengthening time.
Until next time, happy updating ;)

Friday, April 15, 2016

Acer R5 471T and Tumbleweed/Windows dual boot



First what you notice is that laptop is very slim design. Keyboard looks so thin, make you think they don't actually move while typing at all :) But when you start to type, it is really great! Screen is very glossy so even a smallest light reflection will make you move your head to proper angle. But it is great for indoor use.

After pushing power button, Windows has booted in couple of seconds. Great, everything works, even keyboard back-light and multi touch screen! And now let's install Linux along with installed Windows 10.

First install partition manager and resize 250GB parition to 150GB to make 100GB of unpartitioned space.

Next you want to make a USB installation stick. For OpenSUSE Tumbleweed you need to use ImageUSB.
Download Tumbleweed DVD ISO image from HERE.

Stick your flash drive with Tumbleweed installation to usb slot. Enter BIOS with F2 end enable Boot select with F12, or continue to Boot section and move USB Flash drive to first position.

After that installation will start. Because we have UEFI secure boot enabled it will ask us for confirmation to trust opensuse binaries for booting. After that installation will find unpartitioned space and suggest partition setup for root, home and swap paritions. Also it will set a boot mount point to EFI boot partition. This will install EFI binaries to proper place inside EFI boot parition.

After installation is finished it will reboot to windows again. It is because windows is overriding grub boot settings. To get around this open command prompt as administrator and execute:
bcdedit /set {bootmgr} path \EFI\opensuse\shim.efi

Finally grub menu! Tumbleweed has booted but WiFi is not showing any networks found, and it says WiFi not available.
$ sudo lspci
01:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32)

There is problem in firmware for this WiFi card and it does not work with 4.5.x kernel.
Solution is to download Windows firmware binary and replace it with current linux version like so:

$ sudo cp /lib/firmware/ath10k/QCA6174/hw3.0/board.bin /lib/firmware/ath10k/QCA6174/hw3.0/board.bin.orig
$ sudo mv ~/Downloads/eeprom_ar6320_3p0_NFA364xp.bin /lib/firmware/ath10k/QCA6174/hw3.0/board.bin
$ sudo reboot

Finally fully operative dual boot!
Enjoy!

Wednesday, March 2, 2016

AngularJS Single Page App with Laravel API


Idea is to create Single Page App in AngularJS to demonstrate basics such as:

  • custom directives
  • routing capabilities using hashtag
  • controllers for particular routes
  • making HTTP requests and handling responses
  • CRUD operations on frontend and API calls to the backend
  • uploading a file/image
  • pagination and accordion Boostrap UI components

AngularJS SPA files:
  • resources/views/index.blade.php
  • public/js/module/module_spa.js
Complete code can be found HERE.

Step by step Laravel work log for backend, can be found HERE.

Thursday, February 18, 2016

PHP solutions for Codility lessons


Hi Codilitiers!

I want to share with you solutions for Codility lessons as result of my preparations for Codility test. If you are using PHP to go through Codility lessons and tasks, THIS COULD HELP.

PHP-Codility


Codility tasks have been solved using PHP as preparation for TopTal.
There could be multiple 100% solutions for particular task and 
there are separated partial solutions in ./partial folder which 
represents solutions before perfect score was hit.

Hope it helps!

Play Chrome Chess at work

As a practice in NodeJS/SocketIO I've made simple Chrome extension to play chess online with your friends. It is still in beta but I will continue with development and support as much as spare time allows it.


ChromeChess is simple PVP version of good old chess where game of chess is just click away. 

This extension acts as simple chess user interface inside small popup window.

So, basically you can continue your daily work inside Chrome while still playing chess. When opponent makes his move you will be notified so you can open chess board and make your move.

Hope you like it. Enjoy!

P.S. For developers that want to help with development you can find me HERE.