Skip to content

Instantly share code, notes, and snippets.

View luiseduardobrito's full-sized avatar

Luis Eduardo Brito luiseduardobrito

  • São Paulo, Brazil
View GitHub Profile
@casperghst42
casperghst42 / create-cloud-init.sh
Last active April 12, 2025 16:21
Create a cloud-init Debian 12 image on proxmox
#!/bin/bash
# Author: Casper Pedersen (github.com/casperghst42)
# License: GPL2
wget https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2
virt-customize -a debian-12-generic-amd64.qcow2 --install qemu-guest-agent --install resolvconf --install systemd-resolved --update --run-command 'mkdir -p /etc/network/interfaces.d' --run-command 'echo "auto ens18" >> /etc/network/interfaces.d/ens18' --run-command 'echo "iface ens18 inet manual" >> /etc/network/interfaces.d/ens18'
qm create 100000 --name "debian12-cloudinit-template" --memory 2048 --net0 virtio,bridge=vmbr0
qm importdisk 100000 debian-12-generic-amd64.qcow2 local-lvm -format qcow2
<html>
<head>
<title>LYWSD02 Clock sync</title>
<meta name="viewport" content="width=480">
</head>
<body >
<h1>LYWSD02 Clock sync </h1>
<h2>Xiaomi Mijia BT4.0 Wireless Smart Electric Digital Clock Indoor & Outdoor Hygrometer Thermometer</h2>
@andelf
andelf / main.rs
Created May 14, 2020 10:31
Embed Deno in Rust
use deno_core::Op;
use deno_core::ZeroCopyBuf;
use deno_core::{CoreIsolate, StartupData};
use std::str;
fn main() {
println!("v8 version: {}", deno_core::v8_version());
let mut isolate = CoreIsolate::new(StartupData::None, false);
@erickrf
erickrf / json2txt.py
Created August 19, 2019 21:04
Script to join text from JSON files for training GPT-2
import json
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('input_dir', help='Directory with wiki json files')
parser.add_argument('output', help='Txt file output')
args = parser.parse_args()
for filename in os.listdir(args.input_dir):
@CMCDragonkai
CMCDragonkai / exporting_modules_functions_from_python_init.md
Last active January 6, 2025 19:05
Exporting Modules and Functions from Python `__init__.py` #python

Exporting Modules and Functions from Python __init__.py

Any directory with __init__.py is considered a package in Python.

Any python files inside a package is considered a module.

Modules contain functions and other bindings that is always exported.

If you are outside the package, and you want to import a module from a package:

kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@harshavardhana
harshavardhana / nginx-minio-static.md
Last active April 19, 2025 23:56 — forked from koolhead17/gist:4b8dd8d95ec86368634693cf9ad9391c
How to configure static website using Nginx with MinIO ?

How to configure static website using Nginx with MinIO ?

1. Install nginx

2. Install minio

3. Install mc client

4. Create a bucket:

$ mc mb myminio/static
Bucket created successfully ‘myminio/static’.
@mgoellnitz
mgoellnitz / snip.sh
Last active January 4, 2024 17:57
GitLab Snippet Command Line Tool
#!/bin/bash
#
# Copyright 2016-2021 Martin Goellnitz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@dtygel
dtygel / CircleTransform.java
Last active June 18, 2017 18:37 — forked from julianshen/CircleTransform.java
CircleTransform for Picasso
/*
* Copyright 2014 Julian Shen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software