Skip to content

Instantly share code, notes, and snippets.

@mnjstwins
mnjstwins / ReleaseViaJGitFlow.md
Created August 23, 2019 13:59 — forked from lemiorhan/ReleaseViaJGitFlow.md
How to make a release with Git and Maven via JGitFlow

How to make a release with Git and Maven via JGitFlow

Imagine that you are versioning your sourcecode in git and building your code via maven. You need to make releases before deploying to production regularly. What should be the strategy we need to follow for releasing?

I've used maven-release-plugin for years to make releases. It worked perfectly with maven and svn, but we started to face problems when we migrated our code to git and to make releases on git.

After checking the literature, we decided to use JGit-Flow which is a maven plugin based on and is a replacement for the maven-release-plugin enabling support for git-flow style releases via maven.

I do not want to explain the details much because there are many great posts explaining all.

import * as React from "react";
import * as Vue from "vue/dist/vue";
import VueElement from "./VueElement";
import { PropertyControls, ControlType } from "framer";
// Define type of property
interface Props {
text: string;
}
@mnjstwins
mnjstwins / mandrill.js
Created April 22, 2019 12:45 — forked from andris9/mandrill.js
Nodemailer using Mandrill
'use strict';
// Nodemailer: v2.0.0
// Ubuntu: 14.04
// node: v5.5.0
// npm: 3.3.12
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
service: 'Mandrill',
@mnjstwins
mnjstwins / Division42NetworkToolsDemo.cs
Created October 30, 2018 14:18
Example code to show how to use Division42.NetworkTools.
class Program
{
static void Main(string[] args)
{
DemoPing();
//DemoTraceRoute();
//DemoPortScan();
//DemoWhois();
Console.WriteLine();
@mnjstwins
mnjstwins / traceroute.js
Created September 11, 2018 13:43 — forked from liamgriffiths/traceroute.js
traceroute clone in javascript
// sloppy traceroute clone
// inpired by https://blogs.oracle.com/ksplice/entry/learning_by_doing_writing_your
// and made possible by https://www.npmjs.org/package/raw-socket
var raw = require('raw-socket');
var dns = require('dns');
var target = process.argv[2] || '173.230.146.29';
var MAX_HOPS = 64;
var TIME_LIMIT = 5000;
# Step 1 - Exporting SecureString from Plain text
"P@ssword1" | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString | Out-File "C:\Temp 2\Password.txt"
# Step 2 - Creating PSCredential object
$User = "MyUserName"
$File = "C:\Temp 2\Password.txt"
$MyCredential=New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, (Get-Content $File | ConvertTo-SecureString)
# The Default Execution Policy is set to restricted, you can see it by typing:
Get-ExecutionPolicy
@mnjstwins
mnjstwins / UseServiceBusFromPowershell.ps1
Created February 12, 2018 17:45 — forked from rberrelleza/UseServiceBusFromPowershell.ps1
Send and receive messages to a Service Bus queue via PowerShell
Import-Module "PATH_TO_Microsoft.ServiceBus.dll"
#Create the required credentials
$tokenProvider = [Microsoft.ServiceBus.TokenProvider]::CreateSharedSecretTokenProvider("owner", "YOUR_ISSUERSECRET")
$namespaceUri = [Microsoft.ServiceBus.ServiceBusEnvironment]::CreateServiceUri("sb", "YOUR_NAMESPACE", "");
$namespaceManager = New-Object Microsoft.ServiceBus.NamespaceManager $namespaceUri,$tokenProvider
#Create a queue
$queue = $namespaceManager.CreateQueue("MyPowershellQueue");
@mnjstwins
mnjstwins / Send-SendGridMessage.ps1
Created February 8, 2018 19:27 — forked from pkskelly/Send-SendGridMessage.ps1
Sending Email from PowerShell using SendGrid (in Azure)
$Username ="azure_*********@azure.com"
$Password = ConvertTo-SecureString "********" -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential $Username, $Password
$SMTPServer = "smtp.sendgrid.net"
$EmailFrom = "[email protected]"
$EmailTo = "[email protected]"
$Subject = "SendGrid test"
$Body = "SendGrid testing successful"
Send-MailMessage -smtpServer $SMTPServer -Credential $credential -Usessl -Port 587 -from $EmailFrom -to $EmailTo -subject $Subject -Body $Body
@mnjstwins
mnjstwins / Export-SplunkSearch.ps1
Created November 30, 2017 20:22 — forked from halr9000/Export-SplunkSearch.ps1
Splunk export search job using PowerShell
# Conversion of http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTsearch#search.2Fjobs.2Fexport
# example using curl, to PowerShell with Invoke-RestMethod cmdlet
#
# $ curl -k -u admin:changeme https://localhost:8089/services/search/jobs/export
# --data-urlencode search="search index=_internal | stats count by sourcetype"
# -d output_mode=json -d earliest="rt-5m" -d latest="rt"
$cred = Get-Credential
# This will allow for self-signed SSL certs to work
@mnjstwins
mnjstwins / TerraformCredentials.ps1
Created October 5, 2017 13:28 — forked from bobalob/TerraformCredentials.ps1
Set Environment Variables in PowerShell for Azure RM Terraform
#Set Environment Variables for Azure RM Terraform
$ENV:ARM_SUBSCRIPTION_ID = ""
$ENV:ARM_CLIENT_ID = ""
$ENV:ARM_CLIENT_SECRET = "" # This should end with an '=' symbol
$ENV:ARM_TENANT_ID = ""