Add random string to a field using SQL Update

Published on Author JFLeave a comment

Here’s a simple script to add a random string to a SQL Update: update <dbname>set <field> = (SELECT SUBSTRING(CONVERT(VARCHAR(40), NEWID()),0,9)) This will update each row with a distinct 8 alphanumeric characters, e.g. C2552926 Breaking this down in terms of functionality: NEWID() – generates a UUID VARCHAR(40) – tells CONVERT() what string data type, max len… Continue reading Add random string to a field using SQL Update

Linux tail -f replacement on Windows

Published on Author JFLeave a comment

Use Get-Content and Get-Item in Powershell Looking for the tail command on Windows? Get-Content will do the trick. Here’s a link to the command page. Open PowerShell: Show the last line/s: Get-Content C:\inetpub\logs\LogFiles\W3SVC1\u_ex200711.log -Tail 1 Or use get-item Get-Item -Path .\LineNumbers.txt | Get-Content -Tail 1 Stream the file like tail -f Get-Content path-to-file -wait Example:… Continue reading Linux tail -f replacement on Windows

How to install WKHTMLTOPDF 0.12.1.4 on Ubuntu 16 Xenial

Published on Author JFLeave a comment

This might work on Ubuntu 18, as well, but I have not tested it. Also, there is no official build release for it. You might need to compile it on your own. Note: if you are getting the “GLIBC_2.7′ not found” error, it could be that you need to uninstall and then reinstall a specific… Continue reading How to install WKHTMLTOPDF 0.12.1.4 on Ubuntu 16 Xenial

How to search the Microsoft SQL Full Text Search index

Published on Author JFLeave a comment

Use this query in SQL Management Studio to directly search the Full Text Search index. select * from sys.dm_fts_parser(‘”search term”‘, 1033, NULL, 0) Note that there are upcoming changes to FTI, including many deprecated functions, so if you’re using it extensively you probably have some work to do.

How to install PHP 5.6 on CentOS 6.10

Published on Author JFLeave a comment

I just did a fresh install of CentOS 6.10 today and needed to install PHP. It had been a while, so I needed a refresher. Note: PHP 5.6 is pretty much End Of Life, so you should be installing PHP 7.2, or higher at this point in time. That said, sometimes you have to support… Continue reading How to install PHP 5.6 on CentOS 6.10

How to use Tail in Windows Powershell

Published on Author JFLeave a comment

Windows is slowly, but surely, catching up to the hundreds of useful utilities for reading file content that *nix have had for forever. As you know, opening a 1 gig log file in notepad is impossible. Even using Notepad++, which can open some pretty large files, will not open a 1 gig file. Thank you,… Continue reading How to use Tail in Windows Powershell

Vagrant status is “running” but VirtualBox shows “Powered Off” Windows 10

Published on Author JFLeave a comment

You’ve installed Vagrant and run vagrant up and then vagrant ssh successfully. You then start VirtualBox Manager and it shows that it is powered off: In order to see the actual status, press SHIFT then right-click on the icon for Virtual Box, then click Run as Administrator You will see that it reports the VM… Continue reading Vagrant status is “running” but VirtualBox shows “Powered Off” Windows 10

How to get what version of Powershell you are using

Published on Author JFLeave a comment

Microsoft Windows Powershell is a very useful tool that brought some sanity to managing Windows outside the GUI. To find the version you are running, open Powershell, paste and hit enter: $PSVersionTable.PSVersion Result: Windows PowerShell Copyright (C) 2015 Microsoft Corporation. All rights reserved. PS C:\Users\username> $PSVersionTable.PSVersion Major Minor Build Revision —– —– —– ——– 5 0… Continue reading How to get what version of Powershell you are using