Fedora/Morefine: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
 
(33 intermediate revisions by the same user not shown)
Line 33: Line 33:
  real 13m29.781s
  real 13m29.781s
  user 13m29.619s
  user 13m29.619s
  sys 0m0.111s
  sys   0m0.111s


| valign="top" |
| valign="top" |
  real 87m20.886s
  real 87m20.886s
  user 87m19.900s
  user 87m19.900s
  sys 0m0.261s
  sys   0m0.261s


|-
|-
Line 49: Line 49:
  real 1m27.368s
  real 1m27.368s
  user 1m26.946s
  user 1m26.946s
  sys 0m0.109s
  sys 0m0.109s


| valign="top" |
| valign="top" |
  real 17m34.707s
  real 17m34.707s
  user 17m33.184s
  user 17m33.184s
  sys 0m0.065s
  sys   0m0.065s


|-
|-
Line 65: Line 65:
  real 0m17.441s
  real 0m17.441s
  user 0m17.429s
  user 0m17.429s
  sys 0m0.004s
  sys 0m0.004s


| valign="top" |
| valign="top" |
Line 71: Line 71:
  user 2m5.202s
  user 2m5.202s
  sys 0m0.012s
  sys 0m0.012s
|-
| colspan="2" |
----
'''Orange Pi 5+'''
----
|-
| valign="top" |
real 3m29.216s
user 3m29.106s
sys 0m0.067s
| valign="top" |
real 61m0.638s
user 61m0.325s
sys 0m0.211s
|-
| colspan="2" |
----
'''Yoga Pro 7i G9'''
----
|-
| valign="top" |
real 0m3.159s
user 0m3.153s
sys 0m0.006s
| valign="top" |
real 1m24.837s
user 1m24.813s
sys 0m0.010s


|}
|}
Line 118: Line 150:


==Knowledge==
==Knowledge==
{|
| valign="top" |
  sudo groupadd --system hadoop
  sudo groupadd --system hadoop
  sudo useradd  --system hadoop --gid hadoop --create-home --home-dir /home/hadoop
  sudo useradd  --system hadoop\
  --gid hadoop --create-home --home-dir /home/hadoop
 
  sudo usermod  --move-home --home /home/hadoop hadoop
  sudo usermod  --move-home --home /home/hadoop hadoop


| valign="top" |
  sudo groupadd --system spark
  sudo groupadd --system spark
  sudo useradd  --system spark --gid spark --create-home --home-dir /home/spark
  sudo useradd  --system spark\
  --gid spark --create-home --home-dir /home/spark
 
  sudo usermod  --move-home --home /home/spark spark
  sudo usermod  --move-home --home /home/spark spark
|-
| colspan="2" |
----
|-
| valign="top" |
<syntaxhighlight lang='bash'>
sudo su
su - hadoop
ssh-keygen -q -b 4096 -t rsa -f ~/.ssh/id_rsa -C 'hadoop@ns13-pc05' -N ''
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh hadoop@localhost
</syntaxhighlight>
| valign="top" |
<syntaxhighlight lang='bash'>
sudo su
su - spark
ssh-keygen -q -b 4096 -t rsa -f ~/.ssh/id_rsa -N 'spark@ns13-pc05' -N ''
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh spark@localhost
</syntaxhighlight>
|-
| colspan="2" |
----
|-
| valign="top" |
if ! sudo id -u hadoop &>/dev/null;then echo "$HOME";fi
if  sudo id -u hadoop &>/dev/null;then echo "$HOME";fi
| valign="top" |
if ! sudo id -u spark &>/dev/null;then echo "$HOME";fi
if  sudo id -u spark &>/dev/null;then echo "$HOME";fi
|-
| colspan="2" |
----
|-
| valign="top" |
while true;do du -sh /var/hadoop;sleep 10;done
stat -c '%a %n' /var/hadoop/hadoop-3.3.4/etc/env
| valign="top" |
while true;do du -sh /var/spark;sleep 10;done
ls -lAh /var/hadoop/hadoop-3.3.4/etc/
|-
| colspan="2" |
----
|-
| valign="top" |
sudo journalctl -xeu hadoop.service
sudo systemctl  cat  hadoop.service
sudo systemctl  show hadoop.service
sudo systemctl  edit hadoop.service
sudo systemctl daemon-reload
| valign="top" |
sudo journalctl -xeu spark.service
sudo systemctl  cat  spark.service
sudo systemctl  show spark.service
sudo systemctl  edit spark.service
sudo systemctl daemon-reload
|-
| colspan="2" |
----
|-
| valign="top" |
cat /etc/selinux/config
sudo setenforce 0
| valign="top" |
getenforce
sestatus
|-
| colspan="2" |
----
|-
| valign="top" |
sudo ss -tulpn | grep LISTEN
sudo ss -tulwn | grep LISTEN
| valign="top" |
curl localhost:9000
curl 127.0.0.1:9000
|-
| colspan="2" |
----
|-
| valign="top" |
sudo systemctl disable firewalld
sudo systemctl enable  firewalld
| valign="top" |
sudo systemctl start firewalld
sudo systemctl stop  firewalld
|-
| colspan="2" |
----
|-
| valign="top" |
sudo systemctl  disable httpd.service
sudo systemctl  stop httpd.service
sudo rpm-ostree install nginx
sudo systemctl reboot
| valign="top" |
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload
sudo systemctl enable nginx
sudo systemctl start nginx
|-
| colspan="2" |
----
|-
| valign="top" |
'''debian like:'''
sudo addgroup --quiet --system '''chorke'''
sudo adduser  --quiet --system --home '/home/'''chorke'''' --shell '/bin/bash'\
  --ingroup '''chorke''' --disabled-password '''chorke'''
su - '''chorke'''
| valign="top" |
'''fedora like:'''
sudo groupadd --system '''chorke'''
sudo useradd  --system '''chorke''' --gid '''chorke''' --create-home\
  --home-dir '/home/'''chorke''''
su - '''chorke'''
|}


==References==
==References==
Line 141: Line 318:


| valign="top" |
| valign="top" |
* [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec_configuring_host_names_using_hostnamectl Configuring Host Names Using <code>hostnamectl</code>]
* [https://stackoverflow.com/questions/20797819/ Change the default home directory of a user]
* [https://stackoverflow.com/questions/20797819/ Change the default home directory of a user]
* [https://unix.stackexchange.com/questions/395059/ WiFi Stop MAC address from changing]
* [https://unix.stackexchange.com/questions/395059/ WiFi Stop MAC address from changing]
* [https://stackoverflow.com/questions/48440673/ Switch Between Terminals in VSCode]
* [https://stackoverflow.com/questions/28042251/ CPU Benchmarks Against Others]
* [https://stackoverflow.com/questions/28042251/ CPU Benchmarks Against Others]
* [https://serverfault.com/questions/283129/ SSH Connection Hang Forever]
* [https://serverfault.com/questions/283129/ SSH Connection Hang Forever]
Line 153: Line 330:


| valign="top" |
| valign="top" |
* [https://www.redhat.com/sysadmin/setting-reverse-proxies-nginx Fedora » Setting up reverse proxies with Nginx]
* [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec_configuring_host_names_using_hostnamectl Configuring Host Names Using <code>hostnamectl</code>]
* [https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-firewalld-on-centos-7 Fedora » Set Up a Firewall Using FirewallD]
* [https://unix.stackexchange.com/questions/26284/ Replace a Multi-Line String using <code>sed</code>]
* [https://dev.to/aws-builders/ssh-setup-and-tunneling-via-bastion-host-3kcc AWS » Bastion Host SSH Tunneling]
* [[Bastion SSH Tunneling]]
* [https://docs.rackspace.com/support/how-to/install-nginx-on-fedora/ Fedora » Install Nginx]
* [[Alpine/Morefine]]


|-
|-

Latest revision as of 03:39, 7 July 2024

Server Config

sudo rpm-ostree install postgresql-server
sudo rpm-ostree install mariadb-server
sudo rpm-ostree install httpd
sudo systemctl enable httpd.service
sudo systemctl start httpd.service
ls -lah /usr/lib/systemd/system/
sudo firewall-cmd --permanent --add-service=http
sudo setsebool -P httpd_can_network_connect on
sudo firewall-cmd --add-service=http

Benchmarks

time openssl dhparam -out ~/dh2048.pem 2048
time openssl dhparam -out ~/dh4096.pem 4096

Raspberry Pi4


real	13m29.781s
user	13m29.619s
sys	  0m0.111s
real	87m20.886s
user	87m19.900s
sys	  0m0.261s

Morefine M8S


real	1m27.368s
user	1m26.946s
sys	 0m0.109s
real	17m34.707s
user	17m33.184s
sys	  0m0.065s

Legion 5Pro


real	0m17.441s
user	0m17.429s
sys	 0m0.004s
real	2m5.231s
user	2m5.202s
sys	0m0.012s

Orange Pi 5+


real	3m29.216s
user	3m29.106s
sys	 0m0.067s
real	61m0.638s
user	61m0.325s
sys	 0m0.211s

Yoga Pro 7i G9


real	0m3.159s
user	0m3.153s
sys	0m0.006s
real	1m24.837s
user	1m24.813s
sys	0m0.010s

Fedora 37 Fixes

sudo ostree remote add --if-not-exists\
 --gpg-import=/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-37-x86_64\
 fedora-iot-mirrorlist https://d2ju0wfl996cmc.cloudfront.net

backupDir="$HOME/backups/etc_ostree_remotes_d/" && mkdir -p $backupDir\
 && cp /etc/ostree/remotes.d/fedora-iot.conf $backupDir

sudo ostree remote delete fedora-iot
deployment="$(ls -Art /sysroot/ostree/deploy/fedora-iot/deploy | tail -n 1)";\
/sysroot/ostree/deploy/fedora-iot/deploy/$(echo "${deployment%%*(.origin)}")/usr/lib/greenboot/check/wanted.d/01_update_platforms_check.sh

sudo rpm-ostree rebase fedora-iot-mirrorlist:fedora/devel/x86_64/iot
sudo rpm-ostree upgrade -r

Fedora 37 OSTree

rpm-ostree install wget httpd
rpm-ostree install python3 python3-pip python-is-python3
rpm-ostree install make automake gcc gcc-c++ kernel-devel
rpm-ostree install java-1.8.0-openjdk java-1.8.0-openjdk-devel
rpm-ostree install java-11-openjdk java-11-openjdk-devel
rpm-ostree install java-17-openjdk java-17-openjdk-devel

hostnamectl set-hostname ns13-pc05
rpm-ostree install redis
rpm-ostree install upx
alternatives --config javac
alternatives --config java
hostnamectl status

Knowledge

sudo groupadd --system hadoop
sudo useradd  --system hadoop\
 --gid hadoop --create-home --home-dir /home/hadoop
sudo usermod  --move-home --home /home/hadoop hadoop
sudo groupadd --system spark
sudo useradd  --system spark\
 --gid spark  --create-home --home-dir /home/spark
sudo usermod  --move-home --home /home/spark spark

sudo su
su - hadoop
ssh-keygen -q -b 4096 -t rsa -f ~/.ssh/id_rsa -C 'hadoop@ns13-pc05' -N ''
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh hadoop@localhost
sudo su
su - spark
ssh-keygen -q -b 4096 -t rsa -f ~/.ssh/id_rsa -N 'spark@ns13-pc05' -N ''
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh spark@localhost

if ! sudo id -u hadoop &>/dev/null;then echo "$HOME";fi
if   sudo id -u hadoop &>/dev/null;then echo "$HOME";fi
if ! sudo id -u spark &>/dev/null;then echo "$HOME";fi
if   sudo id -u spark &>/dev/null;then echo "$HOME";fi

while true;do du -sh /var/hadoop;sleep 10;done
stat -c '%a %n' /var/hadoop/hadoop-3.3.4/etc/env
while true;do du -sh /var/spark;sleep 10;done
ls -lAh /var/hadoop/hadoop-3.3.4/etc/

sudo journalctl -xeu hadoop.service
sudo systemctl  cat  hadoop.service
sudo systemctl  show hadoop.service
sudo systemctl  edit hadoop.service
sudo systemctl daemon-reload
sudo journalctl -xeu spark.service
sudo systemctl  cat  spark.service
sudo systemctl  show spark.service
sudo systemctl  edit spark.service
sudo systemctl daemon-reload

cat /etc/selinux/config 
sudo setenforce 0
getenforce
sestatus

sudo ss -tulpn | grep LISTEN
sudo ss -tulwn | grep LISTEN
curl localhost:9000
curl 127.0.0.1:9000 

sudo systemctl disable firewalld
sudo systemctl enable  firewalld
sudo systemctl start firewalld
sudo systemctl stop  firewalld

sudo systemctl  disable httpd.service
sudo systemctl  stop httpd.service
sudo rpm-ostree install nginx
sudo systemctl reboot
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload
sudo systemctl enable nginx
sudo systemctl start nginx

debian like:
sudo addgroup --quiet --system chorke
sudo adduser  --quiet --system --home '/home/chorke' --shell '/bin/bash'\
 --ingroup chorke --disabled-password chorke

su - chorke
fedora like:
sudo groupadd --system chorke
sudo useradd  --system chorke --gid chorke --create-home\
 --home-dir '/home/chorke'

su - chorke

References