Make Gadgets Work

While renewing my LetsEncrypt certificate, I found myself in a strange situation where the certbot won't run asking me to update pip and then each time I tried updating pip it failed with the error "error: command 'x86_64-linux-gnu-gcc' failed with exit status 4". It turns out that this happens due to low memory and with my digitalocean droplet being the cheapest one this was bound to happen sooner rather than later. Fortunately there is a way around it as explained below. Use of following commands will ensure that the swap file is created which in turn will help avoid the "error: command 'x86_64-linux-gnu-gcc' failed with exit status 4". Following commands will create a swap file: sudo dd if=/dev/zero of=/swapfile1 bs=1024 count=524288 sudo mkswap /swapfile1 sudo chown root:root /swapfile1 sudo chmod 0600 /swapfile1 sudo swapon /swapfile1 The swap file will now be activated but will be gone after the reboot. It can be reactivated using the last command (I hope - know so as I have now tried it). Anyway, after creating the swapfile, you will be able to upgrade pip without the aforementioned error. :) Update: 02/03/2017 I ran into memory issues yet again and I thought instead of increasing the memory for swapfile1, what if I can create another swapfile. I tried this and it works. Infact I felt quite nice uncovering a concept of multiple swapfiles purely based on my whim ;). All I really had to do was repeat above code replacing swapfile1 with swapfile2 and I had two swapfiles working together increasing available memory for my server. sudo dd if=/dev/zero of=/swapfile2 bs=1024 count=524288 sudo mkswap /swapfile2 sudo chown root:root /swapfile2 sudo chmod 0600 /swapfile2 sudo swapon /swapfile2 Thing is after it worked I was a bit intrigued by the concept and read a bit more on swapon / swapoff and few useful commands are listed below: # To enable all swapfiles swapon -a # To disable all swapfiles swapoff -a # To see all available swapfiles swapon -s # To enable a particular swapfile swapon <filename>

Swap File to create extra memory

While renewing my LetsEncrypt certificate, I found myself in a strange situation where the certbot won't run asking me to update pip and then each time I tried updating pip it failed with the error "error: command 'x86_64-linux-gnu-gcc' failed with exit status 4". It turns out that
I was a super excited owner of Note 7 in September this year and then in few days the happiness started disappearing as the news of exploding Note 7 started appearing all over the internet. Then came the notice to exchange the Note 7 which I dutifully did and assured that nothing will now go wrong I started enjoying that gem of a device. Alas, it was not to be and the device was recalled for good. Being a user of Note devices for so long and yet unable to continue with my old Note 3, I decided to go for some interim device - you know until Samsung decides to get the act right and bring the next Note device to the market. After going through a number of possible options ranging from Note 7's close cousin Galaxy S7 edge+ all the way to newly released Pixel, I actually settled for OnePlus 3. It was not a gamble actually as my wife is already using it and is quite pleased with it's performance and the price is just right for this to qualify as the interim phone. Anyway, so I ordered and waited because there was a good 4 week wait period. The ordering and delivery all went as planned while in the meantime I was back with my trusty Note 3. OnePlus 3 arrived and I set it up to my taste and my oh my what an experience. Apart from Stylus it was lacking nothing and is very smooth, very light and camera quality is very good as well - not as good as Note 7 but definitely better than Note 3. I have now been with this device for just over a week and although I miss the S-Pen, I am very happy with the device in general and it's battery life in particular. I have listed below the things that I like and the things I hope it had: Features I Loved: Battery life Superfast Chargingwith Dash Charger Display and inbuilt Night mode Ringer Switch Inbuilt Colour control for LED Notification Smooth minimal interface No bloatware Fingerprint Scanner doubles as Home button Gesture support for flash light Ability to swap Capacitive button functionality Dual Sim Card capability - Allows me to carry one phone for both work and personal numbers. Sure all of the above can be pretty similar on all high end handsets but what makes it unique for OnePlus 3 is the price point of £329. That price is unbeatable and the phone, in my humble opinion, must be the first choice for anyone who isn't fussed about a stylus. There can be a comparison between camera results where Samsung outperforms in my experience but only slightly and still the photo quality from OnePlus 3 is definitely very good second only to Samsung and no other. Wishlist Functional Stylus (Frankly no other manufacturer is tapping on this market. God knows why?) Note 7 had a good integration of Fingerprint Scanner with browser to login to various sites. I miss that on OnePlus 3. External Memory Card slot. Here's hoping that OnePlus 3 team will listen to my wishlist :).

Note 7 to OnePlus 3

I was a super excited owner of Note 7 in September this year and then in few days the happiness started disappearing as the news of exploding Note 7 started appearing all over the internet. Then came the notice to exchange the Note 7 which I dutifully did and assured
While I love Ghost as a blogging platform, it is not best placed for things other than blogs - after all that is the basic idea behind creation of this wonderful tool. As I wanted to host a static website using tools that don't require a database or rely on php, I went searching on interwebs. I came across a lot of options and the most popular one appears to be Jekyll and it's variants (Nikola and such) but they require a lot of terminal activity which won't go well for regular end user responsible for maintaining content of the static website in question.So I continued looking and came across this wonderful project called Grav. Grav is super fast, very pretty and extremely easy to deploy and maintain. Additionally, it has very good documentation. The key features that I absolutely loved are as below: Easy installation - * Easier than Ghost / Wordpress IMHO * Good help and documentation Responsive themes and skeletons Built-in Markdown Support and then some Lot of useful plugins Browser based admin page Active development Easy upgrade and back-up My steps for installation: Download a skeleton you fancy unzip the downloaded file into your server root and move it into a folder named grav: sudo unzip grav-skeleton-appi-1.0.0.zip -d /var/www/html/ cd /var/www/html/ sudo mv grav-skeleton-appi-1.0.0/ grav/ Fix permissions (replace username with your user on the server. This is important to ensure files can be modified both from browser as well as from terminal. So create a bash file by issuing command nano fixpermissions.sh and paste the following code in there. ##!/bin/sh chown <username>:www-data . chown -R <username>:www-data * find . -type f | xargs chmod 664 find ./bin -type f | xargs chmod 775 find . -type d | xargs chmod 775 find . -type d | xargs chmod +s umask 0002 Now make this bash file executable using chmod a+x fixpermissions.sh Finally run the bash file from within the grav directory: cd /var/www/html/grav/ sudo bash /<path_to_fixpermissions.sh>/fixpermissions.sh Open <server-ip-address>/grav from the browser and check your install is working Once it is confirmed to be working, install admin plugin from terminal like so: /bin/gpm install admin Open <server-ip-address>/grav/admin from the browser and create your admin login details Working on Grav is an absolutely pleasing experience and the swift turnaround for a static website is phenomenal. Suffice to say, I hope that this project goes from strength to strength.

Grav - CMS with a difference

While I love Ghost as a blogging platform, it is not best placed for things other than blogs - after all that is the basic idea behind creation of this wonderful tool. As I wanted to host a static website using tools that don't require a database or rely on
As Windows 10 is a commercial offering, one would think it will be working as expected and it does so long as like me one has come to expect pain from Microsoft in general and Windows in particular - because pain is what you get when you use Windows 10. When we work in office environment we are not as heavily exposed to the pain that accompanies Windows usage, mainly because everything is configured and dealt with through a central desktop provisioning team and there is usually a dedicated IT Help-desk in a big corporate. However, using Windows at home is not as smooth a sailing (I am really being liberal with usage of word smooth) and if you don't trust me just try searching for issues that accompany upgrade to windows 10 and look at the range of issues. Now I, ofcourse, don't blindly believe these search based opinions and have my own take based on my very own personal trauma. The story goes like so: Why - one may ask - do I even bother with windows at home if it is so painful? This is because as much as my daughter loves the penguin, the windows is what her teacher uses and so she does need to be aware of the necessary evil. So, there is this laptop I have which is exclusively for Windows and is only ever used by my daughter for her schoolwork. It isn't some cheap stuff but a state of the art touch screen detachable monitor kinda laptop from HP with intel core i5 inside. However, as it is a detachable tablet, it has two HDD - 50 GB for monitor and 500 GB on keyboard that acts as extended memory. Now, it originally came with Windows 8 and then came Windows 10 followed by Windows 10 anniversary edition. When I upgraded from Windows 8 to Windows 10, I suddenly found that the whole of 50 gig was fully utilised making it impossible to do anything at all. Now a quick duckduckgo search later it was as simple as removing the "previous installs" which windows itself removes after a month or so they say. In my case the self-removal-a-month-later thing just did not happen and disk clean did not help either so i was basically left with no choice but to reformat the whole damn thing. This as I recollected from my old days with windows is quite a long process with lots of downloads and waits...and boy has that continued to be the same... Microsoft is nothing if not consistent. Finally after several hours of ordeal, the system was refreshed and my storage space reclaimed and a semi-functional laptop was there or thereabouts. I say semi-functional because unlike on Linux not all drivers are there and you have to individually download the drivers from HP website, install and then keep your fingers and toes crossed while you hope it works...finally sound was sorted but WiFi is still flaky. Now compare this to the seamless upgrade from one major version of Fedora 23 to Fedora 24...it did take a while to download and install but the actual effort involved was typing 4 lines on the terminal - that's it. When I logged into Fedora 24 upgraded machine, everything just worked as before - no driver issues, no WiFi problems, nothing. RANT OVER

Windows 10 - a bucket load of pain

As Windows 10 is a commercial offering, one would think it will be working as expected and it does so long as like me one has come to expect pain from Microsoft in general and Windows in particular - because pain is what you get when you use Windows 10.
Ethercalc is good tool which can be selfhosted. It is fairly simple to do so. Though it will be available for anyone who has the URL because there is no inbuilt login mechanism. I did not dig into making it accessible with a login interface as I lost interest after I made it work on my server and played around a bit with it but it was simply because I got interested in other things and not because the tool isn't fascinating enough. I am fairly certain this will not be overly complicated but for a simple selfhosted spreadsheet solution this is definitely worth playing around with. The steps I took are as below: #Ethercalc plays well wth redis as per their documentation. So Install and start "redis" sudo dnf install redis sudo systemctl start redis.service #Test if "redis" is working redis-cli ping #Enable redis to automatically start at the time of system start-up sudo systemctl enable redis.service #check if it runs ethercalc #Press Ctrl+C to exit #To run it forever use pm2 pm2 start ethercalc npm list -g --depth=0 #Change port to whichever port you want Ethercalc to run on by opening app.js #and changing port. nano /home/<yourusername>/.npm-global/lib/node_modules/ethercalc/app.js #change port and save #run with pm2 and alias as Ecalc pm2 start ethercalc --name "Ecalc" #check logs using pm2 pm2 logs Ecalc #Reverse proxy Ethercalc using nginx sudo nano /etc/nginx/conf.d/ecalc.conf sudo systemctl restart nginx.service

Ethercalc

Ethercalc is good tool which can be selfhosted. It is fairly simple to do so. Though it will be available for anyone who has the URL because there is no inbuilt login mechanism. I did not dig into making it accessible with a login interface as I lost interest after