Skip to content

Instantly share code, notes, and snippets.

View simonjcarr's full-sized avatar

Simon Carr simonjcarr

  • Gravity Software
  • Preston, Lancashire
View GitHub Profile
@simonjcarr
simonjcarr / microk8s_in_lxc.md
Created December 5, 2021 10:50 — 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
<template>
<input
type="text"
placeholder="Enter todo and hit enter"
class="border-orange-300 border-2 w-full p-2 rounded"
v-model="todoTitle"
@keyup.enter="addToDo"
>
<div class="mt-4">
<div v-for="(todo, index) in todos" :key="index" class="flex border-gray-300 border-b-2 mb-2 p-1">
<template>
<div class="bg-orange-500 h-24 shadow">
<div class="text-3xl text-white p-8">ToDo's</div>
</div>
<div class="p-8">
<ToDo />
</div>
</template>
<script>
<template>
<input
type="text"
placeholder="Enter todo and hit enter"
class="border-orange-300 border-2 w-full p-2 rounded"
v-model="todoTitle"
@keyup.enter="addToDo"
>
<div class="mt-4">
<div v-for="(todo, index) in todos" :key="index" class="flex border-gray-300 border-b-2 mb-2 p-1">
@simonjcarr
simonjcarr / assign.js
Last active October 30, 2020 18:12
javascript_objects
let objA = { a: 1, b: 2, c: 3 }
let objB = { a: "X", d: "Y" }
let objC = Object.assign(objA, objB)
console.log("objA:- ", objA)
console.log('objB:- ', objB);
console.log('objC:- ', objC);
@simonjcarr
simonjcarr / data.json
Last active October 29, 2020 14:32
findFilterArrayData
[
{
"id": 1,
"name": "Joe Bloggs"
},
{
"id": 2,
"name": "Jane Doe"
},
{
@simonjcarr
simonjcarr / docker-compose.yml
Created October 25, 2020 13:27
keycloak proxy env variables in docker-compose.yaml
version: '2'
volumes:
postgres_data:
driver: local
services:
postgres:
image: postgres
volumes:
@simonjcarr
simonjcarr / index.js
Created October 24, 2020 19:57
async-await_promise_correct
function getMessages() {
return newPromise((resolve, reject) => {
(async () => {
try {
let results = await db.query('select * from messages');
return resolve(results);
} catch (err) {
return reject(err);
}
})()
@simonjcarr
simonjcarr / index.js
Created October 24, 2020 19:49
async/await promise anti-pattern
function getMessages() {
return newPromise(async (resolve, reject) => {
try {
let results = await db.query("select * from messages")
return resolve(results)
} catch (err) {
return reject(err)
}
})
}
'use strict'
/** @type {import('@adonisjs/lucid/src/Schema')} */
const Schema = use('Schema')
class UserSchema extends Schema {
up () {
this.create('users', (table) => {
table.increments()
table.string('username', 80).notNullable().unique()