Thursday, June 22, 2017

c# : forcing US CultureInfo

using System.Globalization;
using System.Threading;



CultureInfo englishUSCulture = new CultureInfo("en-US");

CultureInfo.DefaultThreadCurrentCulture = englishUSCulture;

Tuesday, June 20, 2017

HOAX SMS from +639257117116

We are glad to inform you that you are ONE of our selected recipient and entitled to claim your Free Family Medical Card. Medical ref no:(UPS-050776)
kindly advice us if u are interested because we are Finalizing our record.
you may claim ur Card Today or Tomorrow from 10am to 6pm just bring 2 valid I.D and look for:
Ms. Sandra Gomez for immediate assistance 
Tel nos: 025096619 / 09167341969

Your Response is Appreciated God bless!!

Monday, June 12, 2017

Work updates : 13 June 2017

- New CTO, she's from Iran, based on Arendal, start 1st of May 2017
- Work in progress
- Support on e2 and integration
- Here or on Poland? Fast & Cost
- 15k employee support

Wednesday, April 19, 2017

BizTalk : Querying Receive Location

USE BizTalkMgmtDb
GO

-- Receive Location:
SELECT rl.Id, [Receive Location] = rl.Name, [URI] = rl.InboundTransportURL, [Receive Pipeline] = p.Name
FROM
 [dbo].adm_ReceiveLocation rl WITH(NOLOCK)
 LEFT JOIN [dbo].[bts_pipeline] p WITH(NOLOCK) ON p.Id = rl.ReceivePipelineId  
WHERE @KeyWord IS NULL OR rl.Name Like '%' + @KeyWord + '%'
ORDER BY 2
-- End of Receive Location:

PowerShell : BizTalk Error Send Email Alert.ps1

# biboyatienza - 13Jan.2017 15:59
# To Run => powershell -ExecutionPolicy Bypass -File "C:\BizTalk_Dropzone\PowerShellScripts\BizTalk Error Send Email Alert.ps1"
# biboyatienza - 19.April.2017 15:20 GMT+8 => Added detailed error:
##############################################################################
$SQLServer = "The_Server" #use Server\Instance for named SQL instances!
$SQLDBName = "IntegrationDb"
$SqlQuery = "EXEC [dbo].[usp_BizTalk_GetSuspended]"

$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
$SqlConnection.ConnectionString = "Server = $SQLServer; Database = $SQLDBName; Integrated Security = True"

$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
$SqlCmd.CommandText = $SqlQuery
$SqlCmd.Connection = $SqlConnection

$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd

$DataSet = New-Object System.Data.DataSet
$SqlAdapter.Fill($DataSet)

$SqlConnection.Close()

$DataSet.Tables[0]

foreach ($row in $DataSet.Tables[0].Rows)
{
    $ApplicationName = $row[0].ToString().Trim()
    $DateSuspended = $row[1].ToString().Trim()
    $Adapter = $row[2].ToString().Trim()
    $URI = $row[3].ToString().Trim()
    $ErrorDescription = $row[4].ToString().Trim()
    $Status = $row[5].ToString().Trim()

    # Email sending:
    $From = "NoReply <no_reply@biboyatienza.com>"
    $To = "admin@biboyatienza.com", "DBA <dba@biboyatienza.com>"
    $Bcc = "biboyatienza@gmail.com"
    $Subject = "Biztalk Error : " + $ApplicationName
    $Body = "Hi BizTalk Admin(s), `r`n`r`n"
    $Body = $Body + "Application Name: " + $ApplicationName + "`r`n"
    $Body = $Body + "Date Suspended: " + $DateSuspended + "`r`n"
    $Body = $Body + "Adapter: " + $Adapter + "`r`n"
    $Body = $Body + "URI: " + $URI + "`r`n"
    $Body = $Body + "Error Description: " + $ErrorDescription + "`r`n"
    $Body = $Body + "Status: " + $Status + "`r`n"
    $Body = $Body + "`r`n`r`n`r`n br,`r`n biboy atienza"
    $SMTPServer = "mail.biboyatienza.com"
    $SMTPPort = "25"
    Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject `
    -Body $Body -SmtpServer $SMTPServer -port $SMTPPort
}
##############################################################################

Thursday, April 6, 2017

Introducing my new laptop at home

The Lenovo n22 n3050;


https://www.cnet.com/products/lenovo-n22-80s6-11-6-celeron-n3050-4-gb-ram-32-gb-ssd/specs/

Though it is equipped with windows 10 pro 64 bit, I still need to wipe it out and install a fresh new Ubuntu 16.04 LTS. I want to utilized it's full power. I only have 32gig disk space and Windows will surely eat it all in the long run. :(

First thing should do is to download Ubuntu installer here,



Then since I am still working on Windows environment, I need an app to create a bootable Ubuntu usb, and Rufus (Create bootable USB drives the easy way) with do that for me.



Monday, January 16, 2017

Using PowerShell to call API

Below is a sample PowerShell script that call an sms API.

# powershell -ExecutionPolicy Bypass -File "FIlename"
$yourUri = "http://gateway.yesmsfusion.no/V1/smsapi.asmx/SendSms"
Invoke-WebRequest -Uri $yourUri -Method Post -Body @{
apiKey="LJLKJL233RNL3ACLSZB3M6ZOU19K"
receipient="+639171234567"
message="Het buddy! call me when your FREE. - PowerShell"
replyPath=""
originator="Biboy"
}

Wednesday, January 11, 2017

Send email notification using PowerShell sripting when there is an Error or Warning Event

Send email notification using PowerShell scripting when there is an Error or Warning Event

1. Create a schedule task, on an Event trigger
2. Create .ps1 file that will email you
3. Enable the Schedule Task