I3 tiling window manager – try it out!

Why choosing tiling window manager can be a good option for you and how you can get more from your operating system? Find out if it can improve your daily tasks!

Tiling window manager?

In computing, a tiling window manager is a window manager with an organization of the screen into mutually non-overlapping frames, as opposed to the more popular approach of coordinate-based stacking of overlapping objects (windows) that tries to fully emulate the desktop metaphor.

wikipedia

I have already mention i3wm in 4 top performance boosters for linux users post- you can find video showing i3wm features in general:

Here you can see a couple of my workspaces:

Some examples of tiling windows managers:

  1. i3WM
  2. Awesome
  3. DWM
  4. xmonad

Why should I consider switching to tiling WM?

Designed for keyboard use

All popular tiled WMs are designed to be operated by keyboard only (Of course you can use your mouse if you like :)). This means that every action like moving “tiles”, changing current workspace, changing current layout, resizing, going fullscreen etc. can be made by keyboard. You can work in your IDE, ask some questions on skype/slack, do some operations in terminal and get back to source code without even thinking about using a mouse.

I know that these is possible in classical window manager, however tiling WMs “push you a little” to go this way. if you feel (like I do) that its quicker to use a keyboard and want to go this way then tiling managers are probably for you.

Customizable by default

All popular tiling WMs are designed by developers for developers. This means that you can power up your window manager easily, by adding new shortcuts, modes or whole functions.

Finally… Efficient

Using classical window manager I was finding myself very often in reorganizing current desktop. Moving windows around from one screen to another, from one workspace to another. In case of single-workspace systems (like all Ms Windows) you can have a loooong list under ALT-TAB shortcut.

In tiling WM you will forget about alt-tab behaviour. Most powerful thing is that you can teach your WM to place tiles in exact manner that you like them to on particular workspaces. Basically after some time you will find out that you hardly rearrange anything on your desktop. Everything just works for you.

Why i3WM and not other tiling windows manager?

I did try awesome for some time. However I found myself in situation when I did not extend my current desktop environment, because awesome is using LUA scripts for all configurations. Back then I did not know lua so every change was a little bit difficult for me. Especially that awesome was my first tiling window manager. I broke a simple rule: one change at a time 🙂 If you know lua well then you can try awesome, in other case I would suggest you to try i3 – it use very simple configuration files.

My i3

Configuration files

You can find all my configuration files related to i3 here. Download it, change and use it however you like.

Basic keyboard layout

Keyboard layer when used Mod key
Keyboard layer when used Shift+Mod key

What I’ve changed:

  • jkl;  to hjkl for moving around and moving tiles
  • Mod1  to Mod4  ( Mod4  is windows key)

Workspaces

Biggest value from using i3 is automation. You can tell your WM to which workspace every window should go. Back then I used to name my workspaces directly, however after some time I found that I don’t need “names” on my screen as I already know what is where.

Take a look on my current configuration as it is self-explanatory ( $tagX  == workspace X):

As you can see I simply define where i3WM should put particular application. Magic 🙂

Achieving this kind of result is very simple. To find how assign command should look like for your application you have to find its selector. Most often used is class  selector. For finding what you have to put within it you can use xprop  application:

After typing  xprop (probably you will have to install it) you have to “click” on application (by mouse). Then you will receive all data as in above example. This line:

keeps information about class. So If I would like to have pcmanfm always appear on workspace 5 then I will add this line to my config file:

And that’s it!

How I have things organised?

At the moment I use up to 7 workspaces:

  1. Work – main window. I used to have here my current IDE, file managers, and all other applications as this is my “default” workspace to work with. Usually I use here tabbed layout.
  2. Browser – only browsers are usually here. This one also use tabbed layout.
  3. Shell – terminals 🙂 Split layout of course 😉
  4. Conversations – Skype, sometimes qtox or thunderbird when I remember that I still have this one 😉 Usually tabbed layout
  5. Slack – Slack only..
  6. Special – This one is empty. Sometimes I run specific application and when I want to have it on a side it goes manually to workspace 6
  7. Music – Spotify, Vlc. Music in general.

Thanks to automatic arrangement all my applications go directly to workspace that is prepared for them in my mind. So if I want to search for something in the internet then I go to workspace 2. If I need to do something in terminal I go to workspace 3, when I need to ask some of my colleagues about something I go to 4 for skype and 5 for slack. Everything is always there for me as it should be.

Modes

Another great feature in i3wm is possibility to create “modes”. Mode is an extension where you can put more commands under one shortcut. My modes are:

  • resize_window – default mode that you will have out of the box under  $mod+r then you can change size of currently selected tile using arrows or jkl; .
  • exit – mode where I can choose one of:
    • lock
    • shutdown
    • logout
    • reboot
    • hibernate
  • office – mode where i can select one of libreoffice application
  • browser – running one of selected browser
  • ide – as you can guess- it helps me to select IDE:
  • quick – I think of it as “quick access”. For example:
    • postman
    • skype
    • slack
    • spotify
  • screen – this one helps me to prepare my workspace at particular places. Back then it was used to change from single notebook display to multiple displays. Currently it change configuration from notebook display to external one as I don’t use more than one monitor anymore (yes!)

Example mode configuration looks like this:

At first you set how it should look after invoking, then you describe your mode, after this you have to create shortcut to particular mode. Now When I use  $mod+p I will see at the bottom of my screen something like this:

So I can choose from one of above browsers. Please note that after command there is operation to go back to “default” mode. One can create “nested” modes. It’s possible to create mode that will be for example used only during development and change totally all shortcuts and behaviour, however I never get that far 😉

Other configurations?

In my configs repo you can also find a few other things:

  • own shortcuts – which are very easy to add
  • autostart applications
  • i3bar configuration
  • i3gaps configuration
  • color changes

Tips & Trics

Here are a few very useful in my opinion tips and trics that you may want to reuse:

  • Change moving around shortcuts from jkl;  to hjkl . Especially if you are using vim 🙂
  • Add  exec --no-startup-id nitrogen --restore  somewhere near end of config file. It will restore your desktop wallpaper. It’s really useful if you are using multiple displays or change from notebook to external one 🙂
  • Add these two lines to your shortcut configuration:

    After installing scrot you will be available to take screenshots (printscr for full desktop, shift+printscreen and then select desktop part using mouse to take partial screenshot).
  • I found that access to simple calendar can be really useful:

    This is how it looks like:

Afterwords

There is still a lot to say about i3WM. Definitely I will  write more about this great window manager in future. Leave a comment below!

I3 tiling window manager – try it out!

My top 4 performance boosters for linux system users

Here are a few of my favourite Linux “performance boosters”. If you think about starting using Linux OS every day (or you are use it already) at your work then this list can help you to boost your performance. List consists of only very general things – this means I didn’t put on it any specific (like git or mvn) tools which can be helpful only in particular cases. Try it out! I’m quite sure you will not be disappointed.

1. VIM

Yup- VIM. I couldn’t start this list in any other way. Could I? 🙂 Vim is not only a standalone tool. It’s more like text-editing approach. This approach can be used within many other tools (IntelliJ, Eclipse, Browsers (there are plugins!), Sublime, Kate, Visual Studio :)). Also I did try neovim, but probably my knowledge is far too small to use anything than standard vim functions. I’m aware that learning curve is shallow, but every little step further makes you much more efficient during text processing (efficient text processing is quite important during programming :))

2. ZSH instead of bash

I still remember that moment when I moved from bash to ZSH and it was really big step forward in my day-to-day performance. ZHS together with oh-my-zsh its a whole new level of possibilities to improve how you do every day tasks. For instance completions – git, gradlemvn, httpie, npm, docker, kubectl are fantastic. It’s already there and work out-of-the box, so in almost no-time you can boost how you manage things from CLI.

You can select option by using tab key. Of course it’s not only about completions 🙂 There is a lot more (possibility to auto syntax highlighting, great path expansion, path replacement or even spelling correction).

3. I3 tiling WM

In computing, a tiling window manager is a window manager with an organization of the screen into mutually non-overlapping frames, as opposed to the more popular approach of coordinate-based stacking of overlapping objects (windows) that tries to fully emulate the desktop metaphor.

— Wikipedia: https://en.wikipedia.org/wiki/Tiling_window_manager

My experience with tiling WMs started with Awesome, however it was a little bit difficult (as you need to learn lua scripts, and back then my knowledge of lua wasn’t too good). Along with my habits (Before I used gnome, kde, lxde and openbox mostly) this was bad choice (learning lua scripts and change perspective from windows to tiles). I3 on the other hand it’s quite simple to extend and adopt to tiles without swearing 🙂 This one deserves its own post (soon!).

Why using i3 boost productivity? First of all – distraction free. Tiles really helps to keep on screen only things that you really need at the moment. With possibility to auto-assigning particular applications to selected workspace you can provide yourself workspace which help you to be more productive. On top of that there is possibility to create your own modes. Watch screencast of i3 window manager:

TIP: Change default switch focus bindings to more vim-like approach:

4. Z plugin for ZSH

I’ve already mentioned ZSH. However, this one deserves its own place in my top 5, because its very simple, yet very powerful. Z is a plugin that helps you to move around within directories- it tries to remember most recent and most often used directories and help you moving to them using just part of its name. Since I have discovered it I barely use  cd command! Imagine that I work on completable future examples for blog. I can use command like this for that:

Is there more?

YES! There is a lot of small tools which can help you with your performance. However most of them are very case specific (like wrk2httpie or retrospective) so their usefulness is strongly related to particular use case.

Afterwords

Do you have any beloved tools? If so, please share them in comments!

My top 4 performance boosters for linux system users

Euvic Poker basics (part 1/2)

Intro

If you work in distributed team and do planning sessions try tool that was written a year ago by my trainees in EUVIC. We’ve got 3rd version published at the moment. I hope you can find it useful 🙂

This article shows only basic info about EPoker features.

Motivation

I’m aware that out there are some tools very similar to epoker. Why we did our own? We had a couple of requirements which were not covered by any of existed solutions together:

  • I don’t want to create any login by default to play – because often, I have to use it with external customers (POs), sometimes I need to convince them to use planning sessions, and every additional step is a bottleneck.
  • I can’t put any business data into external system – and a lot of these tools require to put title or description of every user story. Usually I do planning sessions using online tool + voice call. We discuss using voice call and online tool should be only replacement for “table and cards”.

Basically epoker:

  • Do not require any sign-up or other registration process. It’s just ready to use.
  • Don’t need to store any business data. And you don’t need to believe me. You just don’t put any business data. Moreover even information about poker sessions are stored only while particular room exists. Room and all info are just deleted after 15 minutes of last connection to it.
  • Don’t use any kind of user-tracking system. The only stats which i have is number of rooms created per hour/day and average number of participants.

How to start?

It’s really simple! Go to http://epoker.euvic.pl website and click “Create Room” button. Now copy current page address and send it over to you colleagues you want to play with. That’s it.

Basic features

  • Room creator starts as administrator, but can give this permission to anyone in room by clicking right mouse button on any other player and use option “Give master“. In case you have master permission already you can take it from someone using “Revoke master” option

  • Anyone could be a Voter (by default), but at any time you can start play as a watcher. It’s very usable for POs and ScrumMaster which don’t vote on any card, just watch the game. If you want to stop be able to vote just click on “Voter” button
  • New deal – if you are still playing in the same game but without success on shared estimation you should start new deal. If team agreed on any value then press “New Story button instead

 

  • You can use “Revoke” button to show all cards at any time if you have master permission

  • You can change card deck between games, there are 3 options at the moment:
    1. Default planning poker deck – 0, 0.5, 1, 2, 3, 5, 8, 13, 20, 40, 100, ?, break
    2. Powers of two – 0, 1, 2, 4, 8, 16, 32, 64, 128, ?, break
    3. T-Shirts – XS, S, M, L, XL, XXL, ?, break
  • Everyone can change the theme from light to dark one at any time

  

  • You can change your display name at any time. Epoker will save your choice in cookie so it will be automatically used for you next time

Advanced features

There are a few more advanced and features. However, they are valuable only within specific business context, that’s why I would like to describe them in 2nd part providing additional information when to use them 🙂 Stay tuned!

Euvic Poker basics (part 1/2)

CentOS + Graphite + Grafana + NGINX Monitoring

This article will show you how to create basic environment for monitoring your distributed application in one place using Graphite and Grafana. Recently I did somehow similar configuration on CentOS Linux so I will show you how to make first step into world of monitoring in this particular OS (version 7.2 actually ;))

What we want to achieve?

Basically we want to create environment where any number of applications (hosted via NGINX in this example, but it could be anything) are reporting to single Graphite. Then we want Grafana for creating some nice dashboards that will give us just in time information what’s happening within our applications.

Graphite + Grafana basic environment

 

Of course this could be much more complicated – Nginx can be used only as LoadBalancers for multiple instances for some application modules. Then we want to both – load balancers and apps to tell our graphite about their real load. We will try to cover more complicated solutions in future.

Why Graphite and Grafana?

Basically because it’s somehow standard these days in IT. Grafana is just a platform that will give you nice dashboards.

Of course you can use tool such as Zabbix but this is a bit more different approach. First of all you have to provide more configuration info in zabbix to give you desired charts. Think about this solution that we want to create as a push notification system to Graphite. And everything – no matter how many instances of specific applications you have will show immediately when application start. I’m not familiar if zabbix can show you that many options on one dashboard and adopt to various numbers of data providers. Imagine auto-scalable system where number of instances of particular module can vary.

For Graphite instead of default database (Whisper).

Can I use other linux distro?

Yes you can.

Graphite – installation

Please use all commands with administrative privileges.

Before you start please update your distribution and install EPEL repository:

Now we can install httpd server (Yes Apache – I don’t mind which server will serve grafana and graphite and this is most common solution so you will get more results while searching for any troubleshooting). Also in this step we will install graphite and MariaDB – our MySQL server.

If you don’t want to use MariaDB but different database or just default one you don’t have to install all mysql/mariadb related packages.

Within next steps we will start and enable http server as well as myslq server:

Now we should create database for graphite (please change passwords!):

Graphite – configuration

Lets start to configure our graphite installation 🙂 We will use mostly default configuration so let’s copy default example configuration files:

Now we should configure graphite to use our database. Please edit /etc/graphite-web/local_settings.py  and add our database configuration:

Now we can generate database schema:

Last step is to set some file permissions:

Now we can reconfigure Apache to serve our graphite! Please note that I serve graphite on port 8080.

Last step is to add port 8080 to httpd configuration so Apache will listen on that port. Please add port 8080 so you will have in /etc/httpd/conf/httpd.conf two ports configured:

At the end restart apache and you should have Graphite installed and configured.

Grafana – installation

This one is easy 🙂

And if we want to serve this also via httpd:

Done.

You should now see at http port 80 grafana. Please add graphite as default source. After installation there is only one user: admin with password admin

Security

Also – In my configuration graphite is accessible only from localhost so I don’t add additional security to this part of monitoring environment. All modules have to send data via tcp port 2003 which is accessible internal only. Only one access point for whole monitoring solution is Grafana – it have simple user management so you can use it out of the box. If you need to send data to graphite via internet please read this article before you start.

NGINX Monitoring

Next step is to provide simple but efficient nginx monitoring. First you need to install nginx, collectd and collectd plugin for nginx:

We will use Stub Status Module to give status information from NGINX then we will use collectd to send data over network to installed in earlier steps graphite. On some environments Stub Status Module is already compiled into nginx. If its not please use same steps as in Requirement section on this page.

Now we need to add information about endpoint that will serve our status information. Please add to /etc/nginx/nginx.conf  this code (in server section):

Please note that this endpoint will be accessible only from local machine. If you want to check if its ok. Use wget -q -O - "$@" http://localhost/nginx_status to get information about current nginx status.

Now we have to configure collectd. Everything is in /etc/collectd.conf  file. We want to enable nginx plugin and write_graphite plugin:

Restart nginx:

At this point  you will be able to create and add graphs. In next article in this series I will show you how to configure Grafana to adapt to multiple instances of nginx and show reasonable information just in time.

CentOS + Graphite + Grafana + NGINX Monitoring

Retrospective – Let me see your logs!

About three months ago I came across a tool (thanks to the Silesian JUG!) that promised to accelerate and facilitate searching and browsing over server logs. Sceptical as I was, I had a quick look at the short tutorial: Youtube Video – Retrospective Tutorial .
I decided to have a closer look at the application.

Installation and first impression

I tested the application on my Linux Lubuntu x64, all went smoothly. When I opened the application I saw … Eclipse RCP 😉 That’s good, especially as I am a supporter of the solution. A nice introductory bar appeared on the left side, on the right side – the main interface (a very simple one, which I consider a plus).

Configuration

Let’s get down to the subject: let’s configure some server logs. In the File menu we select sources. We get a screen that allows us to manage all sources based on profiles. You can create multiple profiles and each can have any number of files (probably in the healthy range). This enables more efficient use of the tool. Then we can choose an option that only servers for application X or developer servers will be searched through etc. We create profiles ourselves so it all depends on us. The application allows you to connect to the servers via any port (SSH), you can also use an SSH key – a very nice addition, because sometimes we do not know the login / password and we only generate our key and send it to the administrator. Of course you can also choose the local host.

We are searching

After having determined the connection with the nice wizards we can add both individual files and entire directories, which is cool since most servers create a separate file for each day. There is also the possibility to determine files based on simple filters (*. log * :)). After adding sources we receive a nice summary of the entries for specific profiles. What is most pleasing is the fact that the configuration takes no more than 5-10 minutes. Provided that we already know how to do this, adding a server and selecting the source directory takes no more than two minutes.

We have two options for searching sources: Tail and Search. The first one, as the name suggests, allows you to continuously search over the latest entries in the searched sources and track what’s going on whereas the second one enables a single content filtering, for example when we are looking for a specific error.
At first, we define a global filter for the selected profile, for example, to display only entries with [ERROR] in the body. After starting the search it is not possible to change the filter, but you still get a local filter that allows you to highlight and browse additional information in real-time.
In addition, we can limit the results based on content and by specifying a range of time for the search mode, which is very useful: “Hey, at 10:40 yesterday something strange was happening with the application, can you find out what it was?”.
It is worth mentioning as well that a search screen is a tab and you can easily add additional ones and, what’s just been introduced, change their names. It is also possible to save the view (bookmarks, main filters) which will allow for the preparation of the “super-extra-console” with the logs. Then we only need to load the settings.

Viewing the results

By default there are 4 columns:

  • Date / Time – Shelled time and date of entry
  • Date – the content
  • Host – the server from which the entry originates
  • Path – the path to the file

For me personally, the most useful are the first two columns so I turned off the remaining ones, but it definitely depends on how you configure the profiles (I have one profile 1 <-> 1 server because I don’t work with cloud-based applications. If I did, I would probably apply a different approach :)). However, it is important that you can turn these columns off. If the standard column date is too lean for us, we can configure a profile using the so-called ‘Column Split’ and adjust the displayed information for our “evil purposes” (see info how to do that below).

Conclusion

In conclusion, I am positively surprised by the creativity of Retrospective’s authors (the tool is not extremely difficult, but to the best of my knowledge no one has yet come up with something like it), easy setup, ease of use as well as its focus on a specific goal. This application is designed to search over all kind of logs. It’s very good for many popular time formats; it allows you to quickly grasp more machines. I would definitely recommend it to server administrators and architects managing machines and applications. It is already useful for the standard configuration: a production machine, test machine, developer machine. The more servers we are running, the bigger the profit (especially when it comes to time saving).

The only thing I’m missing is a possibility to add a column to the log level. I am aware that some of the log files do not have anything like that but it would be a very nice option. Especially if it was combined with filtration. I noticed that I often type in a name of the log level in the high-speed browser.

Edit: Such a function exists! It is a bit hidden and it’s called ‘Column Split’. After creating sources we can customize the date format, entry format, etc. by using the ‘Configure sources’ tab. In the last (third) step that I didn’t previously notice, you can create custom columns for each source. Here a ‘no split’ option is chosen by default, but you can change it into the character split (separation with a single character eg. semicolon) or even a conversion pattern where we define what the entry will look like. Additionally, the authors have provided a considerable amount of ready-made designs (as mentioned LEVEL, MESSAGE, CLASS). Well, knowing the tool also comes useful 🙂 Here you can see my laziness, I did not expect such a feature in this place, I was just right-clicking the columns in the search results. Maybe there could be a shortcut there? 🙂

Shopping

A single license costs $ 58 (more here: Buy retrospective ), and I think this is money well invested for somebody who uses grep and tail every day. To sum up, it’s also worth mentioning that in the last three months two new versions have been released and the application is available on 3 platforms: Windows, Linux and Mac. If you are interested read more details here, and go directly to your boss for money :).

Retrospective trial version (30 days) can be found here.

PS: For writing this post I have received no financial or other profits – I’m merely expressing my personal opinion.

Retrospective – Let me see your logs!