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

Friday 12 December 2014

MacPorts problem installing mono-addins

OSX version: 10.9.5
MacPorts version: 2.3.3
mono-addins version: 0.6.2

Command line error:
$ sudo port install mono-addins
--->  Computing dependencies for mono-addins
--->  Building mono-addins
Error: org.macports.build for port mono-addins returned: command execution failed
Please see the log file for port mono-addins for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_mono-addins/mono-addins/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port mono-addins failed

main.log error: (toward the end)
:info:build error CS1705: Assembly `gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f' references `Mono.Cairo, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' which has a higher version number than imported assembly `Mono.Cairo, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'

Find it fast using:
grep -n ":info:build error" /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_mono-addins/mono-addins/main.log 

Where is Mono.Addins.Gui?:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_mono-addins/mono-addins/work/mono-addins-0.6.2/Mono.Addins.Gui

From https://monoaddins.codeplex.com/discussions/399592 :
"Go to makefile in the Mono.Addins.Gui project and find ASSEMBLY_COMPILER_FLAGS. Add -sdk:4 after -d:DEBUG and run make again."

 

Monday 20 October 2014

Upgrade Crunchbang from wheezy/waldorf to janice/jessie (stable to testing) simplified


Following jschueths's post Updating Crunchbang to the Next Release I decided to use SED to make everything easier, instead of making the changes one-by-one by hand.

We should probably make backups of the files we are modifying first:
$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.waldrof
$ sudo cp /etc/apt/preferences /etc/apt/preferences.waldrof
Then one command to make all the modifications:
$ sudo sed -i 's/waldorf/janice/g;s/wheezy/jessie/g' /etc/apt/sources.list /etc/apt/preferences
Then as jschurths said:
$ sudo apt-get update
$ sudo apt-get --no-install-recommends dist-upgrade

Sunday 19 October 2014

Block incoming WAN (Internet) connections for SAMBA using iptables


 This is my idea on how one might keep WAN connections from hitting a SAMBA server:
iptables -m multiport -m comments -A INPUT -s 192.168.0.0/24 -p tcp --dports 137:139,445,43270,43273 -j ACCEPT --comment "Allow local connections to SAMBA - TCP"
iptables -m multiport -m comments -A INPUT -s 192.168.0.0/24 -p udp --dports 137:139,445,43270,43273 -j ACCEPT --comment "Allow local connections to SAMBA - UDP"


iptables -m multiport -m comments -A INPUT -p tcp --dports 137:139,445,43270,43273 -j DROP --comment "Block WAN connections to SAMBA - TCP"
iptables -m multiport -m comments -A INPUT -p udp --dports 137:139,445,43270,43273 -j DROP--comment "Block WAN connections to SAMBA - UDP"
 The ports *should* be right for SAMBA. The network address and range (192.168.0.0/24) might have to be changed to reflect you LAN (internal network)

Tuesday 28 January 2014

Unity 4 - Third Person Controller and Camera useage hints and tips

1.) First thing first, when applying the components "Third Person Controller" and even more importantly "Third Person Camera" BOTH scripts should be applied to your player object. "Third Person Camera" is not meant to be applied to a camera, as much as the name might suggest it.

If you attached the "Third Person Camera" script to a camera you probably got a message like the following:

Please assign a target to the camera that has a ThirdPersonController script attached.
UnityEngine.Debug:Log(Object)
ThirdPersonCamera:Awake() (at Assets/Standard Assets/Character Controllers/Sources/Scripts/ThirdPersonCamera.js:58)

2.) If you can't find "Third Person" Controller or Camera look under Components > Scripts.

3.) If you leave the "Camera Transform" attribute under "Third Person Camera" blank the script will try to use the Main Camera automatically. If you have no main camera (for whatever reason) and don't assign a camera transform to it there will be issues.... With an error probably like the following:

MissingComponentException: There is no 'Camera' attached to the "something" game object, but a script is trying to access it.
You probably need to add a Camera to the game object "something". Or your script needs to check if the component is attached before using it.

4.) If you get the following error:
InvalidCastException: Cannot cast from source type to destination type.
ThirdPersonCamera.Awake () (at Assets/Standard Assets/Character Controllers/Sources/Scripts/ThirdPersonCamera.js:52)
...it is probably because there is a collider on your player object. Take off the collider. Something ("Character Controller" I assume) is adding automagically.

5.) If you get weird jumpiness when turning, make sure all the above it straightened out. Then make sure the Camera isn't a child object of the player... Who knows, maybe it got there when you were experimenting with the scripts initially? :p

Tuesday 19 November 2013

Convert .vhd to VMWare image (.vmdk) on Mac OSX

In order to convert a Microsoft Virtual PC hard drive image (type .vhd) to a VMWare Fusion image (type .vmdk) on OSX you can use Qemu. While other articles mention using the Mac port of qemu called simply "Q", using Macports you can use Qemu directly.

Using Macports:
sudo ports install qemu
Then using the qemu-img command:
qemu-img convert -f vpc -O vmdk Win7_IE8.vhd win7-ie8.vmdk

...for example will output the desired image!