Skip to content

Instantly share code, notes, and snippets.

@mickael-kerjean
mickael-kerjean / dellosmaproxmox.sh
Last active March 4, 2024 10:51 — forked from jordantrizz/dellosmaproxmox.sh
Dell OSMA on Proxmox/Debian Buster
# Add Dell GPG key to apt
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 1285491434D8786F
echo "deb http://linux.dell.com/repo/community/openmanage/930/bionic bionic main" > /etc/apt/sources.list.d/linux.dell.com.sources.list
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman-curl-client-transport1_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman-client4_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman1_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman-server1_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/s/sblim-sfcc/libcimcclient0_2.2.8-0ubuntu2_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/openwsman_2.6.5-0ubuntu3_amd64.deb
@mickael-kerjean
mickael-kerjean / main.c
Created November 9, 2023 12:50
bench thumbnail
#include <stdio.h>
#include "image_png.h"
// gcc -o main.bin main.c image_png.c -lwebp -lpng
int main(int argc, char **argv) {
FILE* input = fopen("/home/mickael/Downloads/tmp/test.png", "rb");
FILE* output = fopen("/home/mickael/Downloads/tmp/test_c.webp", "wb");
return png_to_webp(fileno(input), fileno(output), 250);
}
#include <string.h>
#include <png.h>
#include <stdlib.h>
#include "webp/encode.h"
#include "utils.h"
static int filestash_png_writer(const uint8_t* data, size_t data_size, const WebPPicture* const pic) {
FILE* const out = (FILE*)pic->custom_ptr;
return data_size ? (fwrite(data, data_size, 1, out) == 1) : 1;
}
https://qantas-qfa-dummy.s3.ca-central-1.amazonaws.com/swagger-ui/index.html
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
aws s3 ls qantas-qfa-dummy/specs/ > /tmp/tmp.dat
cat /tmp/tmp.dat | sed 1d | awk '{printf $1"."$4"\n"}' | awk -F "." 'BEGIN{print "<style>a{text-decoration:none;font-family:monospace;font-size:1rem;}</style>"} {printf("<a href=\"%s.%s\">%s %s</a><hr>\n",$2,$3,$1, $2)}'
(require 'hydra)
(defun my/browser-open-at-point (&optional arg)
(interactive "P")
(let ((url (thing-at-point 'url)))
(xwidget-webkit-browse-url
(if url url (read-string "url: " "")))))
(defun my/browser-google (&optional arg)
(interactive "P")
export PS1="\[\033[1;34m\]\w\[\033[0;37m\] # \[\033[0m\]"
# https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/
# create relevant images and push them
docker build -t machines/filestash:latest-arm64v8 .
docker push machines/filestash:latest-arm64v8
docker build -t machines/filestash:latest-amd64 .
docker push machines/filestash:latest-amd64
@mickael-kerjean
mickael-kerjean / install_node.sh
Last active July 13, 2023 11:35
kubernetes install script
#!/bin/bash
set -e
# run like this:
# /bin/bash -c "$(curl -fsSL https://xxx)"
VERSION=1.27
########################
# docker stuff: https://kubernetes.io/docs/setup/production-environment/container-runtimes/
@mickael-kerjean
mickael-kerjean / sftp.go
Last active August 26, 2022 08:37
sftp
/*
* Build steps:
* 1. go generate -x ./index.go
* 2. go build -o sftp.bin index.go
*/
package main
import (
_ "embed"
"fmt"
@mickael-kerjean
mickael-kerjean / webdav.go
Last active May 10, 2022 19:16
minimal webdav server
// go mod init example.com && go get .
// CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o webdav.bin main.go
package main
import (
"fmt"
"github.com/google/go-webdav"
"github.com/google/go-webdav/memfs"
"net/http"