Skip to content

Instantly share code, notes, and snippets.

View prongbang's full-sized avatar
🏠
Working from home

prongbang prongbang

🏠
Working from home
View GitHub Profile
@prongbang
prongbang / README.md
Last active September 7, 2024 03:59 — forked from ricardo-dlc/README.md
Update Jenkins Inside a Docker Container

First identify your image.

$ docker ps --format "{{.ID}}: {{.Image}} {{.Names}}"
3d2fb2ab2ca5: jenkins-docker jenkins-docker_1

Then login into the image as root.

$ docker container exec -u 0 -it jenkins-docker_1 /bin/bash
use flate2::write::GzEncoder;
use flate2::Compression;
use log::info;
use std::fs::File;
use std::io::{copy, Error};
use std::io::BufReader;
use std::time::Instant;
use std::fs::File;
use std::io::{BufReader, Cursor, Read, Write};
use flate2::Compression;

Fix: Unable to connect to the server: x509: certificate has expired or is not yet valid:

Certificate expired

sudo microk8s.refresh-certs -c
The CA certificate will expire in 3649 days.
use std::path::Path;
use turbojpeg::image::EncodableLayout;
use crate::api::convert;
pub async fn compress(image_path: String) -> Result<Vec<u8>, anyhow::Error> {
let path = Path::new(image_path.as_str());
let ext = path.extension().and_then(|ext| ext.to_str()).unwrap_or("");
let jpeg_data: Vec<u8>;
if ext != "jpg" && ext != "jpeg" {
import 'package:google_api_availability/google_api_availability.dart';
enum ServicesAvailability {
success,
serviceMissing,
serviceUpdating,
serviceVersionUpdateRequired,
serviceDisabled,
serviceInvalid,
notAvailableOnPlatform,
# Using Namespaces
https://docs.rafay.co/learn/quickstart/kubernetes/namespaces/
- List Namespace
```shell
microk8s kubectl get namespaces
```
# Create a MicroK8s cluster
https://microk8s.io/docs/clustering
## Example
- Adding a node
```shell
microk8s add-node
package tokenx
import (
"encoding/hex"
"github.com/go-jose/go-jose/v4"
"github.com/goccy/go-json"
)
type JWXToken Token
void disableScreenRecording({bool enabled = false}) async {
// Get the Android device.
final device = await FlutterDevice.current;
// Run the "adb shell settings put secure allow_screen_captures" command.
final result = await device.run('adb', [
'shell',
'settings',
'put',
'secure',