Skip to content

Instantly share code, notes, and snippets.

@cmatskas
cmatskas / polly_python.py
Created November 15, 2023 00:13
amazon_polly_python
import boto3
import os
audiofile = 'speech.mp3'
polly_client = boto3.client('polly')
response = polly_client.synthesize_speech(VoiceId='Joanna',
OutputFormat='mp3',
Text = 'This is a sample text to be synthesized.',
Engine = 'neural')

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@cmatskas
cmatskas / scanIPs.ps1
Created May 5, 2022 16:10
Scan All IP Addresses on Internal Network
1..254 | ForEach-Object {
if(!(Test-Connection 192.168.153.$_ -count 1 -Quiet)) {
Write-Output "IP Address Available 192.168.153.$_"
}
else {
Write-Output "IP Address in use 192.168.153.$_"
}
}
@cmatskas
cmatskas / PowerShell
Last active March 16, 2022 23:40
PS Script to Install fonts
echo "Install Custom fonts"
$fonts = (New-Object -ComObject Shell.Application).Namespace(0x14)
foreach ($file in gci *.ttf)
{
$fileName = $file.Name
if (-not(Test-Path -Path "C:\Windows\fonts\$fileName" )) {
echo $fileName
dir $file | %{ $fonts.CopyHere($_.fullname) }
}
}
@cmatskas
cmatskas / p4merge.md
Created June 3, 2021 18:08
Set up p4merge as the default merge and diff tool in Git

Assuming that P4Merge was installed in the default location on Windows, i.e 'C:\Program Files\Perforce\p4merge.exe' then the following commands will configure p4merge as the default tool for both merge and diffs in Git

Set up commands

$ git config --global diff.tool p4merge
$ git config --global difftool.p4merge.path 'C:\Program Files\Perforce\p4merge.exe'
$ git config --global merge.tool p4merge
$ git config --global mergetool.p4merge.path 'C:\Program Files\Perforce\p4merge.exe'
using System.Collections.Concurrent;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Identity.Web;
using Microsoft.Identity.Web.Resource;
using Microsoft.Identity.Web.TokenCacheProviders.InMemory;
using System.Collections.Concurrent;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
namespace testFeather
{
class Program
{
private static ConcurrentBag<TodoItem> todoItemCollection;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
namespace testFeather
{
class Program
{
static async Task Main(string[] args)
{
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Azure.KeyVault;
using Microsoft.Azure.Services.AppAuthentication;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.AzureKeyVault;
namespace demo
{
public class Program
@page
@model EasyAuthDemo.Pages.ClaimsModel
<div class="row">
<div class="col-md-12">
<table class="table table-responsive table-striped">
@if (HttpContext.User.Identity.IsAuthenticated)
{
foreach (var c in Model.UserClaims)
{