Skip to content

Instantly share code, notes, and snippets.

View rwcitek's full-sized avatar

Robert Citek rwcitek

View GitHub Profile
@rwcitek
rwcitek / haskell.docker.sh
Last active December 3, 2022 16:45
Installing haskell in an Ubuntu Docker container
# These commands were run using the bash shell on Debian 11 in the Linuv Dev Env on a Chromebook
# make sure no haskell instances exist
docker container stop haskell ; docker container rm haskell ; sleep 2
# run an Ubuntu container in the background
docker container run -d --name haskell ubuntu:22.04 sleep inf
# install utilities and haskell
<<'eof' docker container exec -i haskell /bin/bash

This file shows how one can configure a Docker instance to create a serverless function on Digital Ocean. Rather than running doctl auth init ... to set up a config.yaml file that holds the API token, the container exec command passes in an environment variable that contains the token. In that way, the container never has the token on persistent storage. That means the instance could be committed to an image without having credentials in the image. It also means the commands in the Here-Doc could be used as as a template to create a Dockerfile in the future.

From DO function docs

First, create a Personal Accesss Token ( PAT )

@rwcitek
rwcitek / build.dsub.docker.image.sh
Last active March 16, 2025 12:56
Build dsub Docker image
temp=$(date +%s)
cat <<'eof' > Dockerfile.${temp}
FROM ubuntu:24.04
ARG DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-c"]
# install the basics
RUN apt-get update && \
@rwcitek
rwcitek / slide-deck.existing.repo.sh
Created November 2, 2022 05:16
Creating a GH pages slide deck inside an existing repo
# This gist combines specific commits from two different repos: jekyll-and-slide and reveal.js
# - https://github.com/adamhollett/jekyll-and-slide
# - https://github.com/hakimel/reveal.js
# If there was a way to do this from the browser, this gist would be unnecessary.
# prerequisite: an existing repo in GitHub, no branch named "gh-pages", and note repo URL
REMOTE_URL='https://github.com/sluugdemogithub/demo03.git'
# create the URL for GitHub Pages
<<< "$REMOTE_URL" IFS='/' read scheme x host id repo
@rwcitek
rwcitek / dood.sh
Last active December 6, 2022 17:32
Docker out of Docker using Ubuntu 22.04
# adapted from: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04
## This allows a Docker container to connect to the Docker server on the host to manage Docker resources
# run a Docker instance in the background
docker container run \
--rm \
-v /var/run/docker.sock:/var/run/docker.sock \
--name dood \
ubuntu:22.04 sleep inf &
@rwcitek
rwcitek / Docker.Python.Compile.md
Last active February 19, 2023 01:37
Compiling Python in a Docker image.

This is a collection of bash commands that builds a Python binary for a specific Linux environment using Docker. Environment variables are used to set default values, e.g. Python version and compile options. Using those environment variables, a HERE-DOC command creates a Dockerfile. Docker then uses the Dockerfile to build the Python binary within a Docker image.

To see what the latest Python version is, visit https://www.python.org/ftp/python/.

set environment variables ( optional )

Only if you want to use something different from the defaults.

@rwcitek
rwcitek / slide-deck.sh
Last active August 7, 2022 20:43 — forked from sluugdemogithub/slide-deck.sh
Creating a new slidedesk repo from the jekyll-and-slide repo
# This gist combines specific commits from two different repos: jekyll-and-slide and reveal.js
# - https://github.com/adamhollett/jekyll-and-slide
# - https://github.com/hakimel/reveal.js
# If there was a way to do this from the browser, this gist would be unnecessary.
# prerequisite: create a blank repo in GitHub and note repo URL
# i.e. no README, no license, completely blank
REMOTE_URL='https://github.com/sluugdemogithub/demo03.git'
# create the URL for GitHub Pages
@rwcitek
rwcitek / chromebook.install.docker.sh
Last active April 17, 2023 04:54
Configure Linux and Install Docker on a Chromebook
# https://dvillalobos.github.io/2020/How-to-install-and-run-Docker-on-a-Chromebook/
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update --allow-releaseinfo-change
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
@rwcitek
rwcitek / install.ansible.ubuntu.1004.sh
Last active May 18, 2017 08:32
Installing Ansible on Ubuntu 10.04
# from http://docs.ansible.com/intro_installation.html#running-from-source
# as of 2015-02-08
## ansible on Ubuntu 10.04
# become root
sudo su -
# as root ...
apt-get update
apt-get -y install python-pip python-dev git-core make
@rwcitek
rwcitek / deb.pkg.reboot.txt
Created December 19, 2014 23:02
Finding DEB packages that should be held back because they will require a reboot to take effect.
# finding DEB packages that should be held back because they will require a reboot to take effect
# get latest state of packages
apt-get clean && apt-get update && apt-get -dy upgrade
# find those needing reboot
cd /var/cache/apt/archives/ && rm -rf DEBIAN
for i in *.deb ; do
echo == ${i}
dpkg-deb -e ${i}