Monday 27 June 2016

How to get Cortana to go back to the lock screen when using "Hey Cortana"

While playing with Windows Phone 10 Cortana's "Hey Cortana" functionality–where you can say "Hey Cortana" out loud and Cortana will show up to help you out, just like "Hey Siri" or "Ok Google"–I was kind of frustrated about getting Cortana to go back to the lock screen when I was done. Eating up battery with a full lit screen seemed like a waste, and if I am using "Hey Cortana" I'm probably not in a position to easily hold down the power button to activate the lock screen.

After trying, and failing, by using various commands like "Bye", "End", "Good Bye", "Go to Lockscreen", "Lockscreen", "Go to sleep", "Sleep", "End program", "End of line"*, "Terminate", "Terminate program", "Kill process", "End process", "Go away", and all of the above and more with various expletives I finally came across the magic one!


"Never mind"

After you have use Cortana for, whatever, just say "Hey Cortana" again and then "Never mind" and you will be back to the lock screen!

Yay!

*Interestingly Cortana will ~correct~ change "End of Line" to "eol"
*Extra points for movie reference ;)

Monday 21 March 2016

Listen to DI.FM streams with VLC as a "Free Listener" (March 2016)

As a long time  DI.FM  listener I remember the days when tuning into streams with  Winamp  was just how you listened.* Of course as time has gone on  VLC  has become dominant for streaming media, especially since it is OSS and works on practically every platform.

*(This has its connections to  Icecast  which uses the  SHOUTcast  protocol, SHOUTcast being by  NullSoft  which of course made/owned... Winamp.)



So, not too long ago DI.FM started changing things and they didn't share stream URLs very freely. But it wasn't hard to find their  http://pub#.di.fm  (where # is an integer between 1 and ...?) Icecast listings. Paste the link with the mount-point of your choice in VLC or w/e and there you go!

Well the PUBlic listings are still up (minus pub3  ??) but when you tune in you get a canned message about "copyright" this and "PRO account" that...

But hey, I signed up to DI.FM's site. I am a "Free Listener", I hear all the ads, probably don't get the best steam quality, sure. So why can't I just listen on VLC?! ;_;

Well, as it turns out it isn't even as difficult as using your "listener key" or w/e you get when you login to their site. (which is weird because when the site is making all the stream requests it includes your "id/key" as a querystring to the server and even sends all your cookie data along too.)

All the public servers are looking for now is:
  • A valid Browser User-Agent
  • That  http://www.di.fm/  is the referring page


Poor Man's Method (cURL)



  • Pipes cURL putput directly to VLC
  • I have VLC_BIN as an example for pointing to the VLC app on OSX
  • `vlc -`  the dash means "read from STDIN"
    • https://wiki.videolan.org/Uncommon_uses/


    VLC_BIN=/Applications/VLC.app/Contents/MacOS/VLC
    
    curl 'http://pub5.di.fm/di_vocaltrance_aac' \
    -H 'Accept: */*' \
    -H 'Connection: keep-alive' \
    -H 'Referer: http://www.di.fm/' \
    -H 'User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36' \ -H 'Accept-Language: en-US,en;q=0.8' \
    --compressed | $VLC_BIN -


Charles Proxy  Method



Suffice to say:
  • Get Charles
  • Use its Rewrite to:
    • Modify the  User-Agent Header  to be that of a valid browser
    • Add the  Referrer Header , being DI.FM's URL
  • Point VLC to the proxy
    • Usually  localhost:8888  or something...
  • Connect to stream through VLC as usual!


Possible Cheap &(!) Clean Methods



  • Tinyproxy  - https://tinyproxy.github.io/ might be worth a look