I would like to upgrade kernel on diskless machine.

First upgrade system as regular one:

yum upgrade

Copy new installed initramfs and vmlinuz files somewhere, I've copied them directly to TFTP server

scp /boot/vmlinuz-3.10.0-1127.19.1.el7.x86_64 /boot/initramfs-3.10.0-1127.19.1.el7.x86_64.img 192.168.1.28:

as you can see my TFTP (and also PXE/iSCSI) server is 192.168.1.28.

Then you have to expose new files via TFTP server and modify PXE config files.

My TFTP server files are in /data/tftpboot, and I've decided to store boot files in /networkboot/CentOS7-2003 directory so:

mkdir /data/tftpboot/networkboot/CentOS7-2003
mv ~/initramfs-3.10.0-1127.19.1.el7.x86_64.img ~/vmlinuz-3.10.0-1127.19.1.el7.x86_64 /data/tftpboot/networkboot/CentOS7-2003

You can edit /data/tftpboot/pxelinux.cfg/default. I've per-machine PXE config files that's why I added to /data/tftpboot/pxelinux.cfg/4c4c4544-0042-4410-8053-b2c04f43334a instead of default:

LABEL Centos7-Optiplex745-3.10.0-1127.19.1
MENU LABEL CentOS 7 DELL Optiplex 745 (3.10.0-1127.19.1)
kernel /networkboot/CentOS7-2003/vmlinuz-3.10.0-1127.19.1.el7.x86_64 root=/dev/mapper/centos00-root ro netroot=iscsi:@192.168.1.28::::iqn.1994-11.com.netgear:nas:08303042:centos-pxe rd.iscsi.initiator=iqn.1994-05.com.redhat:2f3474eec735 vconsole.keymap=pl LANG=en_GB.UTF-8  console=tty0 ip=enp3s0:dhcp  rhgb quiet
append initrd=/networkboot/CentOS7-2003/initramfs-3.10.0-1127.19.1.el7.x86_64.img

as you can see kernel and initrd are updated to point at new files.

When You test that system boots from this new config you can change set it as default.

Sometimes it's useful to add some text in document which shouldn't be printed. Then you can mark some text or even paragraph as hidden.

To show hidden text while you are editing document you can check Hidden text checkbox. You can find it in menu Tools -> Option on OpenOffice Writer -> Formatting Aids.

To change power button behaviour in CentOS I've created file /etc/dconf/db/local.d/01-power:

[org/gnome/settings-daemon/plugins/power]
power-button-action='interactive'

and restart or update dconf:

dconf update

Sources: Changing Behavior when Pressing the Power Button in Graphical Target Mode

The easiest way to set up own Jitsi meet server is containerization (see Jitsi in docker).

When you would like to change logo watermark you can use this method. It will work only in this instance of docker. You can stop / start container, but when you destroy it (i.e.: docker-compose down) the changes will gone.

Copy new file (original dimensions are 612x272) to your docker server and place in directory:

~/.jitsi-meet-cfg/web/

check id / name of your web container, i.e.:

[docker@docker jitsi-meet]# docker-compose ps
         Name          Command   State                        Ports
------------------------------------------------------------------------------------------------
jitsi-meet_jicofo_1    /init     Up
jitsi-meet_jvb_1       /init     Up      0.0.0.0:10000->10000/udp, 0.0.0.0:4443->4443/tcp
jitsi-meet_prosody_1   /init     Up      5222/tcp, 5269/tcp, 5280/tcp, 5347/tcp
jitsi-meet_web_1       /init     Up      0.0.0.0:8443->443/tcp, 0.0.0.0:8000->80/tcp

as you can see in my case it is the jitsi-meet_web_1.

Execute bash inside container:

docker exec -it jitsi-meet_web_1 /bin/bash

replace original watermark

cd /usr/share/jitsi-meet/images/
mv watermark.png watermark.png-old
cp /config/new-logo.png watermark.png

it's not necessary, but I've saved Jitsi watermark as watermark.png-old.

That's all.

You can also check ~/.jitsi-meet-cfg/web/interface_config.js file for other parameters.

Nowadays everybody use some conferencing systems. If you would like to have your own, on controlled infrastructure, maybe only in LAN/VPN environment you can try Jitsi.

The "demo" installation in CentOS 7 based on docker containers is quite simple.

Install docker and docker-compose

If you already have docker installed skip this step. You can also read Docker in CentOS 7 in 5 steps.

curl -fsSL https://get.docker.com/ | sh
systemctl start docker
systemctl enable docker
curl -L "https://github.com/docker/compose/releases/download/\
1.23.1/docker-compose-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

Prepare environment

Install GIT
yum install git
Download docker files
git clone https://github.com/jitsi/docker-jitsi-meet && cd docker-jitsi-meet
Prepare directories
mkdir -p ~/.jitsi-meet-cfg/{web/letsencrypt,transcripts,prosody,jicofo,jvb}
cp env.example .env
Needed modifications

If you want to use it in LAN/separated network you have to change

DOCKER_HOST_ADDRESS=192.168.1.89
JVB_STUN_SERVERS=

in .env file. Of course DOCKER_HOST_ADDRESS will be YOUR docker IP address.

If you not set JVB_STUN_SERVERS to null value you won't be able to join the conference. You can change it later in

~/.jitsi-meet-cfg/jvb/sip-communicator.properties file.

Configure firewall

cat <<EOF > /etc/firewalld/services/jitsi.xml
<?xml version="1.0" encoding="utf-8"?>
<service>
  <short>Jitsi</short>
  <description>Multi-platform open-source video conferencing system</description>
  <port protocol="tcp" port="8000"/>
  <port protocol="tcp" port="8443"/>
  <port protocol="tcp" port="4443"/>
  <port protocol="udp" port="10000"/>
</service>
EOF

firewall-cmd --reload
firewall-cmd --add-service jitsi
firewall-cmd --permanent --add-service jitsi
Start all
docker-compose -f docker-compose.yml -f etherpad.yml up -d

As you can see I've also added etherpad - for document sharing.

Thin installation was tested on CentOS 7 nad CentOS 8

Prepare system

You will need java:

yum install java-1.8.0-openjdk-headless

Create dedicated user

useradd --system --create-home --user-group \
--home-dir /opt/minecraft --shell /bin/bash minecraft

or shorter

useradd -r -m -U -d /opt/minecraft -s /bin/bash minecraft

Configure firewall

Create new service mincecraft-server file:

cat << EOF > /etc/firewalld/services/minecraft-server.xml
<?xml version="1.0" encoding="utf-8"?>
<service>
  <short>Minecraft server</short>
  <port port="25565" protocol="tcp"/>
  <port port="25575" protocol="tcp"/>
</service>
EOF

Then reload to read new service, enable it and reload to apply changes.

firewall-cmd --reload
firewall-cmd --add-service=minecraft-server --permanent
firewall-cmd --reload

Prepare directories

su - minecraft
mkdir -p ~/{backups,tools}
mkdir server-1.12.2
mkdir server-1.15.2

Download JAR files

I'm preparing two versions: 1.12.2 and 1.15.2:

cd ~/server-1.15.2
wget "https://launcher.mojang.com/v1/objects/bb2b6b1aefcd70dfd1892149ac3a215f6c636b07/server.jar" -O minecraft_server.1.15.2.jar
ln -s minecraft_server.1.15.2.jar server.jar
echo eula=true > eula.txt
cd ~/server-1.12.2
wget https://launcher.mojang.com/mc/game/1.12.2/server/886945bfb2b978778c3a0288fd7fab09d315b25f/server.jar -O minecraft_server-1.12.2.jar
ln -s minecraft_server-1.12.2.jar server.jar
echo eula=true > eula.txt

Now you have to chose one. In my example 1.12.2:

cd
ln -s server-1.12.2 server

later you can remove this link and create it to another version, ie:

cd
rm server
ln -s server-1.15.2 server

Configure RCON

Not necessary. Run all command as a "root" user.

Install packages
yum group install "Development Tools"
yum install kernel-debug
Download and compile
wget https://github.com/Tiiffi/mcrcon/archive/master.zip
cd /tmp/
unzip ~/master.zip
cd mcrcon-master/
gcc -std=gnu11 -pedantic -Wall -Wextra -O2 -s -o mcrcon mcrcon.c
cp ./mcrcon /opt/minecraft/tools/
chown minecraft.minecraft /opt/minecraft/tools/mcrcon

If you want to use RCON you have to adjust /opt/minecraft/server/server.properties file:

enable-rcon=true
rcon.password=strong-password

of course change strong-password to some strong password ;-)

Startup script

Create serivce file as root:

cat << EOF > /etc/systemd/system/minecraft.service
[Unit]
Description=Minecraft Server
After=network.target

[Service]
User=minecraft
Nice=1
KillMode=none
SuccessExitStatus=0 1
ProtectHome=true
ProtectSystem=full
PrivateDevices=true
NoNewPrivileges=true
WorkingDirectory=/opt/minecraft/server
ExecStart=/usr/bin/java -Xmx1024M -Xms512M -jar server.jar nogui
ExecStop=/opt/minecraft/tools/mcrcon -H 127.0.0.1 -P 25575 -p strong-password stop


[Install]
WantedBy=multi-user.target
EOF

Run

systemctl start minecraft

You can check /opt/minecraft/server/logs/latest.log to see what is happening.

You should see something like this:

[22:09:52] [Server thread/INFO]: Starting minecraft server version 1.12.2
[22:09:52] [Server thread/INFO]: Loading properties
[22:09:52] [Server thread/WARN]: server.properties does not exist
[22:09:52] [Server thread/INFO]: Generating new properties file
[22:09:52] [Server thread/INFO]: Default game type: SURVIVAL
[22:09:52] [Server thread/INFO]: Generating keypair
[22:09:53] [Server thread/INFO]: Starting Minecraft server on *:25565
[22:09:53] [Server thread/INFO]: Using epoll channel type
[22:09:53] [Server thread/INFO]: Preparing level "world"
[22:09:54] [Server thread/INFO]: Loaded 488 advancements
[22:09:55] [Server thread/INFO]: Preparing start region for level 0
[22:09:56] [Server thread/INFO]: Preparing spawn area: 5%
[22:09:57] [Server thread/INFO]: Preparing spawn area: 8%
[22:09:58] [Server thread/INFO]: Preparing spawn area: 13%
[22:09:59] [Server thread/INFO]: Preparing spawn area: 17%
[22:10:00] [Server thread/INFO]: Preparing spawn area: 22%
[22:10:01] [Server thread/INFO]: Preparing spawn area: 28%
[22:10:02] [Server thread/INFO]: Preparing spawn area: 32%
[22:10:03] [Server thread/INFO]: Preparing spawn area: 37%
[22:10:04] [Server thread/INFO]: Preparing spawn area: 42%
[22:10:05] [Server thread/INFO]: Preparing spawn area: 48%
[22:10:06] [Server thread/INFO]: Preparing spawn area: 53%
[22:10:07] [Server thread/INFO]: Preparing spawn area: 59%
[22:10:08] [Server thread/INFO]: Preparing spawn area: 65%
[22:10:09] [Server thread/INFO]: Preparing spawn area: 70%
[22:10:11] [Server thread/INFO]: Preparing spawn area: 75%
[22:10:12] [Server thread/INFO]: Preparing spawn area: 80%
[22:10:13] [Server thread/INFO]: Preparing spawn area: 86%
[22:10:14] [Server thread/INFO]: Preparing spawn area: 90%
[22:10:15] [Server thread/INFO]: Preparing spawn area: 96%
[22:10:15] [Server thread/INFO]: Done (22.459s)! For help, type "help" or "?"

As you can see first start took more than 22s (not to bad - it's Core 2 Duo and iSCSI disk on 1GB network card - CentOS 8 version of Diskless computer using PXE and iSCSI)

Configure autostart

If you want to start Minecraf server automatically when system starts, just enable this service:

systemctl enable minecraft

That's all.

When you want to use both of them to have to decide to which the clients will be connecting to. In my case packets goes to Dansguardian and then to Squid and finally to internet.

In standard configuration only Dansguardian knows clients IPs.

To provide user's IPs to Squid change Dansguardian configuration to forward them - change in dansguardian.conf (or dansguardianf1.conf, or whatever you have):

forwardedfor = on
usexforwardedfor = on

Be careful - if you don't use Squid (or some other secure proxy) you can publish you private IP addresses to whole world.

Then change Squid configuration (squid.conf) to allow to find the original source:

follow_x_forwarded_for allow localhost

Of course restart both services.

It's pretty simple, but I forgot about this.

Install chromaprint:

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
yum install libchromaprint

You have to use epel-release-latest (not epel-release) not to get:

Problem: package ffmpeg-4.2.1-3.el8.x86_64 requires libavdevice.so.58()(64bit), but none of the providers can be installed
  - package ffmpeg-4.2.1-3.el8.x86_64 requires libavdevice.so.58(LIBAVDEVICE_58)(64bit), but none of the providers can be installed
  - conflicting requests
  - nothing provides libjack.so.0()(64bit) needed by libavdevice-4.2.1-3.el8.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

Install beet

pip3 install beets
pip3 install pyacoustid

Enable plugins:

echo "plugins: duplicates chroma"  >> .config/beets/config.yaml

Install fpcalc

cd /tmp
wget "https://github.com/acoustid/chromaprint/releases/download/v1.4.3/chromaprint-fpcalc-1.4.3-linux-x86_64.tar.gz"
cd /usr/local/bin/
tar -xzf /tmp/chromaprint-fpcalc-1.4.3-linux-x86_64.tar.gz
ln -s chromaprint-fpcalc-1.4.3-linux-x86_64/fpcalc .

Install ffmpeg (RPM Fusion, How To Install FFmpeg on CentOS 8, How to turn CentOS 8 into a perfect desktop):

yum install --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm
yum install --nogpgcheck https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm
yum config-manager --enable PowerTools
yum config-manager --enable epel-testing
yum config-manager --enable rpmfusion-free-updates-testing
yum install ffmpeg

Now beet can fingerprint files:

beet fingerprint

Download image and extract files into some directory. I had to use separate machine, so I copied files to my ftp server (192.168.1.28).

mount -o loop /tmp/CentOS-8-x86_64-1905-boot.iso /mnt/iso
scp -r * admin@192.168.1.28:/data/pub/CentOS-8.0.1905-boot
umount /mnt/iso

On my tftp/ftp server:

mkdir /data/tftpboot/networkboot/CentOS8-1905
cp /data/pub/CentOS-8.0.1905-boot/images/pxeboot/vmlinuz \
          /data/tftpboot/networkboot/CentOS8-1905/
cp /data/pub/CentOS-8.0.1905-boot/images/pxeboot/initrd.img \
          /data/tftpboot/networkboot/CentOS8-1905/

Add entry to PXE configuration (in my case /data/tftpboot/pxelinux.cfg/default):

LABEL InstallCentOS-8.0.1905
MENU LABEL Install CentOS 8 1905
kernel /networkboot/CentOS8-1905/vmlinuz
APPEND initrd=/networkboot/CentOS8-1905/initrd.img \
          ip=dhcp \
          inst.repo=ftp://192.168.1.28/CentOS-8.0.1905-boot

Source:
https://docs.centos.org/en-US/8-docs/advanced-install/assembly_preparing-for-a-network-install/

You will need BLED112 dongle and pylgbst library.

yum install python3
pip3 install pygatt
pip3 install pexpect
pip3 install https://github.com/undera/pylgbst/archive/1.0.tar.gz

now you can write your first program test.py:

from pylgbst.hub import MoveHub, COLOR_RED
from time import sleep

hub = MoveHub()
hub.led.set_color(COLOR_RED)
sleep(5)
hub.disconnect()

and test it:

python3 test.py

The LED has been changed to red for 5 seconds.

Ten kto umie pisze kod, ten kto nie umie pisze książki..., albo blog.

Pon Wt Śr Czw Pt So N
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            
eZ Publish™ copyright © 1999-2025 eZ Systems AS