Client Usage
Not logged in

Basic Usage

Send text to an agglutino server using netcat:

echo just testing! | nc example.com 9999
cat file.txt | nc example.com 9999
ls -la | nc localhost 9999

The server will respond with a URL:

http://example.com/ydxhg982

Aliases

Pure-Bash Alternative

Linux/macOS:

alias tb="(exec 3<>/dev/tcp/example.com/9999; cat >&3; cat <&3; exec 3<&-)"

echo less typing now! | tb

tb Alias

Linux (Bash):

echo 'alias tb="nc example.com 9999"' >> .bashrc

macOS:

echo 'alias tb="nc example.com 9999"' >> .bash_profile

Copy to Clipboard

Linux (Bash):

echo 'alias tbc="nc example.com 9999 | xclip -selection c"' >> .bashrc

macOS:

echo 'alias tbc="nc example.com 9999 | pbcopy"' >> .bash_profile

Remember to reload the shell with source ~/.bashrc or source ~/.bash_profile.

Requirements

Netcat (nc) is required. You probably already have it - try typing nc or netcat into your terminal.


Server Usage

Installation

fossil clone https://code.lewman.com/agglutino/ agglutino.fossil
mkdir agglutino && cd agglutino
fossil open ../agglutino.fossil
make
sudo make install

Compiler Options

By default, agglutino uses Clang for better C23 support and diagnostics.

make           # Build with Clang (default)
make gcc       # Build with GCC
make CC=gcc    # Build with any compiler

Command Line Options

usage: agglutino [-SLpsBoul]
             [-S] [-L listen_addr] [-p port] [-s slug size]
             [-d domain] [-o output directory] [-B buffer size]
             [-u user name] [-l log file]

Options

Option Description Default
-d Domain prefix for URLs localhost
-L Listen address (IPv4/IPv6) All interfaces
-p TCP port 9999
-s Slug length (1-64) 8
-S Use HTTPS instead of HTTP -
-o Output directory path ./code
-B Buffer size in bytes (1KB-128KB) 32768
-u User to run as (requires root) -
-l Log file path -

Examples

Basic usage:

agglutino -o /var/www/pastes

With domain and HTTPS:

agglutino -d paste.example.com -S -o /var/www/pastes

Listen on specific address:

agglutino -L 127.0.0.1 -p 8080

Run as different user:

sudo agglutino -u www -o /var/www/pastes

Running as a Service

OpenBSD (rcctl)

Copy the rc.d script and enable the service:

sudo cp openbsd/agglutino.rc /etc/rc.d/agglutino
sudo chmod 755 /etc/rc.d/agglutino
sudo rcctl enable agglutino
sudo rcctl set agglutino flags "-d paste.example.com -o /var/www/pastes -u _agglutino"
sudo rcctl start agglutino

Management commands:

rcctl check agglutino      # Check status
rcctl start agglutino      # Start service
rcctl stop agglutino       # Stop service
rcctl restart agglutino    # Restart service

See openbsd/README.OpenBSD for complete setup instructions.

systemd (Linux)

Copy the systemd service file and enable it:

sudo cp scripts/systemd/agglutino.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable agglutino
sudo systemctl start agglutino

Management commands:

systemctl status agglutino      # Check status
systemctl start agglutino       # Start service
systemctl stop agglutino        # Stop service
systemctl restart agglutino     # Restart service
journalctl -u agglutino -f      # View logs

See scripts/systemd/systemd.md for complete setup instructions including:

FreeBSD (rc.d)

Copy the rc.d script and enable the service:

sudo cp scripts/freebsd/agglutino /usr/local/etc/rc.d/
sudo chmod 755 /usr/local/etc/rc.d/agglutino
sudo sysrc agglutino_enable="YES"
sudo sysrc agglutino_flags="-d paste.example.com -o /var/db/agglutino/pastes -u agglutino"
sudo service agglutino start

Management commands:

service agglutino status        # Check status
service agglutino start         # Start service
service agglutino stop          # Stop service
service agglutino restart       # Restart service

See scripts/freebsd/freebsd.md for complete setup instructions including:

OpenRC (Gentoo, Alpine, Artix)

Copy the OpenRC init script and create configuration:

sudo cp scripts/openrc/agglutino /etc/init.d/
sudo chmod 755 /etc/init.d/agglutino

# Create configuration
sudo tee /etc/conf.d/agglutino << 'EOF'
agg_user="agglutino"
agg_group="agglutino"
agg_flags="-d paste.example.com -o /var/lib/agglutino/pastes -u agglutino"
EOF

sudo rc-update add agglutino default
sudo rc-service agglutino start

Management commands:

rc-service agglutino status       # Check status
rc-service agglutino start        # Start service
rc-service agglutino stop         # Stop service
rc-service agglutino restart      # Restart service

See scripts/openrc/openrc.md for complete setup instructions including:

Note: In service mode, you must set the output directory with -o.

Web Server Configuration

agglutino has no built-in HTTP server. You need a separate web server to serve the pastes.

OpenBSD httpd

server "example.com" {
    listen on * tls port 443
    root "/htdocs"

    location "/txt/*" {
        directory { index index.txt }
    }
}

nginx

server {
    listen 80;
    server_name mysite.com;
    charset utf-8;

    location / {
        root /home/www/code/;
        index index.txt index.html;
    }
}

Demo Server

Try agglutino without installing:

echo hello | nc agglutino.zw.is 9999

https://agglutino.zw.is