Ramblings of a Coder's Mind

Got Tech? Will Hack.

Removing uTorrent Ads

| Comments

When BitTorrent bought over μTorrent, they promised users that all adverts would be optional. They have, however, made it harder and harder to hide the adverts including now a set of hidden options. Thankfully users have found how to access those hidden options.

Turn off ALL Ads/Featured Content/Bundle Crap in μtorrent/Bittorrent:

Options > Preferences > Advanced

Turn ALL settings to false:

  • bt.enable_pulse
  • distributed_share.enable
  • gui.show_notorrents_node
  • offers.left_rail_offer_enabled
  • gui.show_plus_upsell
  • offers.content_offer_autoexec
  • offers.sponsored_torrent_offer_enabled
  • offers.featured_content_badge_enabled
  • offers.featured_content_notifications_enabled
  • offers.featured_content_rss_enabled

Options > Preferences > Hold Shift+F2 while clicking Advanced (Hidden fields)

Turn ALL settings to false:

  • gui.show_gate_notify
  • gui.show_plus_av_upsell
  • gui.show_plus_conv_upsell
  • gui.show_plus_upsell_nodes

Source: Forum post from Beasley

Mass Renaming File Extensions With PowerShell

| Comments

PowerShell is one of Windows' most underused tools in my opinion. In many cases it rivals if not betters support that bash scripts provide.

If you want to remove the extension of a file (say removing '!ut' from file names), it's a simple one line command.

Mass Downloading Google Drive Files

| Comments

Has anyone ever shared with you hundreds of Google Drive files instead of sharing the directory? It happened to me today and I noticed Gmail clips the HTML part of the message at 102 KB. Usually Gmail provides a way to download all attachments (Google Drive or otherwise) or the ability to save them on your Google Drive from where you can mass download them. If the email is clipped, you can only save a subset of these files into your Google Drive so no mass downloads. Bummer.

It's simple enough to fix with some Scala magic. First you should save the email source as email.html. This file can then be read line by line to find any google docs links along with the file name. In my case the files were named "File - 1.JPG". Next update the file saving location (for me it was "dl/File 1.jpg" for which I created the folder dl). Assuming your regular expressions are correct, you're good to go!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import java.io.File
import java.net.URL

import scala.io.Source
import scala.sys.process._

object Launcher extends App {
  def processLine(line: String) = """https\://docs.google.com/file/d/(\w*)/edit\?usp\=drive_web.*?File - (\d*)\.JPG""".r
    .findAllMatchIn(line).map(_.subgroups)
    .map(list => (s"https://drive.google.com/uc?export=download&id=${list(0)}", s"dl/File ${list(1)}.jpg"))

  def download(url: String, fileName: String) = new URL(url) #> new File(fileName) !!

  val downloadFromTuple = (download _).tupled

  Source.fromFile("email.html").getLines().map(processLine).filterNot(_.isEmpty).foreach(_.foreach(downloadFromTuple))
}

Yes, this is a quick hack and can be improved for readability (such as extracting the regular expression, download link and file read and save locations) but for a quick hack that seems unnecessary.

IDEA IntelliJ 14 Is Out

| Comments

Yes, you heard that right! I just got notification from the asset management team at ThoughtWorks that IDEA IntelliJ 14 is out and we get free upgrades (since we have an upgrade subscription). If you haven't seen the features already, you should check it out! It looks like an upgrade worth making, especially since it's free ;)

So go ahead and upgrade now!

ExpandRegion on Sublime Text

| Comments

Once you get used to the JetBrains suite of IDEs pressing Cmd/Ctrl+W for expanding selection becomes second nature. This leads to closing tabs on most applications such as text editors which is of little consequence since you can train yourself to use a different short cut.

My favourite text editor (Sublime Text) does not have this feature built in but it seems I'm not the only one who misses the expand region feature. Go grab your copy of ExpandRegion by Aron Woost from GitHub with full instructions on how to install on Windows, Linux and Mac.

Developers Beware of OS X Yosemite

| Comments

It's been a bit over 24 hours of using OS X Yosemite and I'm liking all the UI sugar it's added. So far, my regular applications work fine after the upgrade but the IDEA based IDE set (IntelliJ, WebStorm, PyCharm, RubyMine etc.) seem to have a problem which has been also reported by IDEA.

Tread lightly. You have been warned!

Desktoppr Downloader v1.0

| Comments

I recently found Desktoppr, a service which has an insane number of curated wallpapers. What's even better is that they come with an easy to consume API.

To fulfil my insatiable need for good high resolution wallpapers, I wrote a script to go through the thousands of pages of images they have, find the ones that are "right for my desktop" and download them. I define "right for my desktop" as being at least the same resolution as mine and if higher then the same aspect ratio. If your's is the same, feel free to use this script to download tons of wallpapers.

Desktoppr Downloader is now available on GitHub

TODOs:

  • Read Resolution for machine

  • Support Multiple Monitors

  • Make program initialization interactive/parameter based

  • Image duplication is decided by file name. Attempt to use file hashes for this (I've contacted the Desktoppr team to check if this can be added in the API)

Update: The Desktoppr Downloader project now has it's own page! http://karunab.com/dev/desktoppr-downloader/

Twitter Images Not Loading

| Comments

I recently moved to Pune and of course to a new ISP (Tata Telecommunications in Pune). For strange reasons, images on Twitter wouldn't load. Also, certain other websites weren't visible. Simple enough fix was to ensure I wasn't using Tata's DNS' but Google's.

If you have a 2 level setup (Devices -> WiFi Router -> DSL Modem) like I have here which is something even I'm new too, you should probably need it the DNS on one of the routers (logically would be preferred to be on the DSL Modem). Safe side, do it on both :p

Google DNS is win :)