Posts

Showing posts with the label Powershell

Three-headed dog meet cockroach, part 2: CockroachDB with Active Directory

Today, I am going to discuss CockroachDB integration with Active Directory. AD is the commercial brother of Kerberos maintained by Microsoft. AD is a de facto authentication standard across large enterprises and our customers expect products calling themselves enterprise to work seamlessly with Active Directory. Hence, here's my write-up with end to end steps to deploy a lab environment to try on your own.

Exploring CockroachDB with Jupyter Notebook and Microsoft PowerShell

Today, we're going to venture out into the world of .Net through a scripting language out of Microsoft called PowerShell. My familiarity with .Net is quite minimal but I do have an extensive background in PowerShell scripting, albeit going years back. Pardon me for being a bit rusty. I've always loved PowerShell when I was working on the Microsoft platform, it allows for interactive and object oriented approach working with databases. Scripting admin tasks for DBAs on Windows was always a challenge for me until PowerShell came into the picture. I had to maintain many database servers and PowerShell became my best friend. Today, I will show you how PowerShell can become your best friend working with CockroachDB! Note: The title is a bit misleading as you will see this tutorial is more about exploring PowerShell from the console rather than Jupyter Notebook but I do make my best effort to emphasize what does and does not work today in Jupyter when it comes ...

Identify uncompressed tables in SQL Server database with Powershell

Today I will illustrate how to check whether data compression is enabled on your SQL Server. This script is highly flexible and you may adjust it to your liking. I will only concentrate on compression today, in the next installment I will show how to modify this script and get other things done on your database server. #This is how you comment in Powershell v.2 for big paragraphs <# Artem Ervits Database Services Group Check whether compression is enabled Ver. 1.0.1 01/04/10 Added prompt to enter server name Ver. 1.0.0 12/07/10 Initial Script #> #cls is an alias for clear screen cls #you may take input from a list of servers in your txt file but we’re going to concentrate on one server at a time right now. #$hostname = Get-Content "C:\servers.txt" echo "Please Enter Server Name:" #This next line will prompt you to enter a SQL Server N...

Update on get-process | kill

Got replies on #twitter by @jsnover, @r_keith_hill re: get-process | kill command. It is fixed in #powershell v.2, will only kill user- specific processes. Will test in Windows 7, also was told to use -whatif tag. -whatif tag tells you what the command you're about to run will do. Now that's neat! Thank you fine gentlemen for your help. Twitter is a wonderful tool! --Artem

Never do this in PowerShell!

I was playing with #powershell the other day and found this "neat" trick. If you type "get-process | kill", it will reboot your box i.e. kill all running processes. Goes to show how important it is to know what you're doing with #shell. Use at your own risk! -- Artem

Run Powershell Inside Cygwin

Image
#Cygwin in simpler terms is a bash shell for #Windows.  You can run all your favorite bash tools like #rsync, #ssh, etc in cygwin. Turns out, you can run #powershell also. Yes powershell! Simply type “powershell” in cygwin, no quotes, and you will enter a powershell environment. Else, you can type a full command like this >powershell “get-eventlog System”. At the end you will be brought back to bash shell. In the first example you will stay in powershell. One caveat though, I don’t see tab completion in cygwin and file names are case sensitive, so you must specify the names exactly how they’re defined. ______________________________________________________________________