Skip to content

Instantly share code, notes, and snippets.

system.activationScripts.applications.text = let
env = pkgs.buildEnv {
name = "system-applications";
paths = config.environment.systemPackages;
pathsToLink = "/Applications";
};
in
pkgs.lib.mkForce ''
# Set up applications.
echo "setting up /Applications..." >&2
@anishghimire862
anishghimire862 / brotli_nginx
Last active November 19, 2024 15:02
Enabling Brotli Compression on existing NGINX web server on Ubuntu 22.04
1) SSH into the server as a root user
2) Install the required dependencies. Run apt install cmake libpcre3 libpcre3-dev
3) Run wget "https://nginx.org/download/nginx-$(nginx -v 2>&1 | awk -F/ '{print $2}' | sed 's/(Ubuntu)//' | tr -d '[:space:]').tar.gz"
4) Run tar -xzf nginx-{{ version }}.tar.gz
5) Run git clone --recurse-submodules -j8 https://github.com/google/ngx_brotli
6) cd ngx_brotli/deps/brotli && mkdir out && cd out
7) Run cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_INSTALL_PREFIX=./installed ..
8) Run cmake --build . --config Release --target brotlienc
9) Run cd ~/nginx-{{ version }}
10) Run ./configure --add-module=/root/ngx_brotli
@mzarallo
mzarallo / .env.ci
Last active December 3, 2024 09:51
Github action to test your application in Laravel and deploy via SSH
APP_KEY=
APP_ENV=local
APP_DEBUG=true
APP_URL=http://127.0.0.1:8000
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
@juancsr
juancsr / mac-docker-withot-docker-destop.md
Last active April 23, 2025 17:06
Use docker in mac without docker-
@the-spyke
the-spyke / pipewire.md
Last active April 16, 2025 18:44
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Based on Debian Wiki, but simplified for Ubuntu 22.04.

@nginx-gists
nginx-gists / ubuntu_install.sh
Last active March 17, 2025 15:16
Automating Installation of WordPress with NGINX Unit on Ubuntu
#!/usr/bin/env bash
if [ "$EUID" -ne 0 ];then
>&2 echo "This script requires root level access to run"
exit 1
fi
if [ -z "${WORDPRESS_DB_PASSWORD}" ]; then
>&2 echo "WORDPRESS_DB_PASSWORD must be set"
>&2 echo "Here is a random one that you can paste:"
@oofnikj
oofnikj / answerfile
Last active April 22, 2025 09:28
Install Docker on Termux
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n alpine"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine
"
TIMEZONEOPTS="-z UTC"
@devops-school
devops-school / docker-volume-size-limit.txt
Created May 21, 2020 11:13
How to specify the size limit while creating the docker volume?
# docker -v
Docker version 19.03.9, build 9d988398e7
# docker volume create -h
Flag shorthand -h has been deprecated, please use --help
Usage: docker volume create [OPTIONS] [VOLUME]
Create a volume
@mjnaderi
mjnaderi / android_storage_ssh.md
Last active February 21, 2025 02:45
Access Android Storage Remotely using Termux and SSH