Skip to content

Instantly share code, notes, and snippets.

@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"
@ravecat
ravecat / README.md
Last active May 4, 2024 01:18
debootstrap, livecd

A live CD or live DVD is a complete bootable Linux operating system loaded from a CD or DVD. Although there are a lots of live Linux CDs, for seemingly every taste and purpose, it might still be useful on occasion to build your own. This guide details the steps to build a bootable live CD/DVD based on Debian “wheezy”.

Step 1 – Installing the necessary software

These are the software packages you need to install on your Debian system:

apt-get install xorriso live-build syslinux squashfs-tools

Step 2 – Create a basic filesystem

@joaovictorino
joaovictorino / entendendo processos em contêineres Docker.md
Last active May 4, 2024 01:16
entendendo processos em contêineres Docker

Entendendo processos em contêineres Docker

Agora vamos visualizar os processos dentro de contêineres Docker, rode o comando abaixo

docker run -d nginx

Quando contêiner nginx estiver rodando, execute este outro comando e perceba que o nginx criou vários PIDs (process ids) dentro do contêiner para que o servidor web funcione

@joaovictorino
joaovictorino / trabalhando com estados de contêineres Docker.md
Last active May 4, 2024 01:16
trabalhando com estados de contêineres Docker

Trabalhando com estados de contêineres Docker

Com o comando abaixo baixamos uma imagem do Docker Hub para a máquina local

docker pull alpine

Crie o contêiner e deixe-o pronto para execução

@pastleo
pastleo / nm_l2tp_ipsec_vpn.md
Last active May 4, 2024 01:12
setup L2TP IPSEC VPN in archlinux using NetworkManager
@ynagatomo
ynagatomo / Extension+ModelComponent.swift
Created April 29, 2024 11:48
An extension of ModelComponent, to dump its MeshResource.Model such as positions and normals.
extension ModelComponent {
/// Dump the MeshResource.Model
func dumpMeshResourceModel() {
let printSIMD3Float = { (value: SIMD3<Float>) in
print("(\(value.x), \(value.y), \(value.z)), ", terminator: "")
}
let printSIMD2Float = { (value: SIMD2<Float>) in
print("(\(value.x), \(value.y)), ", terminator: "")
}
@matsen
matsen / svg2tiff
Created December 12, 2012 01:05
A script to convert SVG to a TIFF acceptable to PLOS
#!/bin/sh
# Convert all arguments (assumed SVG) to a TIFF acceptable to PLOS
# Requires Inkscape and ImageMagick 6.8 (doesn't work with 6.6.9)
for i in $@; do
BN=$(basename $i .svg)
inkscape --without-gui --export-png="$BN.png" --export-dpi 300 $i
convert -compress LZW -alpha remove $BN.png $BN.tiff
mogrify -alpha off $BN.tiff
// build: gcc amdgpustats.c -o amdgpustats `pkg-config --cflags --libs libdrm`
// Requires Linux 4.12 or later, and libdrm 2.4.77 or later
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
@adrianhajdin
adrianhajdin / .eslintrc.cjs
Last active May 4, 2024 01:06
Tailwind CSS Full Course 2023 | Build and Deploy a Nike Website
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],