summaryrefslogtreecommitdiff
path: root/shell_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'shell_scripts')
-rw-r--r--shell_scripts/useful_commands.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/shell_scripts/useful_commands.sh b/shell_scripts/useful_commands.sh
new file mode 100644
index 00000000..8ff604e2
--- /dev/null
+++ b/shell_scripts/useful_commands.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+doas su postgres
+# In this project we only use the ``opendc'' database.
+psql -d opendc
+
+# Queries
+# Selects everything from the topic which Kafka writes to.
+SELECT * FROM postgres_topic;
+
+# Redis CLI
+# Connect to Redis
+redis-cli -h localhost -p 6379
+# Very useful tutorial https://redis.io/docs/latest/develop/data-types/streams/
+# https://redis.io/docs/latest/develop/tools/cli/
+# Returns all items in the Redis stream
+XRANGE postgres_topic - +
+XTRIM postgres_topic MAXLEN 0
+# https://codesignal.com/learn/courses/mastering-redis-for-high-performance-applications-with-java-and-jedis-1/lessons/redis-streams-with-java