Skip to content

Instantly share code, notes, and snippets.

View sukesh-ak's full-sized avatar

Sukesh Ashok Kumar sukesh-ak

View GitHub Profile
@sukesh-ak
sukesh-ak / microk8s_in_lxc.md
Created August 10, 2023 09:34 — forked from acj/microk8s_in_lxc.md
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
// ******************************************************
// An example of the SimpleFusion library that combines
// accelerometer and gyroscope data quickly and easily.
//
// This example uses the mpu6050 6-dof IMU and the
// Adafruit library for it.
//
// Created in 2022 by Sean Boerhout under the MIT License
// ******************************************************
@sukesh-ak
sukesh-ak / aes256.cpp
Created June 1, 2022 18:43 — forked from edwardstock/aes256.cpp
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>
@sukesh-ak
sukesh-ak / sqlite_to_json.sql
Created May 30, 2022 09:10 — forked from akehrer/sqlite_to_json.sql
SQLite Results as JSON using the SQLite JSON1 extension
-- When SQLite is compiled with the JSON1 extensions it provides builtin tools
-- for manipulating JSON data stored in the database.
-- This is a gist showing SQLite return query data as a JSON object.
-- https://www.sqlite.org/json1.html
-- An example table with some data
CREATE TABLE users (
id INTEGER PRIMARY KEY NOT NULL,
full_name TEXT NOT NULL,
email TEXT NOT NULL,
@sukesh-ak
sukesh-ak / Socks5.cs
Created August 15, 2021 10:56 — forked from zHaytam/Socks5.cs
A Socks5 implementation in .NET Core (C# 8)
using System;
using System.Globalization;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace Socks
{
public static class Socks5
@sukesh-ak
sukesh-ak / notebook_launcher.py
Created August 11, 2021 10:13 — forked from timo/notebook_launcher.py
branded ipython notebook launcher
"""==============================
Branded IPython Notebook Launcher
=================================
Executing this module will create an overlay over ipython notebooks own static
files and templates and overrides static files and templates and copies over all
example notebooks into a temporary folder and launches the ipython notebook server.
You can use this to offer an interactive tutorial for your library/framework/...
@sukesh-ak
sukesh-ak / DefaultView.cs
Created August 29, 2020 16:06 — forked from dupuyjs/DefaultView.cs
Visual Layer - KeyFrame Animations
#region KeyFrame Animations
ScalarKeyFrameAnimation keyframeAnimation = _compositor.CreateScalarKeyFrameAnimation();
keyframeAnimation.InsertKeyFrame(0.0f, 0.0f); // Optional
keyframeAnimation.InsertKeyFrame(1.0f, 360.0f, _compositor.CreateLinearEasingFunction());
keyframeAnimation.Duration = TimeSpan.FromSeconds(3);
keyframeAnimation.IterationBehavior = AnimationIterationBehavior.Forever;
@sukesh-ak
sukesh-ak / interpolate_colors.cs
Created August 11, 2020 15:39 — forked from peterk87/interpolate_colors.cs
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(