Skip to content

Instantly share code, notes, and snippets.

View dbrrt's full-sized avatar
🚲

David Barrat dbrrt

🚲
View GitHub Profile
from fs.sshfs import SSHFS
host = '192.168.1.10'
remote_path = '/home/jovyan/dev/test-fs-sshfs/requirements.txt'
remote_fs = SSHFS(
host, user='david', passwd='test', pkey=None, timeout=10, port=22,
keepalive=10, compress=False, config_path='~/.ssh/config'
)
@dbrrt
dbrrt / clean-instance-ocp.sh
Created November 6, 2020 09:43
will clean everything related a to an OCP instance knowing the service name
SERVICE_NAME=$1
PROJECT=myproject
oc delete bc $SERVICE_NAME -n $PROJECT
oc delete dc $SERVICE_NAME -n $PROJECT
oc delete svc $SERVICE_NAME -n $PROJECT
oc delete route $SERVICE_NAME -n $PROJECT
import React, { useEffect, useState } from "react";
import { makeStyles } from "@material-ui/core/styles";
import Table from "@material-ui/core/Table";
import TableBody from "@material-ui/core/TableBody";
import TableCell from "@material-ui/core/TableCell";
import TableContainer from "@material-ui/core/TableContainer";
import TableHead from "@material-ui/core/TableHead";
import TableRow from "@material-ui/core/TableRow";
import Paper from "@material-ui/core/Paper";
@dbrrt
dbrrt / handler.js
Created September 23, 2021 15:02 — forked from adieuadieu/handler.js
AWS Elasticsearch Cluster with Serverless Framework
const aws4 = require('aws4')
const fetch = require('node-fetch')
const host = process.env.ELASTICSEARCH_ENDPOINT
module.exports.default = async function handler(event, context) {
const indexName = 'example'
const options = aws4.sign({
host,
@dbrrt
dbrrt / build.js
Created September 26, 2021 15:17 — forked from adieuadieu/build.js
Using esbuild in your Serverless Framework Project
const fs = require('fs')
const cloudformationSchema = require('@serverless/utils/cloudformation-schema')
const esbuild = require('esbuild')
const yaml = require('js-yaml')
const rimraf = require('rimraf')
const SERVERLESS_YML_PATH = './serverless.yml'
const OUT_DIR = './dist'
// ref: https://esbuild.github.io/api/#simple-options
@dbrrt
dbrrt / endeavour-keyring-update.sh
Created November 3, 2021 16:20
Update EndeavourOS keyring
wget https://mirror.alpix.eu/endeavouros/repo/endeavouros/x86_64/endeavouros-keyring-<VERSION>-any.pkg.tar.xz
sudo pacman -U endeavouros-keyring-<VERSION>-any.pkg.tar.xz
@dbrrt
dbrrt / AAA README.md
Created November 27, 2021 14:02 — forked from owulveryck/AAA README.md
Generateur de QR Code tous anti covid

go run . &gt; output.png

@dbrrt
dbrrt / keybase.md
Created December 20, 2021 09:10
Keybase verify

Keybase proof

I hereby claim:

  • I am dbrrt on github.
  • I am dbrrt (https://keybase.io/dbrrt) on keybase.
  • I have a public key ASBVPUG-CDs4y49m2HcrX-4iG96JXjPdUYLYrH_GK0k1Qwo

To claim this, I am signing this object:

@dbrrt
dbrrt / gist:0b45166ca921427cc13c398a71df2a8c
Last active March 2, 2022 22:57
Fix Logon WSL2 / Windows 10
https://github.com/microsoft/WSL/issues/5401
- "The user has not been granted the requested logon type at this computer"
Type `gpupdate /force` in a shell.
Then reboot.
The error shouldn't appear anymore.
@dbrrt
dbrrt / vercel-wrapper.ts
Created March 24, 2022 22:30
Wrap a serverless event to a vercel request event
import type { VercelRequest, VercelResponse } from "@vercel/node";
export const vercelWrapper =
(handler_: Function) => async (req: VercelRequest, res: VercelResponse) => {
const { statusCode, body } = await handler_(req);
res.status(statusCode).json(JSON.parse(body));
};