Author: way0utwest

  • Fixing Python on Windows 10 – #SQLNewBlogger

    Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

    The other day I picked up a laptop, opened a command prompt and typed “python” to check something. I got this:

    2021-02-04 17_52_35-Microsoft Store

    I did have Python 3.8 installed, so upgrading to 3.9 wasn’t out of the question. However, why did this come up?

    I searched around and found out that Windows sets up application aliases for some versions. I can only assume since I had python on here that some update last fall did this and I hadn’t used this laptop for python because I’m stuck at home.

    I saw this on SO as an issue, and followed the instructions. I used Win+I to open the control panel. Here I typed “apps and” to get to Apps and Features.

    2021-02-04 17_56_28-Settings

    In here, I see there are “App execution aliases” as a link.

    2021-02-04 17_56_57-Settings

    In here, I see that both Python.exe and Python3.exe are set as aliases.

    2021-02-04 17_57_38-Settings

    I turned these last two off and then when I type “python,” I get what I want.

    2021-02-04 17_58_14-cmd - python

    SQLNewBlogger

    I wrote this as many of us run into silly issues, and while I found that SO article quickly, you might not. Your search terms might be different, or the search engine might give you different results. This might help you get setup quickly with Python, which is becoming more useful for data professionals.

    This took my about 5 minutes to type up and grab a few screenshots.

  • A Bug or a Vandalism Opportunity

    I hadn’t heard about this problem at all until I saw a story recently. Apparently a one line command can be hidden inside a Windows shortcut file, a ZIP archive, batch files, or various other vectors. This command can trigger hard drive errors that corrupt the device.

    Yikes. A researcher apparently has been trying to draw attention to this since August, but it has not been fixed. What is scary is that this issues can be exploited by tricking standard accounts in Windows, not just privileged ones.

    However.

    It’s not really a big problem. I asked around and someone sent me a few links that this doesn’t actually corrupt the drive, but just gets Windows to report this. In that case, this might not actually do anything, but it certainly would cause my blood pressure to rise and my heart to skip a beat. This also might be a great phishing vector.

    If you get a message about corruption, check that it’s actual corruption and not just the report from a shortcut or link that uses this message. Certainly, be careful about what you click.

    And if you’re thinking of playing a joke on someone, this isn’t a good choice. This is more like vandalism than fun. I certainly wouldn’t be pleased if you did this to me.

    Steve Jones

    Listen to the podcast at Libsyn, Stitcher, Spotify, or iTunes.

  • Daily Coping 9 Feb 2021

    I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag. 

    Today’s tip is to do an act of kindness to make life easier for someone else.

    In the current world, I don’t get the chance to see many people. Even those I do get to see are light, brief contacts. The person I see most often is my wife, and she certainly has a very busy life. Her horse training hasn’t slowed with the pandemic, and with mild winter weather, she has very full days.

    I like to cook, so I made it a point a few times in the last couple weeks to make lunch, pack up a plate, and carry it out to the barn/arena so she could eat while teaching. She often won’t take the breaks, or has a tight schedule, so providing her some food makes life easier.

  • T-SQL Tuesday #135 – Awesome Tools

    tsql2sday150x150It’s blog party week for T-SQL Tuesday, and I think this is a good choice for a topic. The host this month is Mikey Bronowski, and his invitation is on tools. I work for a tools vendor, and I’ve used a lot of them in my life, so I want to share what I think in 2021. I’ll also say that Mikey has a good list in his invitation of what he uses. I especially like his use of PoSh things and Greenshot.

    I’ve going to tackle this in a couple ways as I really have two parts of my job here, so I’ll look at tech tools and then productivity tools.

    Technical Tools

    I work for Redgate Software, so I use the Redgate Toolbelt a lot, as well as some of the Deploy tools. Specifically for me, I use these every week:

    • SQL Prompt – can’t live without it, and struggle to write t-sql when this isn’t working.
    • SQL Source Control / SQL Change Automation – I use these regularly, and while I tend to prefer SQL Source Control for many tasks, I love migrations. Slowly, I am moving to Flyway for some things, as I think this is our future.
    • SQL Clone / SQL Provision – I copy and mask databases regularly. This makes creating test copies quick and easy.

    Outside of Redgate, I really like VS Code for lots of editing, whether C#, Python, or PowerShell. I’ve been trying to use Azure Data Studio more, but I just prefer VS Code. No real good reason here. I have Sublime Text as well, which I use for text/html/markdown, but I think I am slowly going to move to VS Code for more, and I might not install Sublime on my next machine.

    I still live in SSMS most of the time, rarely in VS, but sometimes. However, as I do more DevOps stuff, I also have a few other major tools that I use every day and continue to learn about:

    1. git – I do a lot of command line stuff, and continue to get better, even with the VSCode client. I used GitHub and AzDO for repos, but lots of basic git stuff is important for my work
    2. Azure DevOps – I used other tools, but my goto, and the one I used for SQLMemorial.org, is Azure DevOps
    3. Chocolatey – package manager and install tool for Windows. This let me set up a machine in an hour or so, as opposed to a day.
    4. Docker – I use containers more and more rather than installing software.

    I may use other items, like tsqlt, but these are the big tools that help me get code written.

    Productivity Tools

    More of my job is writing related. I essentially run a newspaper at SQLServerCentral, and I produce a lot of content. As a result, I have some tools that make that easier, and help me coordinate with others.

    Here’s a list with a few comments:

    1. Evernote – I subscribe and use this to keep random notes for editorials and work things. I drop notes in here from meetings. I also have various items for my personal life, like logging maintenance on vehicles, license plates, recipes for cooking, and more. Worth my $$$. There are other good note apps, but I’ve been living on Evernote for 6-7 years, so no one has made a good case for my to switch
    2. DropBox/OneDrive – I sync stuff between machines and my phone. I’ve used DropBox for years, but their changes on mobile, which don’t make files stored and available, have me considering a fulltime move to OneDrive. A sync tool is important. Pick any one, but use it.
    3. Password Safe – Everyone needs a password manager. I’ve had this one since its release in 2002. free, secure, works across platforms, I see no reason to change. Use something here.
    4. Greenshot – I’ve tried various screen capture tools, but this one is lightweight, stable, and easily installed.
    5. Live Writer – I use the open source project for blogging. A drive sync tools keeps drafts on all machines.
    6. Camtasia – While there are lots of ways to capture screen video, Camtasia just works for me. Not the best, but simple enough and stable enough for building presentations and other recordings of my screen. I can record something quickly, and then edit a video or animated gif in minutes.

    While I certainly use Office (Excel, Word, PowerPoint), those are less of my day than these tools. I usually outline and build some stuff in Evernote before it goes into PPT. I do a little spreadsheet work, and some Power BI, but I’m really productive with these tools.

    The last tool I lightly mention is Spotify. I love music, and I appreciate having it in the background sometimes. My wife prefers Pandora, but whatever helps get you in a good mood, use it.

    My advice, try a few things, learn how one works well, and get better at it.