Skip to content

Instantly share code, notes, and snippets.

@pdxjohnny
pdxjohnny / .gitignore
Last active February 23, 2024 18:12
Setting Up k3s for Serverless (knative) on a $5 DigitalOcean Droplet Using k3d
.terraform/
*.pem
*.tf
*.tfstate
*.yaml
*.backup
istio-*/
cert-manager-*/
*.swp
env
@dianjuar
dianjuar / i3-shortcuts-screenshot.md
Last active May 13, 2024 08:32
My i3 shortcuts to take screenshots

Requirements

  • maim
  • xclip

Set-up

Set this on your i3 config file ~/.i3/config

# Screenshots
@gmag11
gmag11 / rclone-mount@.service
Last active March 27, 2024 04:01
Mount multiple RClone remotes on boot with a single SystemD forking service definition
# Rclone mount on boot
# Copy file to: /etc/systemd/system
# You need to create a remote on RClone and a folder on your disk, both with same name <rclone-remote>
# This example uses /cloud/ folder as origin to mount all remotes, change it to your needs
# This example use a linux user named rclone. Create it or adapt it to your needs. Rclone will get config from that user's home folder
# Register new service by typing:
# sudo systemctl daemon-reload
# Do the next one for every remote you want to load on boot
# sudo systemctl enable rclone-mount@<rclone-remote>.service
# systemctl start rclone-mount@<rclone-remote>.service
@gea0
gea0 / arch-rpi-64-full-disk-encryption-ssh-unlock.md
Last active March 24, 2024 14:36
Tutorial for installing a 64-bit Arch Linux ARM system on the Raspberry Pi 3B+, with an encrypted root filesystem, and the option to remotely unlock it via a pre-boot SSH daemon.

Arch Linux ARM 64 on Raspberry Pi 3 B+ With Full Disk Encryption And SSH Unlock: 2018 Edition

There are multiple ways to get a full disk encrypted arch linux system on raspberry. In this tutorial, we will install a 64-bit arch linux armv8 system, using dropbear as ssh server for remote pre-boot unlocking of the root filesystem. However, it will still be possible to unlock and use the pi as usual, with a keyboard and monitor. We will also create an unencrypted partition in the installation process, usable as a rescue system.

Differences to the 32-bit arch linux arm version:

  • probably better performance
  • can run 64-bit software
  • comes without the proprietary video-driver blobs
@njoerd114
njoerd114 / html-macro-content.html
Last active October 6, 2021 14:26
Confluence: User HTML-Macro to embed ReDoc for OpenApi documentation
<redoc spec-url='https://confluence.instance/download/attachments/someid/some_swagger_doc.yaml?api=v2'></redoc>
<!--The some_swagger_doc.yaml can be a site attachment, just copy over the download link once you uploaded the yaml to your page.-->
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
@qneyrat
qneyrat / docker-compose.yml
Created December 11, 2017 20:40
monitoring-container ressources
version: '3'
services:
app:
build:
context: .
dockerfile: ./Dockerfile
depends_on:
- db
environment:
@samsch
samsch / build-environment.md
Last active January 20, 2021 22:19
Run a postgres container and connect with pgadmin (in another container)

Start a postgres server:

docker run -v postgres:/var/lib/postgresql/data --name postgres-test -e POSTGRES_PASSWORD=mysecretpassword -d postgres

Start pgadmin

Connect with a one-off docker container in current process:

docker run -v pgadmin4:/home/pgadmin/.pgadmin -p 5050:5050 --link postgres-test:postgres-test --rm meedan/pgadmin
@ipbastola
ipbastola / jq to filter by value.md
Last active April 25, 2024 17:14
JQ to filter JSON by value

JQ to filter JSON by value

Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'

Example: To get json record having _id equal 611

cat my.json | jq -c '.[] | select( ._id | contains(611))'

Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)

@Opalo
Opalo / gist:792c38c689fbedd762670812cb9f7e7c
Last active June 10, 2018 08:38
Postgres embedded DB configuration for spring testing
// configuration (groovy)
import de.flapdoodle.embed.process.runtime.Network
import org.postgresql.ds.PGPoolingDataSource
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.DependsOn
import org.springframework.context.annotation.Profile
import ru.yandex.qatools.embed.postgresql.PostgresExecutable
import ru.yandex.qatools.embed.postgresql.PostgresProcess
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4