Scott Hanselman

On the importance of OpenSearch

April 3, '15 Comments [29] Posted in Open Source
Sponsored By

I'm a big fan of Open Search, the idea, the format, and the user experience it can enable. You start typing a domain you've hit before that you want to search within. When it starts autocompleting, you hit tab, and then type your search.

So, "stacko - TAB - json - ENTER" has me searching StackOverflow for json results. I don't have to google/bing and then add "site:stackoverflow.com" to my query. I don't have to hit the home page then look around for a search box. The site just includes a meta tag and an opensearch.xml file and poof, the site has taught my browser how to search. Once you've tried this, you'll find it hard to browse/search without. You'll prefer sites that include it and be frustrated with sites that don't. (More on that later.)

IMPORTANT UPDATE/NOTE: A buddy of mine points this out, and he's right. That said, I want to say that I like BOTH of them, and I'm very much enamored with the Tab Search feature.

"Just to be clear, these things are not the same thing.

  • OpenSearch is a format for specifying how to search a site. 
  • Tab Search is a particular UX for allowing you to do a search on a non-default search provider. It happens to use OpenSearch to learn how to search different search providers."
  • I setup OpenSearch at Hanselman.com back in 2009!

    Chrome has a great implementation of Open Search.

    Type, Tab, Type, Enter

    I just added a one line META tag and a static XML file. Boom.

    Your static XML file describes what the resulting URL should look like. Here's a small example.


    Hanselman Search
    Search Scott Hanselman's Blog

    http://www.hanselman.com/blog/favicon.ico
    UTF-8
    http://www.hanselman.com/

    This is such a clean and obvious user story. It makes your web browsing experience better.

    User wants to easily search within a site they visit often. Every browser and OS should support OpenSearch.

    Amazon used to support it but in the last year or so removed it in a homepage redesign. It's more than a little ironic that it was a9.com and Amazon.com that came up with OpenSearch and actually host the http://opensearch.org websites, but now the Amazon.com home page doesn't support it.

    If you work for Amazon and are reading this blog post, consider this your calling out. Please put OpenSearch back on Amazon.com.

    Dear Reader, take a minute and see if your favorite browser supports OpenSearch. If it does, try it out. If not, ask them for it. Same for your favorite sites. If you run a site, you can easily add OpenSearch in a few minutes.

    About Scott

    Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

    facebook twitter subscribe
    About   Newsletter
    Sponsored By
    Hosting By
    Dedicated Windows Server Hosting by SherWeb

    Setting up a VPN and Remote Desktop back into your home with a Synology (from an iPhone)

    April 2, '15 Comments [27] Posted in Hardware | Open Source | Win8
    Sponsored By

    It's amazing that I can basically be my own IT Department. The kinds of things we can do in our homes as individuals with off-the-shelf hardware would have needed an IT Dept of a dozen just 10 years ago, ya know? Amazing.

    I wanted to be able to VPN into my home and remotely access my machines and files. I do very much realize there are a lot of different options to do this, and have been for years. From GoToMyPc to Hamachi, again, there's dozens of ways. I wanted a VPN solution I could use on my iPhone/iPad and Surface. I wanted it to be standards-based and not require any additional software installations.

    I have a a Synology 1511+ NAS appliance and I love it. It's not just a file server, it's an everything server, in my house. I use it for Plex, it hosts my files and photos, it manages my surveillance cameras and acts as a camera DVR, it runs a Minecraft Server, it's a Git server, it even runs Docker.

    The Synology will act as my VPN server as well.

    Here's how I set up four things. The Synology, my Router, my iOS device, and my Windows PC/Surface.

    The result is I can now remote into my home and manage things from any device I own.

    Setting up a Synology for L2TP VPN

    First, in the Synology Package Manager, ensure that you've got the Synology VPN Server package installed and running.

    Adding VPN Server on Synology

    You should give some though as to which VPN technique you want to use. I decided on L2TP, although there is some concern the NSA has weakened it. Benefits are that it's on all major platform, it's generally considered secure, and it's easy to setup.

    Select L2TP (or whatever you want), and Enable it. Notice also that I selected my INTERNAL DNS server. I found this worked best for me when trying to access internal resources. You can also setup a hosts file if you want to just hit a few things inside your house.

    L2TP in Synology

    Now click on Privilege. Just give the minimum privileges to the user that needs them. NO need to give VPN access to users who won't use it.

    VPN Server in Synology

    Setup your Router for VPN (L2TP)

    My router is a Linksys WRT1900ac that I like very much. It supports port forwarding, and the Synology can often talk directly to a router and request open ports. However, there's something to be said for handling things yourself. It lets you know exactly what's going on, and it can be less of a "black box."

    Login to your router and in this case of L2TP, forward UDP ports 1701, 500, and 4500. On my Linksys, it's under Security, Apps and Gaming.

    The Device IP is the internal IP address of your Synology. It's best to have your Synology use a Static IP address, or at least have a DHCP reservation so this IP doesn't change and things stop lining up.

    Port Forwarding in a Router

    Also, ensure that your Router is passing L2TP traffic as well. I changed this under Security.

    L2TP Passthrough

    At this point, you should be able to at least try to connect to your house via VPN. I did this as a quick test by taking my iPhone off the wireless networking (thereby being on the open internet) and VPN'ing back in.

    If you succeed, you should be able to see yourself in the VPN Server | Connection List area on our Synology.

    VPN Server

    Here's what I did on my iDevice to setup VPN.

    Setting up iOS/iPhone/IPad for VPN

    From the iOS Settings app, go General | VPN. Touch Add VPN Configuration. I selected L2TP and put in my Server name or IP and named the account "home."

    NOTE: If you don't want to use your IP address, you can use the Synology.me dynamic DNS feature built into your Synology, or any one of many dynamic DNS systems that will give you a nice domain like "myhanselmanhouse.foofoo.com" or whatever. You can also, if you like, setup a CNAME with your own domain and point it to that dynamic domain. So vpn.hanselman.com could be your server, if you wanted.

    With L2TP you'll need your username and password, as well as a Shared Secret. That's like another password. Specifically the Secret text box in iOS is the "pre-shared key" from your Synology L2TP VPN setup.

    Add VPN in iOS

    At this point you'll get a nice VPN option on your Settings app under Personal Hotspot that wasn't there before. You can turn it on and off now, easily.

    VPN Connecting in Settings

    Once I'm VPN'ed in I can see a [VPN] indicator in the top status bar. I've installed the FREE Microsoft Remote Desktop Client for iOS.

    RD Client on an iPhone - Remote Desktop

    And here's me VPN'ed into my home PC from my iPhone. This of course, can be done on Android and Windows Phone as well.

    Remoted into my desktop at home with RDP

    It looks small, but in reality it's very usable, especially from an iPad with a Bluetooth Keyboard.

    Setting up L2TP VPN on Windows 8.1

    Now I'll setup VPN back to home on my Windows 8.1 machine. For some reason this was super easy in Windows 7, but in Windows 8.1 there isn't a clear way to just add a L2TP VPN. You can add other simpler (or Vendor) VPNs in a straightforward manner, but not L2TP.

    Just hit the Windows key (or Start Menu) and type "Add VPN." When you get to the VPN management screen, you'll see this and can fill it out.

    Adding VPN

    But L2TP VPN setup with a pre-shared key requires some more work. If you know of a simpler way, let me know. I can see about three different ways to get to the same result.

    Go ahead and create a new VPN connection with the menu above. Select Microsoft as the VPN type and put in your server address and optionally name and password. This will create the VPN connection.

    Pay attention now. Go back to the Start Menu and type "Network Connection." You want the first item called "View Network Connection" (a classic control panel, not a fullscreen 'metro' one).

    Opening Network Connections

    From there, you'll open a classic control panel and see your VPN connection. Right click and click Properties.

    Network Connections with VPN

    Click Security, make sure L2TP is set, then click Advanced Settings.

    L2TP VPN in Windows 8'

    Put your pre-shared key there.

    Setting a preshared key

    Connect to your home VPN and have fun

    Of course, please do remember to use strong passwords, strong pre-shared keys, and change them. Don't be lazy.

    At this point you can connect to your home/office and work to your heart's content.

    VPN Connection in Windows 8

    For some of you this is "duh" or old hat, but for me it was something I just never got around to doing. Mostly laziness prevented. But just last week I had to drive 30 miles back to my house from a dinner in order to move a file from my Desktop into Dropbox. I'm pretty sure I'm not the only reasonably smart techie with a story like that. This VPN setup would have meant I could do that from my phone and it would have saved me a big hassle and over an hour of my time.

    RELATED LINKS

    About Scott

    Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

    facebook twitter subscribe
    About   Newsletter
    Sponsored By
    Hosting By
    Dedicated Windows Server Hosting by SherWeb

    March was for Makers - Fantastic Hardware Tutorials, Videos, Podcasts and more!

    April 1, '15 Comments [2] Posted in Hardware
    Sponsored By
    Hanselman's Desk of Hardware

    I'd like to take a moment and be proud of myself and my friend Saron. This last month, March of 2015, we teamed up at decided to come up with a scheme to get folks excited about Making. By making, I mean creating physical things with hardware like Arduino, Raspberry Pi, soldering things, and generally using electricity and software to do awesome stuff.

    A lot of us are software engineers, but we don't realize how powerful we can feel when we do things with the software and hardware.

    Getting that LED to flash is just the beginning. When you can affect your physical world, the sense of empowerment is intoxicating. This is fantastic not only for old-timers like myself, but also young people and kids who may be looking into engineering as a career.

    All month long we did podcasts, blog posts, Twitter chats, and live Google hangouts, all with the goal to get you, dear reader, excited about hardware. I'm REALLY proud of what we accomplished. Note that we both do this on the side as volunteers while holding down regular jobs.

    Please Subscribe Now

    I don't think I ask you for much, but I will ask you right now to take a moment and subscribe to our two podcasts using your favorite podcast application:

    • CodeNewbie is the most supportive community of programmers and people learning to code. Tune in every week for stories about people on their coding journey.
    • Hanselminutes: Fresh Air for Developers is a weekly talk show that brings interesting people together to talk about the web, culture, education, technology and more.

    March Is For Makers

    Our little mini event was a great success, as far as we're concerned. We were not measuring things like page views, but rather excited people. Here's a few choice tweets.

    The http://www.marchisformakers.com site will continue to live on year-round with occasional updates, and we are planning next years event to be even bigger and more exciting. Until then, all of our content lives on.

    Here's some of the highlights of this fantastic month. You can get ALL the content on our site.

    And there's SO MUCH MORE.

    Again, please subscribe, and SHARE our adventure with your family, friends, teachers, students, kids, and others who you think would be great makers! #MarchIsForMakers.

    Related Links

    About Scott

    Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

    facebook twitter subscribe
    About   Newsletter
    Sponsored By
    Hosting By
    Dedicated Windows Server Hosting by SherWeb

    Getting admin by adding a new user to sudoers when you're locked out of an Azure Linux VM

    March 17, '15 Comments [11] Posted in Azure | Open Source
    Sponsored By

    So I got locked out of an Ubuntu VM that's running in Azure  Long story, but an employee left and somehow the "admin" user I had access to no longer had "sudo" powers anymore. I needed to run apt-get update && apt-get upgrade but literally had no user available with admin on the box.

    If the machine was local, I could perhaps boot into recovery mode but this is a VM in the cloud.

    I do however, have access to the Azure portal because I do own the VM. While the operating system  doesn't think I'm powerful inside, I am powerful outside. ;)

    Corey Sanders, the head of the IAAS team was kind enough to remind me of the CustomScriptForLinux "VM Extension." VM Extensions can inject/install software like Chef and Puppet into VMs. I talked to Kundana Palagiri about this on Azure Friday (http://friday.azure.com)

    He pointed me to his "AddUser.sh" script on GitHub. It's pretty straightforward, but how do I run it?

    #!/bin/bash
    # Script to add a user to Linux system
    if [ $(id -u) -eq 0 ]; then
            username="$1"
            password="$2"
            echo "Creating $username"
            egrep "^$username" /etc/passwd >/dev/null
            if [ $? -eq 0 ]; then
                    echo "$username exists!"
                    exit 1
            else
                    pass=$(perl -e 'print crypt($ARGV[0], "password")' $password)
                    useradd -G adm,dialout,cdrom,floppy,sudo,audio,dip,video,plugdev,netdev -m -p $pass $username
                    [ $? -eq 0 ] && echo "User $username has been added to system!" || echo "Failed to add a $username!"
            fi
    else
            echo "Only root may add a user to the system"
            exit 2
    fi

    I don't have root, but Azure has root. Azure has all the power, in fact. I need to run this script with parameters (my new username and password) then SSH in and put things right. I can return my original user to sudoers:

    sudo adduser <username> sudo

    And there's other administration I may want to do, including deleting this user I just added. Doing this dance is how I'm going to regain access to my VM, though.

    NOTE: There are other ways to regain access to a Linux VM if you've lost a SSH Key or forgotten your password, like the VMAccess Extension in PowerShell. However, not everyone has a Windows machine, and I wanted in fast without any local setup. I'm going to use the Custom Script extension.

    First, I'll log into the Azure Portal at http://portal.azure.com and select the VM, then under All Settings, select Extensions. Click ADD and pick Custom Script for Linux.

    Adding Custom Script for Linux

    Note that my bash script has two parameters, so I'll put my preferred USERNAME and PASSWORD in the Arguments box there and hit done.

    Successfully added a VM Extension

    After it's done, I click look at the detailed results. Do note that the Azure Portal is called into the backend REST services that manage all of Azure so you can certainly script all of this if you need to.

    Script Success

    Now I can SSH into the machine (I use bitvise) and then add my original user back into sudoers.

    Adding user to group sudo

    At this point I can generally tidy up this machine and put it as it was. I've regained control of a Linux VM that I no long had root on.

    Please check out http://friday.azure.com, subscribe on iTunes, and tweet and tell your friends! There are over 150 episodes of Azure Friday, each just around 15 min long!


    Sponsor: Big thanks to Aspose for sponsoring the blog feed this week! Are you working with Files?Aspose.Total for .NET has all the APIs you need to create, manipulate and convert Microsoft Office documents and many other formats in your applications. Start a free trial today.

    About Scott

    Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

    facebook twitter subscribe
    About   Newsletter
    Sponsored By
    Hosting By
    Dedicated Windows Server Hosting by SherWeb

    Tragedies of the Remote Worker: "Looks like you're the only one on the call"

    March 16, '15 Comments [70] Posted in Remote Work
    Sponsored By

    You're the only one on the callI'm writing this as I sit alone in a remote meeting room. As a remote worker, this is just one of the tiny, daily paper cuts. To be clear, I like being remote and I wouldn't change it, but some days Being a Remote Worker Sucks.

    This is a rant, but if you were remote you'd understand.

    You're the only one on the call.

    It was nice of them put a link to join the meeting into the invitation, except they never joined the meeting. They've changed their IM status to Do Not Disturb and aren't answering their phones. You're all alone in a virtual room and are now late for a meeting you were originally early for.

    When's the next time you're up?

    Whenever you are on-site, folks always say "when are you up next?" Seriously. Like I'm just on vacation the other 6 weeks I'm not at the mother ship.

    If only there were a global network with cameras and audio that would allow us to have a conversation while I'm away? But, alas, there isn't, so I'll see you again in 6 to 8 weeks.

    I'm remote but that doesn't mean I'm not available EVERY WORK DAY.

    Fifteen Minutes of "Can you hear me?"

    Please. Unmute your damn phone. http://howtounmute.com. Learning how to use your basic VOIP camera and audio is a sign of respect for your remote workers.

    You have a Webcam, use it.

    You can see each other, but I can't see you. I don't care that you "don't like to use your webcam." We are having a business meeting, turn it on so the remote works can get one of their 5 senses back. Seeing your face is the whole point. It really helps. Bonus points if you adjust your webcam when it's time to see the whiteboard.

    Have Empathy - Put yourself in the remote person's shoes

    When I came to work here I sent five managers gift-wrapped web cams with a note on how to use them. During my next office visit I found 4 of them opened and shoved off to the side of their desks. If I had a gluten allergy I think you'd be more accommodating. But I don't, I'm a remote worker.

    Remote iPad on a Stick - Double Robotics

    I'm remote, please add call link to the meeting invite

    Thanks for scheduling that meeting. Awesome that you got a room and everything. But I'm going to email you right back and remind you to add a call bridge/goto meeting/lync invite/google hangout. I just need access.

    Move closer to the mic

    You're in your office talking to me remotely, but not only will you not turn on your camera but you're talking on a speaker phone with your back to me as you spin in your desk chair.

    Did the meeting end? Guys? Any one there?

    It's so sad when I'm left on the table and you've all left the room. I'm just trapped in the Klingon Phone and you've got feet.

    Don't fade away. When someone is remote it's so important to check in as you're closing the meeting.

    The Klingon PhoneYour Inability to Deal with Me Remotely

    Everyone has some special need. Mine is I'm remote. Your inability to be even slightly flexible to that fact causes me problems literally daily. Remote workers go out of their way to be available.

    I'm on Lync, Skype, Slack, Twitter, and my cell phone is published in the company directory.

    And you just literally said with a straight face, "I couldn't get ahold of you." O_O

    Hearing an Important Conversation...as they hang up

    This happens more often than you'd think. The meeting is over and they are hanging up. You can see their hand dropping to hit "End Call" and then someone starts mentioning something TOTALLY IMPORTANT and....dial tone.

    Why don't you move up here?

    Wow! I never thought of that. After 7 years of working remotely for a dozen reasons, you finally asked the right question! Why don't I just move up there?

    Because. Reasons.

    What tiny indignities do you deal with as a remote worker? Sound off in the comments.

    Related Links


    Sponsor: Big thanks to Aspose for sponsoring the blog feed this week! Are you working with Files? Aspose.Total for .NET has all the APIs you need to create, manipulate and convert Microsoft Office documents and many other formats in your applications. Start a free trial today.

    About Scott

    Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

    facebook twitter subscribe
    About   Newsletter
    Sponsored By
    Hosting By
    Dedicated Windows Server Hosting by SherWeb

    Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.