0

Code snippets : Execute SQL script using PowerShell

-

Recently I went through requirement of running SQL scripts on multiple databases on different servers. As the list of databases was different from script to script I decided to create universal solution, which will allow to easily prepare for deployment and can be simply reused at any time.

As a platform to execute scripts I went with PowerShell as that provides flexibility in case additional functionality will be required.

Whole solution contains 3 files:

  • SqlExecutionInflow.csv – file contains list of databases and servers where particular database is located. It is simple CSV file with 2 columns
  • SqlExecQuery.sql – contains SQL script which will be executed against all databases listed in SqlExecutionInflow.csv
  • SqlExec.ps1 – main script which load SqlExecInflow.csv and executes query from SqlExecQuery.sql

All files have to be placed in same folder. As a result script will create transcript file with output from all executed commands.

And here are example files and script itself…

(more…)

5

How-to : Install Bareos with WebUI on openSUSE 13.2

-

Recently I went through installation process of Bareos on openSUSE. Bareos seems to be interesting solution for backups in heterogeneous  environments.

Ok,let’s start and see how to deploy in 5 steps:

  • Step 1: Add repository with Beros and Beros WebUI; Install Beros
  • Step 2: Create Bareos database and Tables on MySQL
  • Step 3: Configuring Bareos (few config files)
  • Step 4: Starting services and accessing WebUI portal
  • Step 5: Enable/Autostart Bareos services (optional)

(more…)

0

Tips & Tricks : MediaWiki 1.25.1 and VisualEditor

-

In case you want to deploy MediaWiki 1.25.1 with VisualEditor use following components:

Configuration details for LocalSettings.php for these components can be found here:

When you download VisualEditor from Git repository installation with MediaWiki 1.25.1 is more likely to fail.

0

Cheat Sheet : SCO Vi Quick Reference Guide

-

I just found vi reference from Santa Cruz Operation (SCO) 🙂 Nice piece of memorabilia as well as handy reference for vi beginners.

0

Tips & Tricks : Using EPEL with CentOS

-

If you use CentOS and want to add some extra packages you can use EPEL.

Extra Packages for Enterprise Linux is project created by Fedora.

In order to use repositories on CentOS first download and install RPM appropriate for your version of CentOS from here:

Method 1

http://dl.fedoraproject.org/pub/epel/

Then install it and enjoy more packages from new repo.

 

Method 2

[root@localhost ~]# yum install epel-release

Here is example from CenOS 7 how to add EPEL repositories:

(more…)