Jak zrobić playlistę MP3 do samochodu .m3u Kategoria: | Autor: Bartłomiej Gałęzia

W terminalu przejdź do katalogu z plikami mp3 i wykonaj polecenie:

ls -1 > nazwa_plylisty.m3u
Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Rozwiązanie:

$ sudo mysql -u root -p
MariaDB [(none)]> use nextcloud;
MariaDB [nextcloud]> set global innodb_large_prefix=on;
MariaDB [nextcloud]> set global innodb_file_format=Barracuda;
$ sudo -u www-data php occ maintenance:repair

Źródło: https://help.nextcloud.com/t/solved-syntax-error-or-access-violation-1071-specified-key-was-too-long-max-key-length-is-767-bytes/34740

sudo aptitude brightnessctl
sudo brightnessctl s 50

instalacja

apt-get install xen-tools xen-system-amd64

sprawdzamy czy host obsluguje HVM

egrep '(vmx|svm)' /proc/cpuinfo

jesli tak - doinstalowujemy

apt-get install xen-qemu-dm-4.0

zmieniamy priorytet bootowania sie systemu z jadra z obsluga xen

dpkg-divert --divert /etc/grub.d/08_linux_xen --rename /etc/grub.d/20_linux_xen

Zobacz całość

Nagios 4 na Raspberry Pi 3 B Kategoria: Raspberry PI | Tagi: nagios, nagios4, raspi | Autor: Bartłomiej Gałęzia

aptitude install nagios4 nagios-nrpe-plugin

Po instalacji wystakuje błąd apache2

apache2_reload: Your configuration is broken. Not reloading Apache 2
apache2_reload: AH00526: Syntax error on line 37 of /etc/apache2/conf-enabled/nagios4-cgi.conf:
apache2_reload: Invalid command 'AuthDigestDomain', perhaps misspelled or defined by a module not included in the server configuration

trzeba aktywować 2 modułu apache2 do poprawnego działania:

a2enmod auth_digest
a2enmod authz_groupfile
service apache2 restart

żeby się loga dystrybucji wyświetlały

cp /usr/share/nagios/htdocs/images/logos/base /usr/share/nagios4/htdocs/images/logos/

Logotypy dla ubuntu

wget https://blog.napraw.to/images/nagios_ubuntu_logos.zip
unzip nagios_ubuntu_logos.zip
mv ubuntu.* /usr/share/nagios4/htdocs/images/logos

Zobacz całość

Proftpd + MySQL on Debian 10 Kategoria: Linux | Tagi: ftp, mysql, proftpd | Autor: Bartłomiej Gałęzia

1. Podstawowe paczki

apt-get install aptitude
aptitude update
aptitude install vim nmap mc screen unzip sudo
aptitude install apache2 mariadb-server php php-mbstring php-gd php-curl php-zip php-xml php-imagick php-cgi php-mysql php-pear php-gettext libapache2-mod-php php-common php-phpseclib
mysql_secure_installation
aptitude install proftpd proftpd-mod-mysql

Zobacz całość

Raspberry Pi - Buster - Static IP Kategoria: Raspberry PI | Autor: Bartłomiej Gałęzia

vim /etc/dhcpcd.conf
interface eth0
static ip_address=192.168.1.100/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8
vim /home/www/nextcloud/config/config.php
...
'trashbin_retention_obligation' => 'auto, 30',
...

https://bayton.org/docs/nextcloud/nextcloud-hoarding-trash-how-to-force-automatic-removal-of-deleted-items/

mkdir -p /skrypty/RSYNC_LOGS
mkdir -p /home/backup/databases
mkdir -p /home/backup/etc
mkdir -p /home/backup/skrypty
vim /skrypty/backup_bazy.sh
#!/bin/bash
DATE=`date "+%Y.%m.%d_%H.%M.%S"`                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                    
/usr/bin/mysqldump -uroot -plocalhost [nextclouddb] > /home/backup/databases/[nextclouddb]_$DATE.sql
chmod +x /skrypty/backup_bazy.sh
vim /skrypty/rsync_vps_nas.sh
#!/bin/bash

DATE=`date "+%Y.%m.%d_%H.%M.%S"`

rsync -aogv --log-file=/skrypty/RSYNC_LOGS/rsync_etc_$DATE.log /etc/* /home/backup/etc/
rsync -aogv --log-file=/skrypty/RSYNC_LOGS/rsync_skrypt_$DATE.log /skrypty/* /home/backup/skrypty/
rsync -aogv --exclude '*/.cache*' --log-file=/skrypty/RSYNC_LOGS/rsync_vps_nas_$DATE.log /home/* [rsyncuser]@[rsyncserver]:/home/[rsyncuser]/
chmod +x /skrypty/rsync_vps_nas.sh
ssh-keygen
ssh-copy-id [rsyncuser]@[rsynserver]
cd /skrypty
./backup_bazy.sh
./rsync_vps_nas.sh
crontab -e
0 0 * * * /skrypty/backup_bazy.sh
0 1 * * * /skrypty/rsync_vps_nas.sh

Po zalogowaniu do panelu admina Nextcloud możemy zrobić przegląd serwera czy jest skonfigurowany zgodnie z wymaganiami Nexclouda.

Ustawienia -> Administracja - > Przegląd

https://[nextcloud.domain.com]/index.php/settings/admin/overview

Na dzień dobry dostajemy całą litanię:

Zobacz całość

Wkhtmltopdf - Unwanted Scrollbars Kategoria: PHP | Tagi: wkhtmltopdf | Autor: Bartłomiej Gałęzia

Remove "table-responsive" class from your HTML.

<div class="box box-text table-responsive"> 
<div class="box-header text-center">
<h3 class="box-title">Zrealizowane zadania
</h3> 
</div>

Nextcloud - Clean Trash Kategoria: Nextcloud | Tagi: nextcloud | Autor: Bartłomiej Gałęzia

vim /home/www/nextcloud/config/config.php
'trashbin_retention_obligation' => 'auto

Źródło: https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#deleted-items-trash-bin

Live Ubuntu - No candidate version found for MC Kategoria: Linux | Tagi: mc, ubuntu | Autor: Bartłomiej Gałęzia

sudo add-apt-repository universe
sudo apt update
sudo apt install mc

Źródło: https://askubuntu.com/questions/1071392/how-can-i-install-midnight-commander-on-ubuntu-18-04-1

Windows > Run > diskpart.exe
list disk
select disk 1
clean
create partition primary

Źródło: https://www.youtube.com/watch?v=bHqFaJfpviI

Ubuntu 18.04 - Install Nvidia drivers Kategoria: Linux | Autor: Bartłomiej Gałęzia

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo aptitude update
sudo aptitude install nvidia-drivers-440

https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-18-04-bionic-beaver-linux

Ubuntu 18.04 - Install Xfce or Kubuntu Kategoria: Linux | Autor: Bartłomiej Gałęzia

Xfce

sudo aptitude install xfce4 lightdm

https://linuxconfig.org/install-xfce-desktop-on-ubuntu-18-04-bionic-beaver-linux

KDE

sudo aptitude install kubuntu-desktop

change display manager to sddm

https://vitux.com/how-to-install-the-kde-plasma-desktop-on-ubuntu-18-04-lts/

sudo vim /etc/network/interfaces
auto enp0s3
iface enp0s3 inet static
address 10.1.1.83
netmask 255.0.0.0
gateway 10.1.1.1
dns-nameservers 8.8.8.8 8.8.4.4
sudo ip a flush enp0s3
sudo systemctl restart networking.service

Źródło: https://linuxconfig.org/how-to-configure-static-ip-address-on-ubuntu-18-04-bionic-beaver-linux

$raw_string = preg_replace('/\n\r+/', ' ', $raw_string); // Replace one or multiple new lines with one space:`
$raw_string = preg_replace('/\s+/', ' ', $raw_string); // Replacing multiple spaces with a single space simple single line of php code:

https://escapequotes.net/php-remove-multiple-whitespaces/

Firefox - Disable "This Connection is not Secure" warnings Kategoria: WWW | Tagi: Firefox | Autor: Bartłomiej Gałęzia

about:config
security.insecure_field_warning.contextual.enabled - FALSE

https://www.ghacks.net/2017/06/13/firefox-disable-this-connection-is-not-secure-warnings/

root@pc:~# aptitude purge zoom
The following packages will be REMOVED: 
dconf-cli{u} gir1.2-ibus-1.0{u} ibus{u} libibus-1.0-5{u} libxcb-xtest0{u} zoom{p}
0 packages upgraded, 0 newly installed, 6 to remove and 12 not upgraded.
Need to get 0 B of archives. After unpacking 290 MB will be freed.
Do you want to continue? [Y/n/?]
root@pc:~# aptitude search dconf-cli
i A dconf-cli - simple configuration storage system - utilities
p dconf-cli:i386 - simple configuration storage system - utilities

the first flag "i" tells us that dconf-cli is installed
The next flag "A" stands for automatically installed

root@pc:~# aptitude unmarkauto dconf-cli gir1.2-ibus-1.0 ibus libibus-1.0-5 libxcb-xtest0
root@pc:~# aptitude purge zoom
The following packages will be REMOVED:
zoom{p} 
0 packages upgraded, 0 newly installed, 1 to remove and 12 not upgraded.
Need to get 0 B of archives. After unpacking 246 MB will be freed.
Do you want to continue? [Y/n/?]

 

Source: https://askubuntu.com/questions/17745/how-to-remove-a-deb-without-removing-its-dependencies