Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View pamanes's full-sized avatar

Alejandro Palacios pamanes

View GitHub Profile
@pamanes
pamanes / restart_and_continue_script.ps1
Created January 6, 2024 19:17
This PowerShell script runs with elevated privileges if not already, then executes a script and restarts the machine and continues after logon, a PowerShell window will appear after logon where the script runs
<#
.SYNOPSIS
This PowerShell script runs with elevated privileges if not already, then executes a script and restarts
the machine and continues after logon, a PowerShell window will appear after logon where the script will resume
.NOTES
File Name : restart_and_continue_script.ps1
Author : Alejandro Palacios (pamanes@gmail.com)
Prerequisite : PowerShell V3+,
Minimum Execution policy: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
@pamanes
pamanes / dashboard-ingress.yaml
Created December 27, 2023 23:07
dashboard-ingress (2023)
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: dashboard-ingress
namespace: kubernetes-dashboard
spec:
rules:
- host: dashboard.com
http:
paths:
@pamanes
pamanes / AzureBuildPipelineSendEmail.ps1
Created July 10, 2023 17:05
Azure PowerShell Task for Build Pipeline E-Mail Send
# Required variables
$env:SYSTEM_ACCESSTOKEN
$env:SYSTEM_TEAMFOUNDATIONSERVERURI
$env:SYSTEM_TEAMPROJECTID
$env:SYSTEM_TEAMPROJECT
$workItemId = YOUR_WORK_ITEM_ID_HERE
$output = "BODY OF EMAIL HERE"
# Derived variables
$adoHeader = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$env:SYSTEM_ACCESSTOKEN")) }
$organization = ($env:SYSTEM_TEAMFOUNDATIONSERVERURI -split "/")[3]
@pamanes
pamanes / Program.cs
Created October 11, 2018 20:31
Dan Kaminsky's DefCon RNG challenge 12 numbers at the same time in C#
//Created by: Alejandro Palacios (pamanes@gmail.com)
//12 threads get a random number at the "same time" based on Dan Kaminsky's DefCon RNG challenge
using System;
using System.Text;
using System.Threading;
namespace entropy
{
class Program
{
@pamanes
pamanes / SQLDataLayer.cs
Last active April 6, 2018 21:17
This is a C# ADO.NET Data Layer for easy communication with SQL Server, it can also be adapted to other ADO.NET-compatible database systems like MySQL, Oracle, SQLite, etc.
using System;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Threading.Tasks;
#region Update history
//Created by: Alejandro Palacios (pamanes@gmail.com)