OpenLDAP/BackSQL: Difference between revisions
Jump to navigation
Jump to search
Line 13: | Line 13: | ||
| colspan="3" | | | colspan="3" | | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
cat <<'EXE' | lxc exec openldap -- bash | |||
apt-get update | |||
apt-get install -y unixodbc-dev build-essential libssl-dev libdb-dev libldap2-dev libpq-dev postgresql-client odbc-postgresql | |||
EXE | |||
</syntaxhighlight> | |||
|- | |||
| colspan="3" | | |||
---- | |||
|- | |||
| colspan="3" | | |||
<syntaxhighlight lang="bash"> | |||
# fetch lxd bridge ip using lxc network listing command | |||
LXD_BRIDGE_IP="$(lxc network ls --format=json|jq -r '.[]|select(.name=="lxdbr0")|.config."ipv4.address"|split("/")[0]')" | |||
# fetch lxd bridge ip using ip address show command | |||
LXD_BRIDGE_IP="$(ip addr show lxdbr0 | awk '/inet / {print $2}' | cut -d '/' -f 1)" | |||
cat << EXE | lxc exec openldap -- bash | |||
echo "${LXD_BRIDGE_IP} host.lxd.internal"|tee -a /etc/hosts | |||
ping -c5 host.lxd.internal | |||
EXE | |||
</syntaxhighlight> | |||
|- | |||
| colspan="3" | | |||
---- | |||
|- | |||
| colspan="3" | | |||
<syntaxhighlight lang="bash"> | |||
echo -n 'password: ';read -s PGPASSWORD;export PGPASSWORD;echo | |||
# password: sadaqah! | |||
psql -d openldap -U openldap -h host.lxd.internal | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 08:56, 8 January 2025
SQL Backend
lxc launch ubuntu:24.04 openldap
lxc exec openldap -- bash
| ||
| ||
cat <<'EXE' | lxc exec openldap -- bash
apt-get update
apt-get install -y unixodbc-dev build-essential libssl-dev libdb-dev libldap2-dev libpq-dev postgresql-client odbc-postgresql
EXE
| ||
| ||
# fetch lxd bridge ip using lxc network listing command
LXD_BRIDGE_IP="$(lxc network ls --format=json|jq -r '.[]|select(.name=="lxdbr0")|.config."ipv4.address"|split("/")[0]')"
# fetch lxd bridge ip using ip address show command
LXD_BRIDGE_IP="$(ip addr show lxdbr0 | awk '/inet / {print $2}' | cut -d '/' -f 1)"
cat << EXE | lxc exec openldap -- bash
echo "${LXD_BRIDGE_IP} host.lxd.internal"|tee -a /etc/hosts
ping -c5 host.lxd.internal
EXE
| ||
| ||
echo -n 'password: ';read -s PGPASSWORD;export PGPASSWORD;echo
# password: sadaqah!
psql -d openldap -U openldap -h host.lxd.internal
| ||
| ||
lxc snapshot openldap base:2.6.7
|
lxc publish openldap/base:2.6.7 --alias openldap/base:2.6.7
|
lxc restore openldap base:2.6.7
|
| ||
Playground
lxc image info ubuntu:noble --vm|yq .Aliases
lxc image info ubuntu:24.04 --vm|yq .Aliases
lxc image info ubuntu:noble |yq .Aliases
lxc image info ubuntu:24.04 |yq .Aliases
|
lxc image list ubuntu: os=ubuntu release=noble type=virtual-machine
lxc image list ubuntu: os=ubuntu release=noble type=virtual-machine
lxc image list ubuntu: os=ubuntu release=noble type=container
lxc image list ubuntu: os=ubuntu release=noble type=container
| |
| ||
lxc image list ubuntu:24.04
lxc launch ubuntu:24.04 openldap
lxc launch ubuntu:40d8df642812 openldap
|
lxc list status=running name=openldap --format=json |jq -r '.[].state.network.[].addresses'
lxc list status=running name=openldap --format=yaml |yq -r '.[].state.network.[].addresses'
lxc info openldap|yq '.Resources.["Network usage"][]["IP addresses"].inet'
| |
| ||
systemctl list-dependencies graphical.target
dpkg -l | grep 'gnome-shell-extension'
apt list --installed|grep linux-image
|
lxc snapshot openldap base:2.6.7
lxc publish openldap/base:2.6.7 --alias openldap/base:2.6.7
lxc restore openldap base:2.6.7
| |
| ||
cat <<-'EXE'|sudo bash
umount /var/snap/firefox/common/host-hunspell
snap remove firefox
EXE
|
cat <<-'EXE'|sudo bash
snap disable lxd
snap remove --purge lxd
EXE
|
systemctl list-dependencies --type=service --state=running systemctl list-dependencies --type=service --state=active systemctl list-dependencies docker.service systemctl list-dependencies --all |
References
| ||
| ||