Skip to content

Instantly share code, notes, and snippets.

View RileySeaburg's full-sized avatar
🎯
Focusing

Riley Seaburg RileySeaburg

🎯
Focusing
View GitHub Profile
@RileySeaburg
RileySeaburg / install-postgres-ubuntu-22-04.sh
Last active July 2, 2023 13:51
Install Postgres on Ubuntu
#!/bin/sh
# Get database name from user
read -p "Enter database name: " dbname
# Prompt user for the password for the default PostgreSQL user (postgres)
read -s -p "Enter password for the default PostgreSQL user (postgres): " password
echo
# Update package lists
@RileySeaburg
RileySeaburg / install-nginx-ubuntu.sh
Last active November 23, 2022 09:22
Install and configure nginx completely from source and create systemd service.
#!/bin/bash
# PCRE version 10.40
wget https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.40/pcre2-10.40.tar.gz && tar xzvf pcre2-10.40.tar.gz
# zlib version 1.2.13
wget https://www.zlib.net/zlib-1.2.13.tar.gz && tar xzvf zlib-1.2.13.tar.gz
# OpenSSL version 1.1.0h
wget https://www.openssl.org/source/openssl-1.1.0h.tar.gz && tar xzvf openssl-1.1.0h.tar.gz
sudo add-apt-repository -y ppa:maxmind/ppa
@RileySeaburg
RileySeaburg / install_docker_ubuntu_22_04.sh
Created August 20, 2022 13:51
Install Docker on Ubuntu 22.04
# Shell script to install docker on Ubuntu 22.04
#!/bin/bash
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
@RileySeaburg
RileySeaburg / gettter.dart
Last active August 12, 2022 07:13
Dart Stream Getters
import 'dart:async';
/// Demontrates how to conviently access stream data with Getters.
void main() {
final bloc = Bloc();
/// Manually update from stream
// bloc.emailController.sink.add("my new email");
/// Listen for the email to change and print the value.
@RileySeaburg
RileySeaburg / index.html
Last active August 12, 2022 04:47
Validate User Input Using Streams in Dart
<form>
<h4>Guess the Word<h4>
<input/>
<button>Guess</button>
<div id="error" ></div>
</form>
@RileySeaburg
RileySeaburg / index.html
Created August 12, 2022 04:28
Dart Print Form Input
<form>
<h4>Guess the Word<h4>
<input/>
<button>Guess</button>
<div id="error" ></div>
</form>
@RileySeaburg
RileySeaburg / index.html
Created August 12, 2022 04:10
Stream 'Take' and 'Where' Functions in Dart
<form>
<h4>Guess the Word<h4>
<input/>
<button>Guess</button>
</form>
@RileySeaburg
RileySeaburg / stream.dart
Created August 11, 2022 20:16
Dart Streams Example with a Cake Factory
import 'dart:async';
class Cake {}
class Order {
String type;
Order(this.type);
}
void main() {
# Copyright (c) 2022 Evolving Software Corporation
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
#!/bin/sh
sudo apt-get install lld clang
cargo install cargo-watch
RUST_BACKTRACE=1 RUST_LOG=actix_web=debug cargo watch -x check -x test -x clippy -x fmt -x run
@RileySeaburg
RileySeaburg / Rust-Dockerfile
Last active July 6, 2022 13:11
A file for creating a docker image with Rust and it's build tools.
# Using Ubuntu 22.04 as the base image for the container.
FROM ubuntu:22.04
# Make sure it works.
CMD echo "Welcome to this Docker server. This application 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"
# Update ubuntu
RUN apt-get update
# Install dependencies
RUN apt-get install -y \