The linux philosophy promotes modular software. Linux itself is modular. This ensures plug and play ability, extensibility, and customization to your heart’s content. This also means that you can get bare-bones software and install only the bare essentials suited to your needs.
Bspwm or Binary Space Partition Window Manager, is based around the same philosophy. Bspwm is a minimalistic modern window manager that represents windows as the leaves of a full binary tree. Now due to the fact that there is not a lot of comprehensive documentation out there for bspwm (especially as compared to other window managers like i3), I decided to go ahead and make a (somewhat) practical guide myself. Forgive me if this particular entry in the series is too long.
sudo apt install bspwm
To run it, simple add the following line in your ~/.xsession file:
exec bspwm
Logout and log back in again, and boom! You are good to go. When you login, you will be greeted by a black screen. That is because bspwm doesn’t know how to draw the wallpaper yet. You will also notice that none of your typical window manager key bindings work. That is because bspwm requires a third party daemon for the same.
Logout from the current environment and login to either a tty, or any other environment, and let’s get started with the configuration so that we can make bspwm a bit usable.
SXHKD: Adding a keybinding daemon
An example configuration lies in the /usr/share/doc/bspwm/examples/bspwmrc file. Simply copy the bspwmrc file to the ~/.config/bspwm/ directory to get started. The default config file looks like this:
Adding a key binding daemon
Sxhkd, mentioned in the architecture given above, stands for Simple X Hot Key Daemon (And you thought herbstluftwm was hard to pronounce). It runs in the background and uses a very simple syntax to bind keys to commands. To get started with it simply run:
sudo apt install sxhkd
Sxhkd looks for a configuration file for initialization. You can create one at ~/.config/sxhkd/sxhkdrc. Let us look at how to add some basic key-bindings to get started with bspwm:
our sxhkdrc file:
The second rule makes sure that the moment we hit alt + Escape, our sxhkd reloads automatically, therefore making any further changes will not require us to manually kill the daemon and restart it ourselves.
To start the daemon simply add the following line in your bspwmrc:
sxhkd &
Now logout and login again. You will be greeted with a black screen, but the moment you hit alt + Return, you will get the terminal of your choice! Now this is all we need for further configuring our bspwm.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce commodo luctus est. Ut ultricies mauris et ultricies interdum. Morbi risus ex, gravida sit amet vulputate nec, euismod sit amet ex. Aenean molestie imperdiet lacus, ut posuere metus pharetra quis. Nullam accumsan tincidunt sem. Fusce non metus sem. Nulla varius, arcu eget vestibulum pretium, magna velit pretium diam, eu viverra velit velit sed velit. Curabitur neque erat, tincidunt vel dolor a, iaculis vulputate est. Phasellus sodales massa a mauris venenatis tincidunt. Quisque diam lorem, volutpat non eleifend vel, porttitor et neque.
Sed erat velit, eleifend et varius nec, efficitur et nibh. Proin at pretium ligula. Aenean nunc nisl, aliquet eu risus non, fringilla rutrum dui. Aenean convallis ultricies porta. Donec tincidunt finibus libero, sed efficitur dolor sodales eu. Nullam nisi leo, auctor vitae mollis in, maximus quis nisi. Nam laoreet est elit, quis maximus nisl porta sit amet. Duis volutpat iaculis urna in feugiat. Aliquam fringilla fringilla tortor non ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Morbi lobortis nunc ac tortor dignissim, lobortis scelerisque eros congue. Sed lectus enim, ultricies at varius et, rutrum lacinia ex. Donec enim arcu, ullamcorper facilisis lectus tincidunt, elementum finibus justo. Quisque nec neque nec ligula blandit efficitur quis sit amet diam. Curabitur et auctor odio. Etiam varius mi eget elit vestibulum, a dictum nisi convallis. Vestibulum a arcu eu velit maximus tempor non nec leo. Cras id purus ex. In a orci massa. Phasellus sollicitudin libero vel nulla dignissim, eget vehicula mauris sodales. Phasellus maximus tempor quam, non venenatis mauris condimentum quis. Duis finibus enim sit amet ex convallis pellentesque. Mauris vestibulum bibendum dolor.
Just a quick note, but it seems that despite having the whole thing going on in config files, Magento doesn’t actively do a version diff and reload a new module. If you want the system to reload the module (and re-run any database setup, etc.) take a look in the core_resource table.
Just delete your module from this table and then clear Magento’s cache. That should be all it takes to re-load the new module into the system.
Update: What I said above about the versions being meaningless isn’t correct. The mysql4-install-X.X.X.php files will only be run once by the system. However, by changing the version value in your XML config, you’re telling the system which install file it should be looking for. So, for example
//this in your config
0.2.1
//would load this sql install file
mysql4-install-0.2.1.php
…
When you’re deploying new versions of a module, be sure to change the version of your install script. During development though, it’s still best to just delete the record from your core_resource table.
Octopress is a framework built on top of Jekyll. It’s a static site generator which means that it lacks advance feature which would normally require scripting and a back-end like Wordpress. If you want to know whether you should switch to Octopress or would like to know some tweaks, tips or adjustments then continue through this post.
Why To Migrate From Wordpress
Wordpress is a great blogging and CMS platform, but it just had too many features for my personal blog.
So far I have found Octopress easier to maintain than Wordpress. There is no need to maintain wp-super-cache which serves up static pages in the same ways as Octopress along with not needing to manage a local and external LAMP stack.
WordPress blogs are a common target for hackers and spammers. To avoid this you need to keep your version of Wordpress constantly up to date.
Octopress allow you to create pages using Markdown instead of or along with HTML. Markdown has a cleaner, simpler and more readable syntax.
Octopress uses Jekyll to build pages. All pages of the pages are static and no server-side processing involved. This means that any requested page can deliver immediately by the server to the user.
THEME ETC, READY FROM THE GET GO
Features You Might Miss
You can’t edit online from anywhere. With Wordpress a mobile app was available so you did not need to be at your computer/laptop to publish new posts.
Yay Markdown. Shame there is no solid way to manipulate images except by hand. I have currently worked around this by using Picasa to host my images which will cache my images and resize my images.
Octopress does not feature drafts, previews or publishing. When you deploy your site, you deploy everything. And the publication date is the date it was started, not when it’s finished.
Although it’s nice not having to use the web interface it’s also a feature which I also miss being able to post from anywhere, on almost any device.
SLOW PREVIEW LARGE POST
Octopress has less plugins and themes available than Wordpress, If you want more features you will need to wait for someone to write it or write it yourself.
By default Octopress does not have a comment system. Although there is the option to use an external service for page comments such as Disqus. But using a service like this means that the comments are not hosted on your service and you lack the flexibility of the Wordpress commenting system.
Conclusion
Octopress is a great platform targeted at programmers who want to start blogging without having the hassle of customizing static page generators and caching on Wordpress. Personally I think that Octopress is ideal for my personal blog or a blog maintained by several developers which is where version control becomes essential. Although it is not practical for other user like a normal blogger who just wants to write content, a copy-editor or a business looking for more advance features such as LOREMIPSUM.
Tips, Tweaks & Adjustments
…
Faster Page Generation Using Isolation
If you have a lot post in source/_posts then it could take a long time to compile your posts every time you update you blog.
If you are only working on 1 post at a time then it would make sense to only compile that page, to do this use rake isolate[post_name].
This will isolate the post your are working on then automatically move all other posts to source/_stash.
When you are ready to publish your site, use rake integrate, which will move all posts from source/_stash and move them back to source/_posts.
---
layout: page
title: "404 Error"
comments: false
sharing: false
footer: false
---
Whoops, the page you’re looking for cannot be found.
Maybe you can find what you are looking for in the [archives](/blog/archives/).
There is a related post plugin already included in Jekyll, to use it open up the _layouts/posts.html template and edit it
1
<a>CODE...</a>
To enable this function open up _config.yml and set lsi: true
The lsi option will use a statistical analysis to calculate which pages are most relevant.
Now you need to install GSL using Ruby Gems.
1
$ gem install gsl
After GSL is installed you can regenerated your blog.
Category List / Cloud Tree
Download the files from Github.
1. Save tag_cloud.rb to plugins/tag_cloud.rb
2. Save category_list.html to source/_includes/custom/asides/category_list.html
3. Append to default_asides in _config.yml:
You can escape special characters in Markdown used in formatting using a \.
For a list of characters you can escape take a look at this article from Daring Fireball.
Popular Posts
Open up your Gemfile and add this: gem 'octopress-popular-posts'
Install it using Bundler: bundle install
Run the installation command through Bundler: bundle exec octopress-popular-posts install
The popular posts asides will now generate whenever you run: rake generate
Open up config.yml and add this line:
1
popular_posts_count: 3
Append to default_asides in _config.yml:
1
default_asides:[custom/asides/popular_posts.html]
Offloading Images to Picasa
At first I hosted all of my images using Octopress, then later switch to Picasa to host my images becuase of the following.
Ok, nothing to fancy so far but we still need to create the dog ear for the top right of the icon. To do this we will be using borders to create a triangle which floats above the div using absolute and relative positioning.
One unusual thing about borders is that the browser draws them at an angle. One side of the border is colored for the colour of it’s sides (top, right, bottom, left), and the rest are left transparent. You can set the border width to a higher value e.g. 32px.