Slim::Utils::PluginManager::load (321) Error: Couldn’t load Plugins::GoogleMusic::Plugin Fix

I have successfully fixed the Google Music Plugin for Vortexbox 2.3 / LMS 7.9:

See my full post here:

http://forums.slimdevices.com/showthread.php?98526-Google-Music-Plugin/page11

Errors include:
[15-08-14 12:12:58.3474] Slim::Utils::PluginManager::load (321) Error: Couldn’t load Plugins::GoogleMusic::Plugin
[15-08-14 12:14:29.7347] main::init (368) Starting Logitech Media Server (v7.8.0, 1395395852, Fri Apr 18 13:29:51 EDT 2014) perl 5.018004
[15-08-14 12:14:30.3405] Slim::bootstrap::tryModuleLoad (285) Warning: Module [Plugins::GoogleMusic::Plugin] failed to load:
Error — py_eval raised an exception at /usr/lib/perl5/vendor_perl/Inline/Python.pm line 221.
BEGIN failed–compilation aborted at /usr/share/squeezeboxserver/Plugins/GoogleMusic/GoogleAPI.pm line 74.
Compilation failed in require at /usr/share/squeezeboxserver/Plugins/GoogleMusic/Settings.pm line 20.
BEGIN failed–compilation aborted at /usr/share/squeezeboxserver/Plugins/GoogleMusic/Settings.pm line 20.
Compilation failed in require at /usr/share/squeezeboxserver/Plugins/GoogleMusic/Plugin.pm line 24.
BEGIN failed–compilation aborted at /usr/share/squeezeboxserver/Plugins/GoogleMusic/Plugin.pm line 24.
Compilation failed in require at (eval 962) line 1.
BEGIN failed–compilation aborted at (eval 962) line 1.

Fix:
First install pip:
yum install python-pip

And then run the following:
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py

Then I removed the broken plugin:
cd /usr/share/squeezeboxserver/Plugins/
rm -rf GoogleMusic

Opened the plugins page and added the following repo and enabled the plugin (Google Plugin 0.4.2):
http://nick7634.github.io/squeezebox-googlemusic/repository/repo.xml

Now to fix the SSL errors:
[15-08-14 14:43:31.2259] main::init (394) Starting Logitech Media Server (v7.9.0, 0.86.20150801git1438234070, Sat Aug 1 20:27:50 BST 2015) perl 5.018004
[15-08-14 14:43:32.5819] Plugins::GoogleMusic::Plugin::initPlugin (95) Not able to login to Google Play Music: SSLError: hostname ‘android.clients.google.com’ doesn’t match either of ‘*.google.com’, ‘*.android.com’, ‘*.appengine.google.com’, ‘*.cloud.google.com’, ‘*.google-analytics.com’, ‘*.google.ca’, ‘*.google.cl’, ‘*.google.co.in’, ‘*.google.co.jp’, ‘*.google.co.uk’, ‘*.google.com.ar’, ‘*.google.com.au’, ‘*.google.com.br’, ‘*.google.com.co’, ‘*.google.com.mx’, ‘*.google.com.tr’, ‘*.google.com.vn’, ‘*.google.de’, ‘*.google.es’, ‘*.google.fr’, ‘*.google.hu’, ‘*.google.it’, ‘*.google.nl’, ‘*.google.pl’, ‘*.google.pt’, ‘*.googleadapis.com’, ‘*.googleapis.cn’, ‘*.googlecommerce.com’, ‘*.googlevideo.com’, ‘*.gstatic.cn’, ‘*.gstatic.com’, ‘*.gvt1.com’, ‘*.gvt2.com’, ‘*.metric.gstatic.com’, ‘*.urchin.com’, ‘*.url.google.com’, ‘*.youtube-nocookie.com’, ‘*.youtube.com’, ‘*.youtubeeducation.com’, ‘*.ytimg.com’, ‘android.com’, ‘g.co’, ‘goo.gl’, ‘google-analytics.com’, ‘google.com’, ‘googlecommerce.com’, ‘urchin.com’, ‘youtu.be’, ‘youtube.com’, ‘youtubeeducation.com’ at line 64

Fix:
Run in order:
yum install gcc libffi-devel python-devel openssl-devel
pip install cryptography
pip install pyopenssl ndg-httpsclient pyasn1

Finally to fix passing in the device ID as seen here https://github.com/hechtus/squeezebox-googlemusic/pull/83/files:

Fix:
cd /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/GoogleMusic/
nano Settings.pm

eval {
$googleapi->login($prefs->get(‘username’),
decode_base64($prefs->get(‘password’)),
$prefs->get(‘device_id’));

SAVE THE FILE

nano Plugin.pm

eval {
$googleapi->login($prefs->get(‘username’),
decode_base64($prefs->get(‘password’)),
$prefs->get(‘device_id’));

SAVE THE FILE

REBOOT!

 

Now Vortexbox 2.3 and Logitech Media Server 7.9 will have Google Music working again!

SublimeText PlainTasks Modification: Adding pastdue / overdue and upcoming stats for date tracking

sublimetext

I started using the PlainTasks plugin for SublimeText as my daily todo and work tracking list.  What a great plugin!

The one thing it was lacking in the default Stats to show in the bottom bar was the ability to track overdue, and upcoming dates.  With a simple modification to the Python script I have added just that.

Just edit the PlainTasks.py file and add the following code right after line 897 and then 926 in the file.  This will create new counters called $v (overdue), $t (due today), and $u (upcoming).

[code language=”python”]
#Custom code (use this value to add to tags with @today to the due today counter), line 897
if i == "{{@today}}":
tagToday = len(pend)
[/code]

[code language=”python”]
#Overdue and due today tasks, line 926
tasks_dates = []
overdue = 0
duetoday = 0
upcoming = 0
view.find_all(‘(^\s*[^\n]*?\s\@(?:due)\s*(\([\d\w,\.:\-\/ ]*\))[^@]*$)’, 0, "\\2", tasks_dates)
date_format = view.settings().get(‘date_format’, ‘(%y-%m-%d %H:%M)’)
tasks_dates = [PlainTasksCompleteCommand.check_parentheses(date_format, t, is_date=True) for t in tasks_dates]
present = datetime.now().strftime("%y-%m-%d %H:%M")
#print ("Now:" + str(present))
for pastdue in tasks_dates:
pastdue = pastdue.replace(‘(‘,”).replace(‘)’,”)
#print ("Time Found:" + str(pastdue))
if len(pastdue) > 0:
if datetime.strptime(pastdue, ‘%y-%m-%d %H:%M’) < datetime.strptime(present, ‘%y-%m-%d %H:%M’): overdue = overdue + 1 elif datetime.strptime(pastdue[:-6], ‘%y-%m-%d’) == datetime.strptime(present[:-6], ‘%y-%m-%d’): duetoday = duetoday + 1 elif datetime.strptime(pastdue[:-6], ‘%y-%m-%d’) > datetime.strptime(present[:-6], ‘%y-%m-%d’):
upcoming = upcoming + 1

msg = (msgf.replace(‘$o’, str(pend))
.replace(‘$d’, str(done))
.replace(‘$c’, str(canc))
.replace(‘$n’, str(done+canc))
.replace(‘$a’, str(allt))
.replace(‘$percent’, str(int(percent)))
.replace(‘$progress’, progress)
.replace(‘$last’, last)
.replace(‘$v’, str(overdue)) #New value for overdue
.replace(‘$t’, str(duetoday + tagToday)) #New value for due today (include both dates and items with @today tags)
.replace(‘$u’, str(upcoming)) #New value for upcoming
)
return msg
[/code]

Now just edit your PlainTasks.sublime-settings User file and add the new variables.  Mine looks like this:

{
“stats_format”: “$n/$a done, $v overdue, $t due today, $u upcoming: ☐$o ✔$d ✘$c, ($percent%) $progress: (Pend/Done/Canc) @critical {{@critical}}, @high {{@high}}, @low {{@low}}, @today {{@today}}”,
// if you want the statistics do not include the archived tasks:
“stats_ignore_archive”: true
}

Finally you can open your TODO list and you will see the following at the bottom:

Screen Shot 2015-08-03 at 10.31.13 PM

 

If you want to see what is upcoming you can install the “Filter Lines” plugin and then fold the list (from the Edit menu) by a regular expression.  I use the following to show due, critical and today tags.

(@+\bcritical*)|(@+\btoday*)|(@+\bdue*)

You can also add a custom keyboard shortcut in your sublime.keymap user settings, I added this one for command K, command L:

[
{ “keys”: [“super+k”, “super+l”], “command”: “fold_to_lines”, “args”: { “search_type”: “regex”, “needle”: “(@+\\bcritical*)|(@+\\btoday*)|(@+\\bdue*)” } }
]

Happy coding!

Google Sheets – How to return multiple values in a single call with ImportXML

sheets

I have been tinkering with Google Sheets and building a document that can automatically pull data from other websites.

I stumbled across the importXML() function.  After some time I realized to optimize the number of calls to a specific URL, you can return multiple values in a single call using the XPath concat() function.

For example, to retrieve food information (protein, carbs, fat, and calories) you can do the following which will return all of the values seperated by a ‘|’ :

Cell A1 Formula:

=importXML("http://www.calorieking.com/foods/calories-in-pizzas-14-pizza-cheese-topping-original-crust_f-ZmlkPTU0ODQ2.html","concat(//tr[@class='protein']/td[2], '| ', //tr[@class='total-carbs']/td[2], '| ', //tr[@class='total-fat']/td[2], '| ', //tr[@class='alcohol']/td[2], '| ', //option[@value='0'], '| ', //span[@id='mCal'][@class='calorie-display'])")

From here you can then split the values into seperate columns by doing the following:

Cell B1 Formula:

=split(A1,"|")

Hope this helps.

Windows Notepad Timestamp

notepad

Pro Tip of the day….open MS Notepad.  Next place the following at the top of the file:   .LOG

Now when you open the file it will automatically insert the date and time.

You can also press the “F5” key to insert a new date and time stamp on the fly.

WordPress file permissions

Thanks to my host CloudAtCost, I had to rebuild this entire site.  Their “migrate to Cloud Pro” is a total joke and does not migrate anything.  It instead deletes the servers that you must rebuild from scratch!  I have lost years of posts, but I was able to recover some data.

Here is the correct file permissions for WordPress:

To set correct permissions you need to use these commands:

chown www-data:www-data -R *          # Let apache be owner
find . -type d -exec chmod 755 {} \;  # Change directory permissions rwxr-xr-x
find . -type f -exec chmod 644 {} \;  # Change file permissions rw-r--r--

Vortexbox – Google Music Plugin – No sound

 

VB

I was able to setup the Google Music Plugin on my VortexBox and see all of my music in the browse nodes, but whenever I tried to play anything all I would get was ‘dead air’.

I saw the following error in the server log:
Code:

Slim::Control::Request::execute (1888) Error: While trying to run function coderef [Slim::Control::Commands::playlistJumpCommand]: [Can't call method "isa" on an undefined value at /usr/lib/perl5/vendor_perl/Slim/Player/Squeezebox.pm line 762.]

After looking around, I have stumbled across the solution to my issue:
To fix, first SSH into your VB and run the following command:
Code:

nano /usr/lib/perl5/vendor_perl/Slim/Player/ProtocolHandlers.pm

Now scroll down and find the “%protocolHandlers” section and add the following line of code:
Code:

https => qw(Slim::Player::Protocols::HTTP),

Now, save and exit the file. Restart your VortexBox and you should be all set.

Happy listening!