Skip to content

Instantly share code, notes, and snippets.

View sukesh-ak's full-sized avatar

Sukesh Ashok Kumar sukesh-ak

View GitHub Profile
@williamoconnorme
williamoconnorme / Configure-ServiceFabricAuth.ps1
Last active February 24, 2025 18:35
This script will allow you to use DefaultAzureCredential locally with your service fabric cluster. It uses PsExec to login the NETWORK SERVICE Account using the AZ CLI. This caches the token credential for the service account
<#
.SYNOPSIS
This script will authenticate via Azure CLI and store an auth token in the SYSTEM user profile to enable the Azure.Identity library to authenticate with Azure services.
.DESCRIPTION
The script uses Azure CLI to authenticate and retrieve an authentication token. This token is then stored in the SYSTEM user profile, allowing the Azure.Identity library to use it for authenticating with various Azure services. This is useful for scenarios where services running under the SYSTEM account need to access Azure resources.
.PARAMETER None
This script does not take any parameters.
@Alexufo
Alexufo / simple-https-python-server.py
Last active November 20, 2024 23:23
Simple Python https server example py 3.10+ ( multithread, wasm, gzip )
import http.server
import http.cookiejar
import io
import socket
from http import HTTPStatus
import ssl
import os
import zlib
server_address = ('0.0.0.0', 4443)
@edwardstock
edwardstock / aes256.cpp
Created November 8, 2020 15:41
C++ OpenSSL AES256 encryption
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <memory>
#include <stdexcept>
#include <cstring>
#include <openssl/aes.h>
#include <openssl/err.h>
@gregyjames
gregyjames / main.cpp
Created August 19, 2020 20:28
Embed Python in C++
#include <iostream>
#include "Python.h"
int main()
{
//Initialize the python instance
Py_Initialize();
//Run a simple string
PyRun_SimpleString("from time import time,ctime\n"
@acj
acj / microk8s_in_lxc.md
Last active March 17, 2025 08:22
Installing microk8s in an LXC container

Installing microk8s in an LXC container

I wanted to run Microk8s on a Proxmox 6 host inside of an LXC container. These are my notes from the journey.

  1. Create a privileged LXC container through the Proxmox web interface
  • Enable nesting and FUSE
    • In Proxmox UI, select container, then Options > Features > Check nesting and FUSE boxes
  1. SSH into the Proxmox host and edit the container's config in /etc/pve/lxc/.conf
    • Add the following lines
  • lxc.apparmor.profile: unconfined
@oldmonkABA
oldmonkABA / create-kiteconnect-candlestick-q.py
Last active August 1, 2024 05:32
Implementation of ticks to 1min and 15 mins candles in zerodha kiteconnect using python queues. This code is modified version of the code given in http://ezeetrading.in/Articles/Candles_formation_from_tick_data_zerodha.html. The difference is that in on_ticks functions the only action performed is that the ticks are place in a event queue. This …
################## Ticks to candles in kiteconnect python ####################
# Author : Arun B
# Reference : http://ezeetrading.in/Articles/Candles_formation_from_tick_data_zerodha.html
# Purpose : Convert ticks to candles by putting ticks in a queue. This redues time wasted in on_ticks function
################################################################################
from kiteconnect import KiteTicker
import datetime
from copy import copy
import queue
@jrgcubano
jrgcubano / posttweet.cs
Created August 11, 2016 06:58
Post tweet using C#
// From https://blog.dantup.com/2016/07/simplest-csharp-code-to-post-a-tweet-using-oauth/
/// <summary>
/// Simple class for sending tweets to Twitter using Single-user OAuth.
/// https://dev.twitter.com/oauth/overview/single-user
///
/// Get your access keys by creating an app at apps.twitter.com then visiting the
/// "Keys and Access Tokens" section for your app. They can be found under the
/// "Your Access Token" heading.
/// </summary>
@carolineschnapp
carolineschnapp / instructions.md
Created August 10, 2015 03:24
Add a Flexslider slideshow to any amount of regular pages in 3 easy steps. #slideshow #flexslider
  1. Add a bunch of images to a 'page'. Just images. No markup besides img elements.
  2. Create a page.lookbook template and in it, add the code below.
  3. Assign template to page.
@peterk87
peterk87 / interpolate_colors.cs
Created April 24, 2013 15:36
C#: Interpolate between 2 colors - 2 different approaches taken from StackOverflow.com
// Interpolate between 2 colors in C#
// Taken from answer by user Jason
// http://stackoverflow.com/questions/1236683/color-interpolation-between-3-colors-in-net
class ColorInterpolator {
delegate byte ComponentSelector(Color color);
static ComponentSelector _redSelector = color => color.R;
static ComponentSelector _greenSelector = color => color.G;
static ComponentSelector _blueSelector = color => color.B;
public static Color InterpolateBetween(