The birth of the linux command grep!

@miguel I think you know this!!
I never knew where the name came from!!! There is a very interesting story behind it!

lol!

grep is from the early 1970s, a couple of decades before Linux existed! It’s really a original Unix command.

1 Like

I love it especially once I am greping my iptables logs!!!

Also, Computerphile, and the other Brady Haran’s YouTube channels are all awesome! You should subscribe!

1 Like

they are mainly about historical stuff like it is never explaining by showing. I like watching videos or reading websites that show you how each command and parameter behaves. In fact since the last week I have been working on docker empire, like a docker data center in a single VPS. ( Wireguard, Openvpn, Plex, qbittorrent, jellyfin, radarr, sonarr, nextcloud, onlyoffice…etc ) and I love this community that makes docker containers that are ready for deployment LinuxServer.io · GitHub . even though you see it ready for deployment and they explain everything in there github page, but I have been editing on the containers to make them behave in the way I want them to behave and bind to specific bridge networks so that the docker containers are fully isolated from the host and at the same time I have control over ports that are being exposed to the internet using iptbales. God I love iptables!! you can do a lot with iptables, like literally a LOT, packet filtering at layer 2,3,5,6, and 7. In my opinion there should be a thing called Iptables engineer!!!

so yeah those are the type of things I like and Computerphile just doesn’t offer that! they only explain how things work theoretically, or logically. I am not saying that they are bad or anything like that, but they aren’t the best hands on learning option!!

not really fully automated script, hopefully it will be a script soon, but I can tell you that doing this in a script is not a simple thing!!

# create a docker network
docker network create --subnet=172.20.1.0/24 --gateway=172.20.1.1 main
# Wireguard-linuxserver
sudo usermod -aG docker $USER && \
newgrp docker && \
sudo iptables -t nat -N DOCKER-ALLOW
sudo iptables -t nat -I PREROUTING -j DOCKER-ALLOW
sudo iptables -t nat -I PREROUTING -m addrtype --dst-type LOCAL -j RETURN
sudo iptables -t nat -I PREROUTING -m addrtype --dst-type LOCAL -j DOCKER-ALLOW
sudo mkdir -p /opt/wireguard-server/config && \
sudo chown $USER:$USER -R /opt/wireguard-server && \
sudo chmod 770 -R /opt/wireguard-server && \
sudo apt install linux-headers-$(uname -r)
docker run -d \
  --name=wireguard \
  --network main \
  --ip=172.20.1.2 \
  --memory="512m" \
  --oom-kill-disable=true \
  --cap-add=NET_ADMIN \
  --cap-add=SYS_MODULE \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=America/Edmonton \
  -e SERVERURL=auto \
  -e SERVERPORT=61234 \
  -e PEERS=254 \
  -e PEERDNS=auto \
  -e INTERNAL_SUBNET=10.8.1.0/24 \
  -e ALLOWEDIPS=0.0.0.0/0 \
  -p 61234:61235/udp \
  -v /opt/wireguard-server/config:/config \
  -v /lib/modules:/lib/modules \
  -v /usr/src:/usr/src \
  --sysctl="net.ipv4.conf.all.src_valid_mark=1" \
  --restart unless-stopped \
  ghcr.io/linuxserver/wireguard
docker image prune
sudo iptables -t nat -I DOCKER-ALLOW -p udp -m udp --dport 61234 -j DOCKER
sudo iptables -A USER-RULES -s 172.20.0.2/32 -p tcp -m tcp --dport 58721 -j ACCEPT
# COMMANDS:
# docker exec -it wireguard /app/show-peer <peer_number>
# THIS MUST BE PERFORMED BEFORE INSTALLING THE WIREGUARD CONTAINER TO INSTALL THE KERNAL HEARER ON THE HOST
# sudo apt install linux-headers-$(uname -r)
# also the following directory needs to be mapped
# -v /usr/src:/usr/src
# PEERDNS=auto means use the host's DNS server
# SERVERURL=auto means try to setup the external ip automatically
# qbittorrent-linxserver
# port: 8080
# username: admin
# password: adminadmin
sudo mkdir -p /opt/qbittorrent/config && \
sudo mkdir -p /opt/qbittorrent/downloads/tvshows && \
sudo mkdir -p /opt/qbittorrent/downloads/movies && \
sudo mkdir -p /opt/qbittorrent/downloads/media && \
sudo chown $USER:$USER -R /opt/qbittorrent && \
sudo chmod 770 -R /opt/qbittorrent
docker run -d \
  --name=qbittorrent \
  --memory="512m" \
  --memory-reservation="256m" \
  --network main \
  --ip=172.20.1.3 \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=America/Edmonton \
  -e WEBUI_PORT=8080 \
  -v /opt/qbittorrent/config:/config \
  -v /opt/qbittorrent/downloads:/downloads \
  -v /opt/qbittorrent/downloads/tvshows:/tv \
  -v /opt/qbittorrent/downloads/movies:/movies \
  -v /opt/qbittorrent/downloads/media:/media \
  --restart unless-stopped \
  ghcr.io/linuxserver/qbittorrent
# NOTES:
# since the client doesn't need to be accessed from the the main interface of the server and only from the same subnet of the container then 
# port number 8080 doesn't need to be mapped
# the following ports (6881/tcp and 6881/udp) are not needed unless the client is hosting a torrent therefore don't inclue these parameters
# -p 6881:6881 \
# -p 6881:6881/udp \

# plex-linuxserver
# port: 32400
sudo mkdir -p /opt/plex/media && \
sudo mkdir -p /opt/plex/transcode && \
sudo chown $USER:$USER -R /opt/plex && \
sudo chmod 770 -R /opt/plex
docker run -d \
  --name=plex \
  --memory="512m" \
  --memory-reservation="256m" \
  --network main \
  --ip=172.20.1.4 \
  -e PUID=1000 \
  -e PGID=1000 \
  -e VERSION=docker \
  -e TZ=America/Edmonton \
  -v /opt/plex/config:/config \
  -v /opt/qbittorrent/downloads/tvshows:/tv \
  -v /opt/qbittorrent/downloads/movies:/movies \
  -v /opt/qbittorrent/downloads/media:/media \
  -v /opt/plex/media:/plex-media \
  -v /opt/plex/transcode:/transcode \
  --restart unless-stopped \
  ghcr.io/linuxserver/plex

# this is the claim token
#-e PLEX_CLAIM= `#optional` \

# jellyfin server
# port 8096
# username: admin
# password: admin
sudo mkdir -p /opt/jellyfin/config && \
sudo chown $USER:$USER -R /opt/jellyfin && \
sudo chmod 770 -R /opt/jellyfin && \
docker run -d \
  --name=jellyfin \
  --memory="512m" \
  --memory-reservation="256m" \
  --network main \
  --ip=172.20.1.5 \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=America/Edmonton \
  -e JELLYFIN_PublishedServerUrl=172.20.1.5 `#optional` \
  -v /opt/jellyfin/config:/config \
  -v /opt/qbittorrent/downloads/tvshows:/data/tvshows \
  -v /opt/qbittorrent/downloads/movies:/data/movies \
  --restart unless-stopped \
  ghcr.io/linuxserver/jellyfin

#sonarr
# port: 8989
sudo mkdir -p /opt/sonarr/config && \
sudo chown $USER:$USER -R /opt/sonarr && \
sudo chmod 770 -R /opt/sonarr && \
docker run -d \
  --name=sonarr \
  --memory="512m" \
  --memory-reservation="256m" \
  --network main \
  --ip=172.20.1.6 \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=America/Edmonton \
  -v /opt/sonarr/config:/config \
  -v /opt/qbittorrent/downloads/tvshows:/tv \
  -v /opt/qbittorrent/downloads:/downloads \
  --restart unless-stopped \
  ghcr.io/linuxserver/sonarr
# radarr
# port: 7878
sudo mkdir -p /opt/radarr/config && \
sudo mkdir -p /opt/radarr/downloads && \
sudo chown $USER:$USER -R /opt/radarr && \
sudo chmod 770 -R /opt/radarr && \
docker run -d \
  --name=radarr \
  --memory="512m" \
  --memory-reservation="256m" \
  --network main \
  --ip=172.20.1.7 \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=America/Edmonton \
  -v /opt/radarr/config:/config \
  -v /opt/qbittorrent/downloads/movies:/movies \
  -v /opt/radarr/downloads:/downloads \
  --restart unless-stopped \
  ghcr.io/linuxserver/radarr
# nextcloud
# port:80
# port:443
sudo mkdir -p /opt/nextcloud/config && \
sudo mkdir -p /opt/nextcloud/data && \
sudo chown $USER:$USER -R /opt/nextcloud && \
sudo chmod 770 -R /opt/nextcloud && \
docker run -d \
  --name=nextcloud \
  --memory="1g" \
  --memory-reservation="512m" \
  --network main \
  --ip=172.20.1.8 \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=America/Edmonton \
  -v /opt/nextcloud/config:/config \
  -v /opt/nextcloud/data:/data \
  --restart unless-stopped \
  ghcr.io/linuxserver/nextcloud
# MariaDB
# port: 3306
sudo mkdir -p /opt/mariadb/config && \
sudo chown $USER:$USER -R /opt/mariadb && \
sudo chmod 770 -R /opt/mariadb && \
docker run -d \
  --name=mariadb \
  --memory="256m" \
  --memory-reservation="128m" \
  --network main \
  --ip=172.20.1.9 \
  -e PUID=1000 \
  -e PGID=1000 \
  -e [email protected] \
  -e TZ=America/Edmonton \
  -e MYSQL_DATABASE=nextcloud-db `#optional` \
  -e MYSQL_USER=nextcloud-user `#optional` \
  -e [email protected] `#optional` \
  -v /opt/mariadb/config:/config \
  --restart unless-stopped \
  ghcr.io/linuxserver/mariadb
#   -e REMOTE_SQL=http://URL1/your.sql,https://URL2/your.sql `#optional` \

# ubooquity ebook server
# port: 2202 for library
# port: 2203 for admin
sudo mkdir -p /opt/ubooquity/config && \
sudo mkdir -p /opt/ubooquity/books && \
sudo mkdir -p /opt/ubooquity/raw && \
sudo mkdir -p /opt/ubooquity/books/comics && \
sudo chown $USER:$USER -R /opt/ubooquity && \
sudo chmod 770 -R /opt/ubooquity && \
docker run -d \
  --name=ubooquity \
  --network main \
  --ip=172.20.1.10 \
  --memory="512m" \
  --memory-reservation="400m" \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=America/Edmonton \
  -e MAXMEM=512 \
  -v /opt/ubooquity/config:/config \
  -v /opt/ubooquity/books:/books \
  -v /opt/ubooquity:/main-root \
  -v /opt/ubooquity/books/comics:/comics \
  -v /opt/ubooquity/raw:/files \
  --restart unless-stopped \
  ghcr.io/linuxserver/ubooquity

I learned this by working with docker containers and failing over a 100 times to achieve what I wanna get to. failure is the way to success!!! That is just my vision of learning.