Skip to content

Instantly share code, notes, and snippets.

View snobu's full-sized avatar

Adrian Calinescu snobu

View GitHub Profile
@snobu
snobu / config.txt
Created March 29, 2018 09:21
Raspberry Pi 2560x1440@60Hz
hdmi_group=2
hdmi_mode=87
hdmi_cvt=2560 1440 60 3 0 0 1
max_framebuffer_width=2560
max_framebuffer_height=1440
hdmi_pixel_freq_limit=400000000
@snobu
snobu / gist:7dbee9a5fc43c6c664b73409bb2f7f88
Created February 28, 2020 20:01 — forked from UplandsDynamic/gist:8210e210f3cfab0200450db5a91c5ccc
Javascript (Typescript): Remove empty properties from object
deleteEmptyProps(obj: any): any {
// modifies passed obj in place, removing empty properties (inc. empty arrays)
return Object.keys(obj).forEach(k => {
if (!obj[k] || obj[k] === undefined ||
Array.isArray(obj[k]) && obj[k].length === 0) {
delete obj[k];
}
});
}
@snobu
snobu / WebApiConfig.cs
Created September 7, 2023 11:55
Dynamic CORS policy update for ASP.NET (.NET Framework)
using System;
using System.Configuration;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Cors;
using System.Web.Http;
using System.Web.Http.Cors;
using System.IO;
using Microsoft.Azure.Storage;
using Microsoft.Azure.Storage.Blob;
# apt-get install
sudo apt-get update
# For ubuntu 14.04
sudo apt-get install -y xserver-xorg-video-dummy-lts-trusty
# For ubuntu 16.04
sudo apt-get install -y xserver-xorg-video-dummy-lts-willy
# Copy the xorg.conf to `/etc/X11/xorg.conf`.
wget -P /etc/X11 https://gist.githubusercontent.com/mangoliou/ba126832f2fb8f86cc5b956355346038/raw/b6ad063711226fdd6413189ad905943750d64fd8/xorg.conf
@snobu
snobu / unified.html
Last active January 19, 2023 11:28
AAD B2C login template
<!DOCTYPE html>
<html>
<head>
<title>App Login</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
@snobu
snobu / get_latest_release_ver_from_GitHub.sh
Created September 8, 2022 13:38
Get latest release version for GitHub repo
curl -s https://api.github.com/repos/cert-manager/cert-manager/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'
@snobu
snobu / install.md
Last active May 6, 2022 08:45
Install Kubeflow on AKS (k8s v1.21.7)

Kubeflow on AKS - Project KFC

image

Deploy k8s cluster v1.21.7 or lower, but not lower than v1.20.

Clone the manifests repo -

$ git clone -b master https://github.com/kubeflow/manifests

Download and run kustomize v3. NOTE v4 won’t work with current (v1.5) Kubeflow.

@snobu
snobu / Notes.md
Created February 8, 2022 11:36
Kube Network Notes
  • Containers in a pod share namespaces among them.

  • Container-to-Container comms via localhost (because they share the same kernel namespace)

  • The 'pause' container (AKA infra container) is a container which holds the network namespace for the pod. Kubernetes creates pause containers to acquire the respective pod’s IP address and set up the network namespace for all other containers that join that pod. It has one job: DON'T DIE.

@snobu
snobu / Program.cs
Created December 13, 2021 12:42
Use Managed Identity to access Azure SQL
using System;
using System.Data.SqlClient;
using System.Threading.Tasks;
using Azure.Identity;
using Azure.Core;
namespace NET47ManagedIdentitytoAzureSQL
{
class MainClass
{
@snobu
snobu / temp_control.py
Last active October 25, 2021 17:06
PySimpleGUI Thermostat example
#!/usr/bin/env python3
import PySimpleGUI as sg
def read_temp1():
return 24.0
def read_temp2():
return 21.1