• C++ / Unreal Engine game developer
  • VR and Oculus developer
  • FreeBSD ports contributor
  • *nix enthusiast

My Reddit Wallpaper Downloader Script

My i3wm setup with amazing gruvbox color scheme and a wallpaper from Reddit

i3wm setup with amazing gruvbox color scheme and a wallpaper from Reddit

Update [2019/05/08]: Many people have been asking for the wallpaper in the above screenshot. It is from System Failure II, oil on canvas, 31x43” on r/Art.

Well, I am really fascinated by Reddit art and genuine creative ideas such as Scrolller which was made possible thanks to gazillions of art pieces scattered throughout various art subreddits. I am also fascinated by Unix philosophy and have been a *nix enthusiast for as long as I can remember. In addition to all this, the discovery of r/unixporn - realizing I am not the only one who cares about aesthetics of their Unix box - was a huge blow for me; to the point that studying the GitHub dotfiles posted along the screenshots on r/unixporn by fellow nix-enthusiast redditors felt like a day to day hubby for me.

All the while, I had a successful experiment with writing a complex piece of real-world software in pure Bash with an amazingly wide range of features for around 3.5K lines of code. The real excitement came when it made to the official FreeBSD Ports Tree. In spite of the fact that many people find Bash syntax annoyingly ugly and unmaintainable and often wonder why do people still write shell scripts by asking it on Quora, since MS-DOS 6.22 era, I did develop a certain love–hate relationship with shell scripting languages such as Batch Files, Bash, etc. Thus, still I do automate almost everything with these ancient technologies.

So, here is my fully-configurable wallpaper changer software written in bash which automagically fetches and display wallpapers from your favorite subs. It has been powering and brightening up my i3wm setup for the past eight months which led me to the conclusion that it deserves a proper introduction.

[Read More...]

HackYourFuture First Game Development Workshop Report

HackYourFuture First Game Development Workshop Report

HackYourFuture First Game Development Workshop Report

OK! Today, HackYourFuture held their first-ever gamedev workshop titled “Introduction to Unreal Engine 4 Game Development Using Blueprint” at their Amsterdam office, which I’ve been given the opportunity to present to their alumni on HackYourFuture’s behalf.

Since I’m still very excited and fascinated by the culture of sharing and the friendly environment governed by HackYourFuture, I decided to share the presentation file which I did prepare for this four hour workshop under the terms of (CC BY-SA 3.0) Creative Commons Attribution-ShareAlike 3.0 Unported License, to be used by anyone who is either new to game development or is intersted in the topic. It’s jam packed with so much information for absolute beginners. Feel free to share and adapt according to your own needs under the terms of the license.

The presentation can be found at the end of this post in PDF, OpenDocument Presentation, or Microsoft PowerPoint formats.

[Read More...]

How to Run Multiplayer Call of Duty 4: Modern Warfare (Promod LIVE) using Wine on GNU/Linux

Call of Duty 4: Modern Warfare

Call of Duty 4: Modern Warfare

Well, I haven’t played a multiplayer game in ages until recently, when my cool boss announced regular playtimes for all the employees in our company as a group activity in order to put the fun back into work. Since I’m a die-hard COD4 fan and I used to play Promod LIVE heavily with colleagues and friends, I proposed Call of Duty 4: Promod LIVE 220 which happened to be favored by everybody; except there was one issue: everyone uses Microsoft Windows while I’m developing UE4 games on a single-boot Funtoo Linux system.

Naturally, my first attempt was running it inside a Windows 7 virtual machine under VMWare Workstation for Linux which supports up to Direct3D 10 (the exact API used by COD4). Sadly, the experience was very poor and painful with lots of unbearable stuttering on my decent hardware. Thus, the last resort was running it under Wine, which I used to happily run many Windows applications and games under it for many years. Though, throughout those years I replaced almost every Windows application with an equivalent or an alternative Linux application until I gradually stopped using it. In the meanwhile, I also distanced myself from traditional desktop environments such as GNOME, KDE, Xfce, and LXDE, while experimenting with various window managers specially i3wm, which caught my attention for many good reasons. So, in the end I made up my mind and alienated myself from desktop environments once and for all.

Running a fully-fledged game engine such as Unreal Engine 4, I expected COD4, Wine, and i3 combination to work fine out of the box as it would under any other DE. Well, it turned out that I was too simple-minded about running a fullscreen game such as COD4 under Wine/i3wm. Hopefully, as the Wine FAQ states the workaround is super easy.

Here is the full guide on running COD4 v1.7 with Promod LIVE 2.20 on GNU/Linux.

[Read More...]

Migrating From Hexo To Hugo

Hexo was so perfect and fast that I thought I will live with it happily ever after forever. Shortly, after I migrated this blog from Octopress 2.x to Hexo, I came across Hugo static generator with support for blogging. The idea of having a blazingly fast static generator written in a compiled native language seemed intriguing to me. I tried to migrate my blog to Hugo soon after multiple times which led to failure every single time due to lack of a few features in Hugo.

Fast-forward, I played around with Gutenburg (written in Rust) a few month back. I found it to be an awesome project. Not only, every feature put together thoughtfully, but also the developer is very very responsive and welcomes new ideas and contributions warmly. Nonetheless, it’s still young and immature. So, it failed me too.

I came back to check out Hugo once more last week and to my surprise, I found it really stable and production ready with tons of features and themes. So, here is my new blog ported over to the mighty Hugo.

P.S. Although Hugo satisfies all my current needs, I’m more interested in Rust projects than the Go ones since I’m playing around with Rust as an alternative to Modern C++ these days. So, I’ll keep an eye on Gutenberg; who knows another port might be underway :)

Discourse as a Blog Comment Service on FreeBSD without Docker

Update 1 [2016/09/30]: A section has been added to the end of the article for dealing with major FreeBSD upgrades.

Update 2 [2016/09/30]: A section has been added to the end of the article for upgrading current installation of Discourse to newer versions.

Update 3 [2016/09/30]: A section has been added to the end of the article for installing Discourse under Ruby version managers which is required for dealing with newer versions of Discourse since the current system-wide version of Ruby on FreeBSD is 2.2.5p319.

Update 4 [2016/10/06]: I decided to get rid of Discourse on this blog for various reasons including negative feedback from my readers, performance issues, being a memory hog and not so easy on memory, difficult maintenance, dealing with building Ruby Gems which is a tedious task in case they fail to build and a bug that duplicates my posts and creates a new thread for each post which means it won’t show previous comments. Last but not least, in my estimation it’s too heavy for such a small task such as a comment system. As a result, this guide won’t be maintained anymore.

Figure 1. Discourse Logo

Figure 1. Discourse Logo

Well, when it comes to blog comment hosting services for static blogs, you will have a plethora of options such as SolidOpinion, Disqus, Livefyre, Google+ or Facebook comments, and many more. Unfortunately, such services has never been an option for me and I resisted them like forever. Yes, I’ve got one million reasons to believe and do so which demands another post of its own. So, I’ll avoid that argument for now.

This left me with two choices:

  • Operate my blogs without the comment section as I did for years
  • Running an open source self-host blog comment system such as HashOver, Isso, Juvia and talkatv

Since people asked me for a way to discuss their feedback on the website, this made the former choice a no go, anymore. So, in a search for the promised commenting system, I spent hours installing and trying every single FLOSS commenting system on GitHub. And everyone of them has had a big flaw that I could not tolerate. Finally, I came to the conclusion that I’m out of luck with that. Of course, I always had the option to write my own commenting system according to my own needs. As, I did with my own blog subscription system. But, due to the lack of time that was not an option either.

It happens that I randomly visit Coding Horror by Jeff Atwood the co-founder of Stack Overflow and Stack Exchange Network. I’ve always read the comments on Coding Horror but never had an urge to write a comment their. Since I’ve been desperately looking for a commenting system, this time the different look of its comment system catched my attention. Bingo! He wrote an open source discussion platform software named Discourse. Not necessarily a blog comment system, but could be used as one. It even supports the Farsi language and RTL out of the box which allows me to use it on my Farsi blog, too. In addition to that it supports multi-site which means I have to only run one instance for all my blogs. Just perfect!

Despite many nice feature it provides, it has a few rough edges, too. I was able to conquer some and some couldn’t, yet. But it did not stop me from integrating it into my Hexo-based blogs after two weeks of testing it. So, there it is, from now on both this blog and my Farsi blog are discussion aware :).

OK, the main issue that many people face when they want to install Discourse in a platform other than GNU/Linux, is they get hit in the face by the reading this line in the official documentation:

Why do you only officially support Docker?

Hosting Rails applications is complicated. Even if you already have Postgres, Redis and Ruby installed on your server, you still need to worry about running and monitoring your Sidekiq and Rails processes. Additionally, our Docker install comes bundled with a web-based GUI that makes upgrading to new versions of Discourse as easy as clicking a button.

Yes, I know Ruby and Rails are crap and deploying Ruby on Rails apps are pain in the Butt. Do not worry! This was the first struggle with Discourse that I had since this blog runs on FreeBSD. And, FreeBSD support for Docker is experimental, yet. Fortunately, I used to deploy GitLab instances on FreeBSD for three years which was also RoR before I migrated to Gogs which kicks butt, anyway! That made it easy to figure out a simple way to deploy Discourse without Docker on FreeBSD.

[Read More...]

Android: Install ADB drivers for any device without OEM drivers

Figure 1. Android Robot

Figure 1. Android Robot

Well, I started my Android development on a Samsung I9100 Galaxy S II. I never had any trouble getting ADB to work on Microsoft Windows since I had the drivers from Samsung which was already installed due to my previous Cyanogenmod installation process. Afterwards, I received a Nexus 7 and a bit latter a Nexus 5 which became my primary development device of choice. Google did a good job by providing ADB drivers for All Nexus devices inside the SDK or as a small separate download on Android Developers website which was very easy to install. The trouble began when my development process involved testing my applications and games on devices other than Nexus ones I had. For some manufacturers I was never able to find the drivers. Finding the correct driver for each device was a huge pain until I found a solution that became a remedy for all my troubles getting ADB to work with any Android device, even without the OEM drivers. It even became my preferred alternative to manufacturer’s provided ADB drivers for all my other devices till this day, since I hate the bloat-ware and useless crap they provide along with their drivers which is inevitable to install anyway.

In the rest of this post I’m going to share my easy solution with you:

[Read More...]

Post-Processing Effects in Cocos2d-x

Picture A: Gray (black and white) post-processing effect in Cocos2d-x

Picture A: Gray (black and white) post-processing effect in Cocos2d-x

Update [2020/10/23]: Since I wrote this tutorial many things has changed in Cocos2d-x and I haven’t been using it in years as I switched to Unreal Engine 4. According to this GitHub issue opened by my blog readers, in order for this code to work there has to be some modifications to the code which is provided on that issue by @lazerfalcon and @madrazo. I was also having trouble with render to texture on Sprite3D which seems to have been solved in newer versions.

Despite the fact that Cocos2d-x uses the OpenGL ES Shading Language v1.0 for the shaders (in order to learn more about the language, please refer to: OpenGL ES Shading Language v1.0 Spec) the engine does not provide an out-of-the-box API to apply post-processing effects to the whole game scene output at once.

In this tutorial we will learn an easy way to apply multiple post-processing effects to the game scene output all at once.

[Read More...]

Packt $5 Campaign - Packt Publishing

Packt $5 Campaign - Packt Publishing

Packt $5 Campaign - Packt Publishing

From the 17th December 2015 into the New Year, Packt Publishing is inviting the tech world to explore its extensive library of eBooks and Video courses for one amazing price. Every single eBook and Video course Packt has ever created will be available on packtpub.com for just $5!

[Read More...]