- Use supabase for database queries and schema
- Before performing any database related tasks, make sure to read the database.types.ts first for existing database schema
- Always use migrations to update the database schema, create them using the command
npx supabase migration new <migration-name> - Afer creating a migration file, run
npx supabase migration upto apply the migration and runnpx supabase gen types typescript --local > src/types/database.types.tsto generate the type file - When creating a new table, it must have columns for
created_atandupdated_atand the values should be set automatically via triggers usingpublic.handle_created_at()andpublic.handle_updated_at() - Always enable Row Level Security (RLS) on newly create tables via
ALTER TABLE <table_name> ENABLE ROW LEVEL SECURITY;in migration files and add reasonable policies - Always use
await createServerClient()in the@/utils/supabase/serverto create supabase client in server components and `createBrow
| FROM fedora:latest | |
| RUN dnf install -y tpm2-pkcs11 tpm2-pkcs11-tools tpm2-tools gnutls-utils openssl-pkcs11 nodejs | |
| VOLUME /etc/tpm2_pkcs11 | |
| VOLUME /root/test | |
| WORKDIR /root/test | |
| CMD bash |
Wrote for a joyful journey of Go.
package main
import (
"fmt"
)
func i64tob(val uint64) []byte {PlantUML is a really awesome way to create diagrams by writing code instead of drawing and dragging visual elements. Markdown is a really nice documentation tool.
Here's how I combine the two, to create docs with embedded diagrams.
Get the command-line PlantUML from the download page or your relevant package manager.
| """ | |
| A simple proxy server, based on original by gear11: | |
| https://gist.github.com/gear11/8006132 | |
| Modified from original to support both GET and POST, status code passthrough, header and form data passthrough. | |
| Usage: http://hostname:port/p/(URL to be proxied, minus protocol) | |
| For example: http://localhost:5000/p/www.google.com | |
| """ | |
| import re |
This mainly demonstrates my goal of preparing a Raspberry Pi to be provisioned prior to its first boot. To do this I have chosen to use the same cloud-init that is the standard for provisioning servers at Amazon EC2, Microsoft Azure, OpenStack, etc.
I found this to be quite challenging because there is little information available for using cloud-init without a cloud. So, this project also servers as a demonstration for anyone on any version of Linux who may want to install from source, and/or use without a cloud. If you fall into that later group, you probably just want to read the code. It's bash so everything I do, you could also do at the command line. (Even the for loop.)
We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.
Let’s create our table driven test, for convenience, I chose to use t.Log as the test function.
Notice that we don't have any assertion in this test, it is not needed to for the demonstration.
func TestTLog(t *testing.T) {
t.Parallel()For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.
After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft
| def getProjectName() { | |
| return 'JenkinsPipeline' | |
| } | |
| def getJDKVersion() { | |
| return 'jdk1.8.0_101' | |
| } | |
| def getMavenConfig() { | |
| return 'maven-config' |
The purpose of this short howto is to show you how to:
- use
openconnect[1] to connect to an enterprise cisco anyconnect endpoint - whilst minimizing the amount of traffic that your route through the vpn connection
Usually VPN administrators will puth the default route to the users, so that all user traffic is routed through the vpn connection. This is to address the various security concerns around compromised user computers bridging external internet traffic into the secure VPN network.
While the VPN administrator can push routes to the clients, the client can ignore these default routes and establish client side routing so that only the required A.B.C.D/E network is routed through the VPN. All other traffic will still use the clients default route and default outbound internet connection.