Tuesday, May 26, 2020

Rooting Lenovo TAB 2 A7-20F on Linux

Lenovo TAB 2 A7-20F is a nice sturdy tablet that was very handy for me in the past to read the occasional article or ebook. However, it has been gathering up dust on my desk recently because it was slowing down. So I thought of giving it fresh life, removing the bloatware which came pre-installed with it.

In terms of specs, this comes with Android 4.4 (KitKat) and a Mediatek MT8127 chipset. Not stellar specs, but decent enough to get some work done. For rooting this, I was primarily looking for a way to do it using just a Linux laptop and a USB cable. So here are the steps I followed:
  • Do a hard reset of the tablet
    • For this, you need to restart the device to Bootloader by holding Volume up + Power keys when the tablet is starting. Then you'll come to this menu in Chinese.
      Chinese Bootloader menu of Lenovo TAB2 A7-20F
    • Here you need to select the clear eMMC (清除 eMMC) option by navigating to it via volume down key and selecting it via the power key.
  • Download SP Flash Tool for Linux from here
  • Then follow the steps in this XDA thread to install TWRP. (You'll have to run SP Flash Tool with root privileges.)
  • Copy the SuperSU zip to the tablet via USB.
  • Reboot the table to recovery mode by holding Volume up + Volume Down + Power keys when the tablet is starting. This should boot to TWRP.
  • Take a back up of system, data, and boot partitions via TWRP, just in case if you need to restore the stock ROM in the future.
  • While inside TWRP, install SuperSU by going to 'Install' -> 'Install ZIP' and selecting the copied SuperSU zip.
  • Now when you boot into the normal mode, you'll see SuperSU has been installed.
  • You can verify it by opening a terminal and typing su.
Success! Root access in Tab2 A7-20F
After this, I used Titanium Backup to freeze/uninstall the bloatware.

Here are some other threads if you plan on going beyond the new ROM and installing a new one.

Friday, January 26, 2018

Using Office365 Mail and Calendar in Linux

For some reason, if your school or workplace is using Microsoft Office365/Outlook for all communication, you can configure your Linux e-mail client to support most of those features such as e-mail, calendar, and contacts working. Sometime back, support for Microsoft Exchange-based services was very buggy in open-source e-mail clients like Thunderbird and Evolution. But they have come a long way since then. Here are the steps I followed to get my University e-mail working in Evolution.

Step 1: First install the software needed.
sudo apt-get install evolution evolution-ews 

Step 2: (Optional) If you are not using a GNOME-based Desktop Enivronment you need to install following dependencies as well. (For example, I'm using XFCE with i3WM)
sudo apt-get install gnome-online-accounts gnome-control-center

Step 3: Then start the gnome-contol-center. If you're not on GNOME, you might have to trick the Desktop to make it believe you're on GNOME like this:
env XDG_CURRENT_DESKTOP=GNOME gnome-control-center

 Step 4: Click on Online Accounts and add your Microsoft Exchange details. (Here use outlook.office365.com as the server.)

Step 5: Go to Evolution. Add an identity.

Step 6: In Receiving e-mail section, use https://outlook.office365.com/EWS/Exchange.asmx as the Host URL. Then when you click the Fetch URL button, OAB URL should be auto-completed.

Step 7: Once you restart, everything should be synced.

Thursday, January 11, 2018

Weather info in i3bar with i3status

Update: wttr.in now has a new one line format. So some of the below logic for parsing the output is no longer required.

I recently started using i3wm because it is light-weight, keyboard-friendly and uses the screen real-estate efficiently.  I customized i3bar and i3status (which came installed with i3) to show system information and date/time. But there was no out-of-the-box feature to get weather information from i3 status.

I wanted a simple solution that does not require installing an external program like i3blocks, conky, dzen2, xmobar or lemonbar. It had to also preserve colors I had configured for the i3bar output. So I came up with this simple solution.

Step 1: Setup a cron job to retrieve weather information every 5 minutes and store it in a temporary file. (This is because wttr.in only allows 1000 API calls per day and the weather information is not frequently updated in the server.)

*/5 * * * * curl -s wttr.in/montreal?T | head -n 7 > ~/.weather.cache

Step 2: Write a shell script to add this information to i3status data.

Step 3: The ~/.config/i3/config file needs to be updated for the status_command to pipe through this script, as follows.

bar {
        status_command .config/i3/weather.sh
        tray_output primary

Step 4: The ~/.i3status.conf file should also be updated to change the output to the JSON format.

general {
        output_format = "i3bar"
        colors = true
        interval = 5

This is how it looks like in the end.

 You can find more information from the following links.

Tuesday, May 26, 2015

Few tips on tweaking Elementary OS for Crouton

Activating Reverse Scrolling

 If you're a fan of reverse scrolling (or natural scrolling as some people call it) in Mac OS X, you can activate the same in Elementary OS by going to System Settings > Tweaks > General > Miscellaneous, and turn on Natural Scrolling. But I noticed in Elementary OS Luna for crouton, that setting resets to false after restarting. You can fix it by adding the following command as a startup application (System Settings > Startup Applications > Add)
/usr/lib/plugs/pantheon/tweaks/natural_scrolling.sh true

Getting back the minimize button

Method 1: Start dconf-editor and go to org > pantheon > desktop > gala > appearance and change "button layout" to re-order buttons in the window decoration. Eg: "menu:minimize,maximize,close"

Method 2: Run the following command.
gconftool-2 --set /apps/metacity/general/button_layout --type string ":minimize:maximize:close"

Note: To install dconf-editor use the command:
sudo apt-get install dconf-tools

To install elementary-tweaks use the command:
sudo add-apt-repository ppa:mpstark/elementary-tweaks-daily
sudo apt-get update
sudo apt-get install elementary-tweaks

Tuesday, March 4, 2014

Crawljax gets a face lift. Web UI in Crawljax 3.5

Crawljax is an open source tool for crawling Ajax-based modern web applications by analyzing DOM state changes. Latest feature that will be available with Crawljax 3.5 is a Web front end for Crawljax. It supports all the major functionality of crawljax like, adding/editing crawl configurations, installing plugins, viewing crawl logs in real time and displaying plugin output. This is implemented using the common java web application stack and ember.js MVC framework. Kudos to developers, @jeremyhewett and @ryansolid.
To run it, simply unzip the web distribution archive and run the command java -jar crawljax-web-3.5-SNAPSHOT.jar. You can customize the port and output directory using -p and -o arguments. Here are some screen-shots of the web interface in action. More usage tutorials will follow.
Crawljax Web UI Home - You can start by adding a 'New Configuration' as shown

'Edit Configuration' Page
'Add Plugin' Page

Crawl status log with real-time updates
Output of the Crawl Overview plugin
Read the original post at crawljax.com

Related links

Friday, January 24, 2014

Set svn to ignore auxiliary LaTeX files globally

There are certain intemediary files (.aux, .log, etc.) that are best not put under version control because they change very often. In SVN, to stop svn status complain about them, you can add those patterns to the global-ignores property in your ~/.subversion/config file (or "%APPDATA%\Subversion\config" on Windows).

If you just want to set it for one repository, you can use svn propedit svn:ignore . or svn propset as explained here.

PS: Read Configuration Area Layout in the red bean book or this SO question for more information.

Wednesday, January 8, 2014

tcsh/csh tips for the bash user

The official shell in FreeBSD is tcsh/csh, and in Debian/Ubuntu, it's dash or bash. The back-story is, these fall into two families of shells: Ones derived from the original bourne shell (sh) which include bash, ksh etc. and those derived from the C shell which include csh, tsch, etc. These use slightly different commands for setting environment variables etc.
  • You can check the type of shell you are using by the commands echo $shell or echo $0
    Note: $0 is actually the name of the running process. It will return the name of the shell or shell script according to the context. Read more on that here: http://www.tldp.org/LDP/abs/html/othertypesv.html#CHILDREF2
  • You can get a list of all the shells installed on your system by typing
  • cat /etc/shells 
  • ..and also change the default one to a different shell (if you have the permissions) using the command chsh.
  • If you are moving from bash to tcsh, you will find your .bashrc file (or even .bash_profile, .profile) doesn't work anymore. It's the ~/.cshrc file in tcsh instead. And for setting environment variables, rather than the old command.. PATH= $PATH:$HOME/bin; export PATH you will have to use something like.. 
  • setenv PATH ${PATH}:${HOME}/bin
     Note the missing '='.

More related reading: