All posts by Inder

I am a programmer. I have Bachelors in Computer Science from Tufts University. I currently work full-time at Boston University developing their websites.

LG G6 review

Just wanted to keep a log of complaints with my LG G6. Things a person wouldn’t know until they buy it.

  • – Default message limit means your messages will start getting automatically deleted in the background after the limit reaches. I’ve lost so much history this way.
  • – No flash on low battery. At least give me the option to use flash in low-battery mode.
  • – Low light or over-sharp photos. This is probably a problem with almost every phone ever.
  • – Android 8 is not coming I think. Promised at launch. It’s been over a year.
  • + Knock to start or wake immediately after it goes dark is awesome.

iPhone vs Android

I’ve used Android phones most of my smartphone life. I started with Google’s G1, then came Google Nexus 5, Google Nexus 5X, Samsung Galaxy, LG G6. I’m very familiar with the Android ecosystem. I’ve dabbled with plenty of ROMs, like CyanogenMod, Cataclysm, etc. Along with my regular smartphone usage, I’ve developed apps for both Android and iOS. My only exposure to iOS has been an iPod Touch before smartphone days and my development experience with the emulators

Recently, I was given the opportunity to use an iOS device, iPhone SE, since MetroPCS offered free ones on no-contract signup. I figured I should give it a shot for a few months. I want to detail some pros and cons for both ecosystems.

Android:

  • + More customizable: the home screen, widgets, launcher, unknown source apps, etc.
  • + Better notifications system. Ability to dismiss things easily enough compared to iOS. Notification groupings! Reply within notifications. Etc!
  • + Awesome integrations with lots of password managers. Personally I prefer LastPass to keep them synchronized with all my devices.
  • + Change default apps for anything.
  • + Consolidated Google Now to keep up with appointments, shipments, NBA/NFL scores, news. Automatically pieced together from my emails.
  • + Google Assistant able to pick up any accent you can throw at it. My family has thick Punjabi/Indian accents.
  • – Slow and inconsistent apps. Seem like second citizens compared to iOS apps from the same brands/app-makers.

iOS

  • + Faster apps loads with better graphics
  • + Smooth camera operation
  • – Annoying notifications seem to never go away. Tough to dismiss all of them.
  • – No integration with password managers like LastPass. Each app has to subscribe to specific password managers. In other words, no app ever happens.
  • – Limited browsers. Every browser runs the Webkit backend, so if a website is broken in your browser, you’re out of luck.
  • – Default iOS keyboard has no swiping. And it will keep coming up for apps that don’t want to use custom keyboards (i.e. Contacts, almost all the iOS apps, any financial app, logins/passwords). Inconsistent and NO thanks!!!

TLDR: I can’t wait to go back to my “slow yet complete” smartphone that is Android.

Best way to avoid ads in exercise apps

I’ve found that the best way to avoid ad-infested apps for exercising is to use official apps from popular brands. They’re better because they bother you again and again about non-exercise-related matters (ads, social sharing, etc)

For example the following apps are great alternatives to popular ad-filled apps:

  1. Nike Run Club – Much better than C25k (Couch-to-5k).
  2. J&J 7 Minute Workout – Alternative to 7 Minute Workout.

Composer stuck on installing private GitHub repos

I was trying to install some GitHub repos as dependencies using composer. Composer kept getting stuck on installing the private ones.

composer.json:

1
2
3
4
5
6
7
8
9
"repositories": [
    {
        "type": "vcs",
        "url": "git@github.com:inderpreet99/private.git"
    }
],
"require-dev": {
    "inderpreet99/private": "1.0.1"
}

Log:

1
2
3
4
5
6
7
$ composer install
Loading composer repositories with package information
[Composer\Downloader\TransportException]
The "https://api.github.com/repos/inderpreet99/private" file could not be downloaded (HTTP/1.1 404 Not Found)
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] []...

Solution:

  1. Go to your GitHub profile.
  2. Under Developer Settings > Personal access tokens, generate a new token.
  3. In cli:
    1
    2
    $ export GITHUB_ACCESS_TOKEN="gibberisheaab78ab18285b9something"
    $ composer config -g github-oauth.github.com $GITHUB_ACCESS_TOKEN

Composer should work much more smoothly now.

Webmin bug copying SSL certificates to Virtualmin panel

When you generate a SSL certificate for an nginx site through the Virtualmin interface for a virtual (sub-)server, the button “Copy to Webmin” incorrectly triggers the “Copy to Usermin” feature.

On the other hand, the Webmin interface to generate the SSL certificate also fails, because it does not allow for generation for nginx hosts (only Apache hosts).

Trick:

  1. Generate the SSL certificate using Let’s Encrypt in Virtualmin for the virtual (sub-)server.
  2. Run the following command as root to copy the certificate to Webmin:
    1
    virtualmin install-service-cert --domain yourdomain.com --service webmin
Categories 

Add Lets Encrypt for Webmin/Virtualmin Panel itself

Are you getting a “challenge did not pass” error? Can’t find a matching hostname for your Webmin panel to generate Let’s Encrypt certificates to?

The trick is that Lets Encrypt only works with Apache. Most Webmin/Virtualmin panels are running on miniserv Perl scripts on port 10000. We must follow the following steps:

1. Create a virtual server (or sub server) for the matching domain in Virtualmin.
2. Go to Webmin > Webmin Configuration > SSL Encryption > Let’s Encrypt
3. Request Certificate for “Apache virtual host matching hostname”. Set renewal for 12 months!

Reload problems for Raspberry Pi as a Digital Signage solution

There are quite a few tutorials out there to turn Raspberry Pi into Digital Signage or Kiosk solutions. I’ve used elalemanyo GitHub gist to run Chromium browser for my Digital Signage needs. It provides lots of options and combines various sources of information. There are options for other browsers on that page.

The gist does not address a way to automatically reload/recover from page/chrome/connection errors. You can use the following two extensions to recover from these problems:

1. Oh No You Didn’t extension will automatically reload tabs that have crashed (Aw Snap! He’s Dead Jim etc.). Handy for Kiosk mode where access is limited. This helps recover from memory related problems (quite often the Raspberry Pi’s are limited by memory or CPU).

2. Autorefresh on Error will auto-refresh a page after 60 seconds if page did not load. This is handy for any webpage that changes often and needs to be refreshed. And for places where the WiFi coverage may not be ideal, especially on boot.

Unrar split RARs on Windows using Cygwin

Sometimes out of dire circumstances one may download a huge set of rars. Unraring all the scene release files in split rar format in each separate directory with their separate subtitles (idx/sub files) is a cumbersome task.

  1. Install unrar from http://gnuwin32.sourceforge.net/packages/unrar.htm
  2. cd into the base season directory using cygwin.
  3. Unrar recursively:
    1
    find /path/to/dir-of-rars -iname "*.rar" -exec sh -c 'dir=`dirname {}` && echo "$dir" && unrar -o- e "{}" $dir' \;
  4. You may need to run this multiple times to catch the rars that the rars may create.

Install latest Chromium on Raspberry Pi B+

Update on December 26, 2016: Latest Raspbian can install Chromium Browser by just doing: apt-get install chromium-browser. No need to download debs or run gdebi. Making this post obsolete.

Installing the latest Chromium browser on Raspberry Pi B models is a hassle. Although the following tricks work on the other Raspberry Pi models. I wanted to target Raspberry Pi B+ with this tutorial since it requires some special steps.

  1. Download the latest .deb package files:
  2. Ensure you have gdebi:
    1
    sudo apt-get install gdebi-core
  3. Install the packages one by one (install libgcrypt11 first!!!):
    1
    2
    3
    sudo gdebi libgcrypt11
    sudo gdebi chromium-codecs-ffmpeg-extra
    sudo gdebi chromium-browser
  4. Run:
    1
    chromium-browser

WordPress as a Service

At two recent WordPress conferences, WPCampus 2016 and WordCamp Boston 2016, I gave a talk along with Andrew Bauer on using WordPress as a Service (WPaaS) in a higher education setting.

In this talk, we covered the organizational and technical benefits of running a multi-network, multi-site WordPress as the primary CMS at Boston University. We highlighted specific strategies, including organizational policies, development workflows and team structure that allow us to serve over a million users per month. We’re here to help dispel the notion that a centralized approach to WordPress can’t successfully be implemented in higher ed.

Slides:

Talk: