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

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…)

0

Code snippet : Sending email from PowerShell script

-

If you want to send email from PowerShell script via Google Mail:

$SMTPServer = "smtp.gmail.com"
$SMTPPort = "587"
$SMTPUsername = "sender@gmail.com"
$SMTPPassword = "password"

$EmailSenderAddress = New-Object System.Net.Mail.MailAddress("sender@gmail.com", "PowerShell Automated Email")

$EmailFrom = $EmailSenderAddress
$EmailTo = "recipient@gmail.com"
$EmailCc = "recipient@hotmail.com"
$EmailAttachment = "C:\Scripts\Attachment.txt"
$EmailSubject = "Automated Email with Report."
$EmailBody = @"
Please find attached report.
"@

$EmailMessage = New-Object System.Net.Mail.MailMessage
$EmailMessage.Subject = $EmailSubject
$EmailMessage.Body = $EmailBody
$EmailMessage.To.Add($EmailTo)
$EmailMessage.CC.Add($EmailCc)
$EmailMessage.From = $SMTPUsername
$EmailMessage.Attachments.Add($EmailAttachment)

$SMTPSession = New-Object System.Net.Mail.SmtpClient($SMTPServer, $SMTPPort);
$SMTPSession.EnableSSL = $true
$SMTPSession.Credentials = New-Object System.Net.NetworkCredential($SMTPUsername, $SMTPPassword);
$SMTPSession.Send($EmailMessage)
Write-Host "Mail Sent"
0

Code snippets : Encrypted password in PowerShell

-

Many times there is a need to store password in PowerShell script. Unfortunately to leave password in script is insecure solution and might cause an issue.

So, what to do if there is a need to have password in a script and we don’t want to have it embedded in clear-text in script?

Best way is to encrypt it and store in the file and then re-use it when required.

Create file with encrypted password

$secureString = Read-Host -AsSecureString "Enter a secret password"
$secureString | ConvertFrom-SecureString | Out-File C:\Scripts\storedPassword.txt

Use encrypted password in script

$secureString = Get-Content -Path C:\Scripts\storedPassword.txt | ConvertTo-SecureString
Remember that password has to be encrypted on the account which will be running the script. So, in case you plat to use Task Scheduler to run PowerShell script, start PowerShell windows as particular user and then create file with encrypted password.
0

Tips & Tricks : Install Node.js on Debian 7.0 “Wheezy”

-

As on Debian 7.0 Node.js is not included in standard repositories, if you want to install it login to server as a root and issue following commands:

apt-get install curl
curl -sL https://deb.nodesource.com/setup | bash -
apt-get install -y nodejs