Skip to content

Instantly share code, notes, and snippets.

View karabasosman's full-sized avatar
☁️

Osman Seckin Karabas karabasosman

☁️
View GitHub Profile
@karabasosman
karabasosman / invite.py
Created June 3, 2024 09:59
Bulk invite people to GitHub organization from CSV file
import requests
import time
import csv
import pandas as pd
# Your personal access token
token = "<PERSONAL_ACCESS_TOKEN>"
# Your GitHub organization name
org = "<ORGANIZATION-NAME>"
#!/bin/bash
echo "[CUSTOM STARTUP SCRIPT] Fixing trailing slash issue by adapting Nginx configuration file"
replace="server {"
replaceWith="server { absolute_redirect off;"
sed -i "s/${replace}/${replaceWith}/g" /etc/nginx/sites-available/default
echo "[CUSTOM STARTUP SCRIPT] Reloading nginx to apply new configuration"
service nginx reload
@karabasosman
karabasosman / Program.cs
Created August 3, 2021 13:58
Purging Azure CDN
using Microsoft.Azure.Management.Fluent;
using Microsoft.Azure.Management.ResourceManager.Fluent;
using Microsoft.Azure.Management.ResourceManager.Fluent.Authentication;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
#r "Microsoft.WindowsAzure.Storage"
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using System.Net;
using System.Net.Http.Headers;
using static Microsoft.Extensions.Logging.ILogger;
@karabasosman
karabasosman / RegisterSqlVMs.psm1
Created January 3, 2020 06:14
Registration of SQL Server VMs on Azure
#Requires -Module Az.Compute
#Requires -Module Az.Accounts
#Requires -Module Az.SqlVirtualMachine
#Requires -Module Az.Resources
#Requires -Module Microsoft.PowerShell.Security
<#
.SYNOPSIS
Register all Azure VM running SQL Server on Windows with SQL VM Resource provider.
@karabasosman
karabasosman / CreateSPNforVSTS.ps1
Last active March 26, 2017 10:48
Creating SPN for VSTS/TFS
param
(
[Parameter(Mandatory=$true, HelpMessage="Enter Azure Subscription id. You need to be Subscription Admin to execute the script")]
[string] $subscriptionId,
[Parameter(Mandatory=$true, HelpMessage="Provide a password for SPN application that you would create")]
[securestring] $passwordparam,
[Parameter(Mandatory=$false, HelpMessage="Provide a SPN role definition")]
[string] $spnRole = "owner"
@karabasosman
karabasosman / common-session
Last active August 12, 2016 13:18
Varnish configuration
#
# /etc/pam.d/common-session - session-related modules common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of modules that define tasks to be performed
# at the start and end of sessions of *any* kind (both interactive and
# non-interactive).
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any