libsodium.so.23 when using SSR in ubuntu 16 - python-2.7

I'm trying to use shadowsocksR in my ubuntu 16 .
sudo apt-get install git
git clone -b manyuser https://github.com/shadowsocksr-backup/shadowsocksr.git
cd shadowsocksr/shadowsocks
python local.py -s server_ip -p server_port -k password -m chacha20-ietf -o tls1.2_ticket_auth
then he said " libsodium not found" so I install libsodium
download the LATEST.tar.gz from https://download.libsodium.org/libsodium/releases/
tar -zxf LATEST.tar.gz
cd libsodium-stable
./configure
make && make check
sudo make install
```
but this time
python local.py -s server_ip -p server_port -k password -m chacha20-ietf -o tls1.2_ticket_auth
He said OSError: libsodium.so.23: cannot open shared object file: No such file or directory
thankyou for your help

You need to install libsodium-dev
Try running "apt-get install libsodium-dev"

If you've compiled libsodium, make sure libsodium is in the linker cache:
ldconfig -p | grep libsodium
If there is no output, chances are that the linker cache is not updated in time.
You can update the cache by:
sudo ldconfig

Related

How to install brew into a Dockerfile (`brew: not found`)

Rather than necro-post on a two-year old thread, I decided to create a new question.
I want add brew (homebrew) to a Docker container, but I get a brew: not found error.
The suggested solution in that previous article doesn't seem to work. This new Dockerfile...
FROM rust:1.63.0-buster
WORKDIR app
RUN apt-get update && \
apt-get install -y -q --allow-unauthenticated \
git \
sudo
RUN useradd -m -s /bin/zsh linuxbrew && \
usermod -aG sudo linuxbrew && \
mkdir -p /home/linuxbrew/.linuxbrew && \
chown -R linuxbrew: /home/linuxbrew/.linuxbrew
USER linuxbrew
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
USER root
RUN chown -R $CONTAINER_USER: /home/linuxbrew/.linuxbrew
RUN brew install hello
gives this error... What am I missing? Thanks.
=> ERROR [6/6] RUN brew install hello 0.2s
------
> [6/6] RUN brew install hello:
#9 0.181 /bin/sh: 1: brew: not found
------
executor failed running [/bin/sh -c brew install hello]: exit code: 127
This Dockerfile installs brew in /home/linuxbrew/.linuxbrew/bin/brew. Including that directory in the path (with the ENV command) does the trick.
...
ENV PATH="/home/linuxbrew/.linuxbrew/bin:${PATH}"
RUN brew install hello

How to install uWebSockets?

I am running ubuntu on my window 10 through VMware. Because the Udacity course needs uWebSockets to run the simulator.
here is the step the class given to install it:
run chmod a+x install-linux.sh
this is the install-linux.sh file in the same directory
#!/bin/bash
source /etc/os-release || echo 'Warning: /etc/os-release was not found'
if [[ " $ID_LIKE " == *' archlinux '* ]]; then
sudo pacman -S git libuv openssl gcc cmake make
else
if [[ ! " $ID_LIKE " == *' debian '* ]]; then
echo 'Warning: unidentified Linux distribution, assuming Debian-like'
fi
sudo apt-get update
sudo apt-get install git libuv1-dev libssl-dev gcc g++ cmake make
fi
git clone https://github.com/uWebSockets/uWebSockets
cd uWebSockets
git checkout e94b6e1
mkdir build
cd build
cmake ..
make
sudo make install
cd ../..
sudo ln -s /usr/lib64/libuWS.so /usr/lib/libuWS.so
sudo rm -r uWebSockets
But when I try the command in the terminal, nothing happened.
Is anybody can provide some help?
All chmod a+x install-linux.sh does is change the file permissions of install-linux.sh so that it is executable. So I wouldn't expect to see anything in the terminal.
I expect that after changing the file permissions that you are supposed to run the script like this
./install-linux.sh

Deploying a Geodjango Application on AWS Elastic Beanstalk

I'm trying to deploy a geodjango application on AWS Elastic Beanstalk. The configuration is 64bit Amazon Linux 2017.09 v2.6.6 running Python 3.6. I am getting this error when trying to deploy:
Requires: libpoppler.so.5()(64bit) Error: Package: gdal-java-1.9.2-8.rhel6.x86_64 (pgdg93) Requires: libpoppler.so.5()(64bit)
How do I install the required package? I read through Setting up Django with GeoDjango Support in AWS Beanstalk or EC2 Instance but I am still getting problems. My ebextensions currently looks like:
commands:
01_yum_update:
command: sudo yum -y update
02_epel_repo:
command: sudo yum-config-manager -y --enable epel
03_install_gdal_packages:
command: sudo yum -y install gdal gdal-devel
packages:
yum:
git: []
postgresql95-devel: []
gettext: []
libjpeg-turbo-devel: []
libffi-devel: []
I'm going to answer my own question for the sake my future projects and anyone else trying to get started with geodjango. Updating this answer as of July 2020
Create an ebextensions file to install GDAL on the EC2 instance at deployment:
01_gdal.config
commands:
01_install_gdal:
test: "[ ! -d /usr/local/gdal ]"
command: "/tmp/gdal_install.sh"
files:
"/tmp/gdal_install.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
sudo yum-config-manager --enable epel
sudo yum -y install make automake gcc gcc-c++ libcurl-devel proj-devel geos-devel
# Geos
cd /
sudo mkdir -p /usr/local/geos
cd usr/local/geos/geos-3.7.2
sudo wget geos-3.7.2.tar.bz2 http://download.osgeo.org/geos/geos-3.7.2.tar.bz2
sudo tar -xvf geos-3.7.2.tar.bz2
cd geos-3.7.2
sudo ./configure
sudo make
sudo make install
sudo ldconfig
# Proj4
cd /
sudo mkdir -p /usr/local/proj
cd usr/local/proj
sudo wget -O proj-5.2.0.tar.gz http://download.osgeo.org/proj/proj-5.2.0.tar.gz
sudo wget -O proj-datumgrid-1.8.tar.gz http://download.osgeo.org/proj/proj-datumgrid-1.8.tar.gz
sudo tar xvf proj-5.2.0.tar.gz
sudo tar xvf proj-datumgrid-1.8.tar.gz
cd proj-5.2.0
sudo ./configure
sudo make
sudo make install
sudo ldconfig
# GDAL
cd /
sudo mkdir -p /usr/local/gdal
cd usr/local/gdal
sudo wget -O gdal-2.4.4.tar.gz http://download.osgeo.org/gdal/2.4.4/gdal-2.4.4.tar.gz
sudo tar xvf gdal-2.4.4.tar.gz
cd gdal-2.4.4
sudo ./configure
sudo make
sudo make install
sudo ldconfig
As shown, the script checks whether gdal already exists using the test function. It then downloads the Geos, Proj, and GDAL libraries and installs them in the usr/local directory. At the time of writing this, geodjango (Django 3.0) supports up to Geos 3.7, Proj 5.2 (which also requires projdatum. Current releases do not require it), and GDAL 2.4 Warning: this installation process can take a long time. Also I am not a Linux professional so some of those commands may be redundant, but it works.
Lastly I add the following two environment variables to my Elastic Beanstalk configuration:
LD_LIBRARY_PATH: /usr/local/lib:$LD_LIBRARY_PATH
PROJ_LIB: usr/local/proj
If you still have troubles I recommend checking the logs and ssh-ing in the EC2 instance to check that installation took place. Original credit to this post

ldconfig seems no functional under alpine 3.3

I'm currently install the goczmq (https://github.com/zeromq/goczmq) on golang:1.6.2-alpine docker container, as following:
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.10.tar.gz
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.10.tar.gz.sig
wget https://download.libsodium.org/jedi.gpg.asc
gpg --import jedi.gpg.asc
gpg --verify libsodium-1.0.10.tar.gz.sig libsodium-1.0.10.tar.gz
tar zxvf libsodium-1.0.10.tar.gz
cd libsodium-1.010.
./configure; make check
sudo make install
sudo ldconfig
The process failed on ldconfig, there seems be a command ldconfig, but I don't think it is actually functional. Any insights? Thank you in advance.
Alpine's version of ldconfig requires you to specify the target folder or library as an argument. Note that alpine has no /etc/ld.so.conf file, nor does it recognize one if you create it.
Example with no target path:
$ docker run -ti alpine sh -c "ldconfig; echo \$?"
1
Example with target path:
$ docker run -ti alpine sh -c "ldconfig /; echo \$?"
0
However, even with that there are frequently linking errors. Others suggest:
Manual symbolic links
Installing glibc into your container.

How to compile C code that is using kernel function in docker and use pci device in container?

I have a Makefile some C++ code that is using PCI device
all:
g++ -o executable main.cpp dragon.pb.cc -std=c++11 -O3 -I/usr/include/postgresql -I/usr/include/hiredis -lzmq -lprotobuf -lpthread -lpq -lhiredis
clean:
rm executable
And It have dependencies on this C library that is using kernel functions. Makefile for this libraby is
# dist and build are folders, not phony targets
.PHONY: all package clean
all: dragon.pb.cc dragon_pb2.py package
dragon.pb.cc: dragon.proto
protoc --cpp_out=. dragon.proto
dragon_pb2.py: dragon.proto
protoc --python_out=. dragon.proto
package: build
clean:
rm -f dragon.pb.*
rm -f dragon_pb*
rm -rf build
rm -rf dist
rm -f MANIFEST
And here is my Dockerfile
FROM ubuntu:14.04
ENV PG_MAJOR 9.3
RUN apt-get update
RUN apt-get install -y git make protobuf-compiler libhiredis-dev postgresql-server-dev-${PG_MAJOR}
RUN apt-get install -y g++
RUN apt-get install -y libzmq-dev
RUN apt-get install -y libprotobuf-dev
RUN apt-get install -y linux-headers-$(uname -r)
ADD deployment_key /root/.ssh/id_rsa
RUN chmod 600 /root/.ssh/id_rsa
RUN echo "StrictHostKeyChecking no" >> /root/.ssh/config
RUN echo >> /root/.ssh/config
RUN echo "Host bitbucket.org" >> /root/.ssh/config
RUN mkdir -p /usr/src/app/
WORKDIR /usr/src/app/
RUN git clone git#bitbucket.org:opticsdevelopment/dragon-protocols.git
WORKDIR ./dragon-protocols
RUN make dragon.pb.cc
RUN cp ./dragon.pb.* ../
COPY . /usr/src/app
WORKDIR ../
RUN git clone git#bitbucket.org:opticsdevelopment/dragon-module.git
WORKDIR ./dragon-module
RUN make all
WORKDIR ../
RUN make
EXPOSE 5570
CMD ["dragon"]
The problem right now is in installing linux-headers. Somehow it can't find headers
E: Unable to locate package linux-headers-3.13.0-19-generic
E: Couldn't find any package by regex 'linux-headers-3.13.0-19-generic'
If your app can compile with any generic linux headers
In your Dockerfile change
RUN apt-get install -y linux-headers-$(uname -r)
to just
RUN apt-get install -y linux-headers-generic
or if you need the same specific one as your host system
why dont you just volume link this directory from host to the docker container with the -v?
on your host system:
sudo apt-get install linux-headers-$(uname -r)
Now you have the kernel headers here: /usr/src/linux-headers-$(uname -r)/include
now on your docker container run command, link that volume like
-v /usr/src/linux-headers-$(uname -r)/include:/usr/src/linux-headers-$(uname -r)/include