Skip to content

Instantly share code, notes, and snippets.

@HugoPoi
HugoPoi / Resize virtual machine partition.md
Last active May 4, 2024 01:46
How to resize virtual machine partition after extend the disk

Resize a VM system disk

Introduction

  • You have a VM with small disk
  • You have GPT partition table
  • You NOT USE LVM (you should)
  • You need to extend a partition on the main drive
  • You use Debian 8.x aka Jessie

Extend the disk

@mjkstra
mjkstra / arch_linux_installation_guide.md
Last active May 4, 2024 01:45
A modern, updated installation guide for Arch Linux with BTRFS on an UEFI system
@davidsteppenbeck
davidsteppenbeck / KeyframeView.swift
Created May 3, 2024 20:08
Keyframe Animation Example in SwiftUI
import SwiftUI
struct KeyframeValues {
var scale = 1.0
var horizontalStretch = 1.0
var verticalStretch = 1.0
var translation = 0.0
var rotation = Angle.zero
}
@joaovictorino
joaovictorino / isolamento de recursos no docker.md
Last active May 4, 2024 01:39
isolamento de recursos no docker

Isolamento de recursos no Docker

Vamos ver como funciona o isolamento de CPU e memória no Docker, execute o comando abaixo em uma janela do terminal

docker run -it ubuntu bash

Mantenha a janela do terminal com o comando acima aberto e abra outra janela de terminal, executando o comando abaixo

@joaovictorino
joaovictorino / volumes em contêineres Docker.md
Last active May 4, 2024 01:39
volumes em contêineres Docker

Volumes em contêineres Docker

Vamos testar alguns conceitos usando volumes. Crie uma pasta docker no drive C: (C:/docker), caso seja windows, ou uma pasta no sistema operacional que esteja usando, abra o terminal e execute o comando abaixo

docker run -it -v /c/docker:/app ubuntu bash

Agora dentro do contêiner ainda, execute o seguinte comando

@lohhans
lohhans / README-PTBR.md
Last active May 4, 2024 01:32 — forked from PurpleBooth/README-Template.md
Um modelo para fazer um bom README.md

Título do projeto

Um parágrafo da descrição do projeto vai aqui

🚀 Começando

Essas instruções permitirão que você obtenha uma cópia do projeto em operação na sua máquina local para fins de desenvolvimento e teste.

Consulte Implantação para saber como implantar o projeto.

@vkhorikov
vkhorikov / CustomerController.cs
Last active May 4, 2024 01:25
Handling failures and input errors in a functional way
[HttpPost]
public HttpResponseMessage CreateCustomer(string name, string billingInfo)
{
Result<BillingInfo> billingInfoResult = BillingInfo.Create(billingInfo);
Result<CustomerName> customerNameResult = CustomerName.Create(name);
return Result.Combine(billingInfoResult, customerNameResult)
.OnSuccess(() => _paymentGateway.ChargeCommission(billingInfoResult.Value))
.OnSuccess(() => new Customer(customerNameResult.Value))
.OnSuccess(
@varqox
varqox / install_debian_with_debootstrap_howto.md
Last active May 4, 2024 01:24
Instructions how to install Debian using debootstrap
@alucard001
alucard001 / Dockerfile
Last active May 4, 2024 01:19
Docker + Laravel + Nginx + Swoole Reverse Proxy Setup
FROM php_base:latest
RUN apt update -y && apt upgrade -y
WORKDIR /var/www/html
RUN composer update --optimize-autoloader
COPY src/. /var/www/html
COPY build/php/.env.local /var/www/html/.env
@gwenn
gwenn / go-sqlite3_database_is_locked.go
Last active May 4, 2024 01:19 — forked from mrnugget/go-sqlite3_database_is_locked.go
Program that tests the concurrency issues with go-sqlite3. This will create two tables: `products` and `users`. One goroutine will repeatedly read from the `products` table in N fresh goroutines. At the same time ONE goroutine writes to the other table.
package main
import (
"database/sql"
"fmt"
"log"
"math/rand"
"sync"
"time"