Trying to jail linux users using bubblewrap on ubuntu 18.04 - linux

I ran the below commands as root to install bubblewrap:
$ apt install pkg-config libcap-dev automake
$ git clone https://github.com/containers/bubblewrap.git
$ cd bubblewrap
$ git checkout v0.4.1
$ ./autogen.sh
$ make
$ make install
$ ln -s /usr/local/bin/bwrap /bin/bwrap
$ mv /usr/bin/bwrap /usr/bin/bwrap.dist
$ ln -s /usr/local/bin/bwrap /usr/bin/bwrap
It got installed. Now I want to jail/unjail some already created users using bubblewrap. I am not able to find any commands to do so. I want to know how to jail/unjail users using bubblewrap(bwrap).

Related

Trying to install TA-lib

I'm using gcp debian VM, and trying to install the module TA-lib doing this (with the tar already downloaded):
$ tar -xzf ta-lib-0.4.0-src.tar.gz
$ cd ta-lib/
$ ./configure --prefix=/usr DOING THIS I GET AN ERROR
$ make
$ sudo make install
configure: error: no acceptable C compiler found in $PATH
How can I solve?

how to install gcc-12 on ubuntu

$ sudo apt search gcc-12
Sorting... Done
Full Text Search... Done
$ uname -a
Linux Han 5.10.81.1-microsoft-standard-WSL2 #1 SMP Mon Nov 22 18:52:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
I am using the default sources.list file, I want to install gcc-12 but I can't find it in the mirror source, what should I do!
gcc-12 is not available in ubuntu 20.04, so we need to compile it from source code, here are the steps which I borrowed from this video:
Step 1: clone gcc source code and checkout gcc-12 branch
$ git clone https://gcc.gnu.org/git/gcc.git gcc-source
$ cd gcc-source/
$ git branch -a
$ git checkout remotes/origin/releases/gcc-12
Step 2: make another build dir
Note this is important as running ./configure from within the source directory is not supported as documented here.
$ mkdir ../gcc-12-build
$ cd ../gcc-12-build/
$ ./../gcc-source/configure --prefix=$HOME/install/gcc-12 --enable-languages=c,c++
Step 3: installing GCC prequisites and run configure again
The missing libraries will be shown in above ./confgiure output, search and install them one by one.
$ apt-cache search MPFR
$ sudo apt-get install libmpfrc++-dev
$ apt-cache search MPC | grep dev
$ sudo apt-get install libmpc-dev
$ apt-cache search GMP | grep dev
$ sudo apt-get install libgmp-dev
$ sudo apt-get install gcc-multilib
$ ./../gcc-source/configure --prefix=$HOME/install/gcc-12 --enable-languages=c,c++
An alternartive is to run the download_prerequisites script.
$ cd ../
$ cd gcc-source/
$ ./contrib/download_prerequisites
$ ./../gcc-source/configure --prefix=$HOME/install/gcc-12 --enable-languages=c,c++
Step 4: compile gcc-12
$ make -j16
Still flex is missing:
$ sudo apt-get install flex
$ ./../gcc-source/configure --prefix=$HOME/install/gcc-12 --enable-languages=c,c++
$ make -j16
$ make install
Another way is to use Ubuntu 22.04 where gcc-12 is available. In Ubuntu 22.04, gcc-12 can be installed with apt:
$ sudo apt install gcc-12
You can use Homebrew to install pre-built binaries.
Follow instructions to install Homebrew at https://brew.sh/, then
brew install gcc for default GCC (currently 11) or brew install gcc#12 for gcc-12.
Note that it may compile missing dependencies.
I would add if you are adding for 64 bit only, you'll want to add "--disable=multilib" to the end of your configure statement.

Install Julia >v1.1.1 on Raspberry Pi Zero W

I'm trying to use the PortAudio package in Julia on a Raspberry Pi Zero W running Raspberry Pi OS like so:
using Pkg
Pkg.add("PortAudio")
This fails with the error:
ERROR: Unsatisfiable requirements detected for package PortAudio [80ea8bcb]:
PortAudio [80ea8bcb] log:
├─possible versions are: 1.1.1-1.1.2 or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions 1.1.1-1.1.2
└─restricted by julia compatibility requirements to versions: uninstalled — no versions left
The version of Julia in apt is v1.0.3, which explains the above error. So I'm trying to install the latest version of Julia. The pre-compiled binaries won't run (Illegal instruction error) so I'm trying to compile it following the instructions from here:
sudo apt-get -y update
sudo apt-get install build-essential libatomic1 python gfortran perl wget m4 cmake pkg-config libopenblas-dev git ccache
I then added this to /etc/dphys-swapfile
CONF_SWAPSIZE=8192
CONF_MAXSWAP=8192
Then
git clone https://github.com/JuliaLang/julia.git
cd julia
git checkout v1.6.2
make
This fails with this error:
Illegal instruction
make[1]: *** [Makefile:222: julia_flisp.boot] Error 132
make: *** [Makefile:43: julia_flisp.boot.inc.phony] Error 2
I think the issue here is that you need to tell it which ARM CPU the Pi uses, so following these instructions and this thread I added this to Make.user:
JULIA_CPU_TARGET=arm1176jzf-s
USE_BINARYBUILDER=0
But I get the same error, albeit with a suggestion to try make -C deps clean-openblas and rebuild with make OPENBLAS_USE_THREAD=0 or make OPENBLAS_TARGET_ARCH=NEHALEM. Neither fixes the problem. Also tried this python script (error downloading julia-1.6-latest ) and these instructions to install via docker (standard_init_linux.go:228: exec user process caused: exec format error) but could not get either to work.
I've tried absolutely everything I can find online. Someone please help! How do I install a recent version (>v1.1.1) of Julia on a Pi Zero?
I did it! Code quoted from this website:
yourmainPC $ ssh pi#raspberrypi.local # Assume You are going to login to your Pi via SSH
pi#raspberrypi $ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
pi#raspberrypi $ sudo gpasswd -a $USER docker # if you like to skip `sudo`
pi#raspberrypi $ exit
yourmainPC $ ssh pi#raspberrypi.local # login again
pi#raspberrypi $ JL_VERSION=v1.5.1
pi#raspberrypi $ IMAGE_NAME=terasakisatoshi/jlcross:rpizero-${JL_VERSION}
pi#raspberrypi $ CONTAINER_NAME=jltmp_${JL_VERSION}
pi#raspberrypi $ docker run --name ${CONTAINER_NAME} $IMAGE_NAME /bin/bash
pi#raspberrypi $ docker cp ${CONTAINER_NAME}:/home/pi/julia-${JL_VERSION} .
pi#raspberrypi $ docker rm ${CONTAINER_NAME}
pi#raspberrypi $ ls
julia-v1.5.1 # <---- this is it
pi#raspberrypi $ cd julia-v1.5.1/bin
pi#raspberrypi $ ./julia # tada!!!

Updating a lightning node to latest version

I'm running a lightning node (a 2nd layer for bitcoin transactions) on a Raspberry Pi. I'm still learning about the technology and linux as well. But I'm not sure how to securely update my node to the new LND version 0.4.1 and I'd like some directions.
I already downloaded the new LND binaries and checked the keys.
$ wget https://github.com/lightningnetwork/lnd/releases/download/v0.4.1-beta/lnd-linux-arm-v0.4.1-beta.tar.gz
I used this to install the previous version (0.4-beta) from scratch:
$ tar -xzf lnd-linux-arm-v0.4-beta.tar.gz
$ ls -la
$ sudo install -m 0755 -o root -g root -t /usr/local/bin lnd-linux-arm-v0.4-beta/*
But how should I proceed if I just want to update, considering I'm not installing from scratch again? What commands should I use on linux?
LND official installation instructions are not very clear.
I found out how to do it.
Update a lightning node on a Raspberry Pi is actually very easy.
First, it's safe to stop your node:
$ sudo systemctl stop lnd
then download the new version (change version accordingly) from github:
$ cd /download
$ wget https://github.com/lightningnetwork/lnd/releases/download/v0.4.1-beta/lnd-linux-arm-v0.4.1-beta.tar.gz
and install as if you were installing for the first time:
$ tar -xzf lnd-linux-arm-v0.4.1-beta.tar.gz
$ ls -la
$ sudo install -m 0755 -o root -g root -t /usr/local/bin lnd-linux-arm-v0.4.1-beta/*
then restart the service:
sudo systemctl start lnd

How to install Qt.-5.0.2 on ubuntu 12.10?

I've downloaded qt-linux-opensource-5.0.2-x86-offline.run and i cant install it on ubuntu.
this is all i have done.
$ cd /media/moslem/0EB40068B400549D/
$ chmod +x qt-linux-opensource-5.0.2-x86-offline.run
$ sudo ./qt-linux-opensource-5.0.2-x86-offline.run
[sudo] password for moslem:
sudo: ./qt-linux-opensource-5.0.2-x86-offline.run: command not found
please tell me how i can install it.
You can try sudo on all commands...

Resources