$("#element_id").trigger("change"); //tak działa przy każdej zmianie, również przy autoładowaniu danych
$("#element_id").trigger("change.select2"); //tak działa tylko po kliknięciu na pozycję w menu

 

https://select2.org/programmatic-control/add-select-clear-items

https://select2.org/programmatic-control/events

Codeigniter - Put content in log file Kategoria: Codeigniter | Autor: Bartłomiej Gałęzia

log_message('error', 'Some variable did not contain a value.');

Źródło: https://codeigniter.com/userguide3/general/errors.html

Redmine - Email error "wrong version number" Kategoria: Linux | Autor: Bartłomiej Gałęzia

Email delivery error: SSL_connect returned=1 errno=0 state=error: wrong version number
vim config/configuration.yml

comment line "tls: true"

...
email_delivery:
    delivery_method: :smtp
    smtp_settings:
    #tls: true
    enable_starttls_auto: true
...

Redmine - Migracja i upgrade z 1.4.4 do 4.2.2 Kategoria: Linux | Autor: Bartłomiej Gałęzia

Migracja: old.domena.pl -> new.domena.pl

1. Zrobić zrzut bazy z old.domena.pl

mysqldump -p --user=username database_name > zrzut_bazy.sql

2. Zainstalować aktualną wersję redmine na new.domena.pl

Zobacz całość

"The vast majority of solutions I've read for this say to change the disk controller to IDE (it already was IDE and the original HDD was IDE) or changing to type to PIIX4 or PIIX3 (neither of these appear to change the behaviour)."

Wchodzimy w ustawienia maszyny wirtualnej:

Storage -> Controller: IDE -> Type -> zmień z PIIX4 na PIIX3

Storage -> Controller: SATA -> dysk.vdi -> Remove

Storage -> Controller: IDE -> Add new storage -> disk.vdi

Ok

Start VM

Źródło: https://forums.virtualbox.org/viewtopic.php?f=6&t=83318

 

Jquery upload error Kategoria: PHP | Autor: Bartłomiej Gałęzia

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Rozwiązanie:

wgraj nową wersję pliku UploadHandler.php i skasuj wszystkie foldery upload użytkowników.

Wkhtmltopdf div background color Kategoria: PHP | Autor: Bartłomiej Gałęzia

Acronis - Add local user Kategoria: Linux | Tagi: acronis | Autor: Bartłomiej Gałęzia

Settings -> Account -> Add account -> Serach [username] -> Select the roles of the accounts [Administrator] -> Done

vim /etc/security/acronisagent.conf
[username]

Źródło: https://forum.acronis.com/forum/acronis-backup-125/linux-management-server-only-root-can-log

Debian 10 - SVN server Kategoria: Linux | Tagi: subversion, svn, viewvc | Autor: Bartłomiej Gałęzia

1. Install SVN packages

sudo apt-get install apache2 subversion libapache2-mod-svn libsvn-dev
sudo a2enmod dav
sudo a2enmod dav_svn

Zobacz całość

Dell Intel vPro - How to enable MEBx Kategoria: Sprzęt | Autor: Bartłomiej Gałęzia

After the initial boot screen, the following message is displayed: Press <Ctrl-P> to enter MEBx Setup.
Press Ctrl+P.

https://www.intel.com/content/www/us/en/support/articles/000005897/boards-and-kits/desktop-boards.html

root@testwww:/var/www# aptitude update      
Hit http://deb.debian.org/debian buster InRelease                                                                           
Get: 1 http://deb.debian.org/debian buster-updates InRelease [51,9 kB]
Err http://security.debian.org/debian-security buster/updates InRelease                                                                                                                                                 
  Cannot initiate the connection to debian.map.fastlydns.net:80 (2a04:4e42:62::644). - connect (101: Network is unreachable) Could not connect to debian.map.fastlydns.net:80 (199.232.138.132), connection timed out Cannot initiate the connection to security.debian.org:80 (2a04:4e42:200::644). - connect (101: Network is unreachable) Cannot initiate the connection to security.debian.org:80 (2a04:4e42:400::644). - connect (101: Network is unreachable) Cannot initiate the connection to security.debian.org:80 (2a04:4e42::644). - connect (101: Network is unreachable) Cannot initiate the connection to security.debian.org:80 (2a04:4e42:600::644). - connect (101: Network is unreachable) Could not connect to security.debian.org:80 (151.101.66.132), connection timed out Could not connect to security.debian.org:80 (151.101.194.132), connection timed out Could not connect to security.debian.org:80 (151.101.130.132), connection timed out Could not connect to security.debian.org:80 (151.101.2.132), connection timed out
Fetched 51,9 kB in 1min 1s (846 B/s)
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease: Cannot initiate the connection to debian.map.fastlydns.net:80 (2a04:4e42:62::644). - connect (101: Network is unreachable) Could not connect to debian.map.fastlydns.net:80 (199.232.138.132), connection timed out Cannot initiate the connection to security.debian.org:80 (2a04:4e42:200::644). - connect (101: Network is unreachable) Cannot initiate the connection to security.debian.org:80 (2a04:4e42:400::644). - connect (101: Network is unreachable) Cannot initiate the connection to security.debian.org:80 (2a04:4e42::644). - connect (101: Network is unreachable) Cannot initiate the connection to security.debian.org:80 (2a04:4e42:600::644). - connect (101: Network is unreachable) Could not connect to security.debian.org:80 (151.101.66.132), connection timed out Could not connect to security.debian.org:80 (151.101.194.132), connection timed out Could not connect to security.debian.org:80 (151.101.130.132), connection timed out Could not connect to security.debian.org:80 (151.101.2.132), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.

Rozwiązanie

chmod o+r /etc/resolv.conf

Źródło: https://www.digitalocean.com/community/questions/apt-error-temporary-failure-resolving-deb-debian-org

Występuje przy przełączaniu na php5.6 w ubuntu 20.

Rozwiązanie:

1. ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pass';

2. Na końcu pliku /etc/mysql/my.cnf dodać:

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

[mysqld]
collation-server = utf8_unicode_ci
character-set-server = utf8
default-authentication-plugin=mysql_native_password

redmine Cannot serve directory /opt/redmine/public/: No matching DirectoryIndex
cd /var/www/redmine
gem install passenger
passenger-install-apache2-module

Źródło: https://serverfault.com/questions/859256/redmine-with-apache-403-forbidden

Remote shutdown Windows from Linux Kategoria: Linux | Autor: Bartłomiej Gałęzia

net rpc -S 192.168.1.100 -U [username]%[password] shutdown -t 1 -f

Źródło: https://stackoverflow.com/questions/9936986/shutdown-windows-machine-from-linux-terminal

Ubuntu 18.04 - Static IP netplan Kategoria: Linux | Autor: Bartłomiej Gałęzia

vim /etc/netplan/01-netcfg.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    ens3:
      dhcp4: no
      addresses:
        - 192.168.121.199/24
      gateway4: 192.168.121.1
      nameservers:
          addresses: [8.8.8.8, 1.1.1.1]
sudo netplan apply

źródło: https://linuxize.com/post/how-to-configure-static-ip-address-on-ubuntu-18-04/

PHP - Zmiana wersja w CLI Kategoria: PHP | Autor: Bartłomiej Gałęzia

Java 8 install od Debian 10 Kategoria: Linux | Autor: Bartłomiej Gałęzia

apt-get update
apt-get install software-properties-common

apt-add-repository 'deb http://security.debian.org/debian-security stretch/updates main'
apt-get update

apt-get install openjdk-8-jdk
apt-get update
apt-get install aptitude vim nmap mc screen screenfetch dfc sudo unzip rsync rpm gcc make 
sudo visudo
username ALL=NOPASSWD:ALL
sudo dpkg-reconfigure locales

Install Java 8

https://blog.cssoft.pl/post/java-8-install-od-debian-10

wget -c https://download.acronis.com/AcronisCyberProtect15/Release/AcronisCyberProtect_15_64-bit.x86_64
chmod +x AcronisCyberProtect_15_64-bit.x86_64
./AcronisCyberProtect_15_64-bit.x86_64

After instalation use your root credentials to login to admin panel

http://10.20.30.40:9877

Install agent

Linux:

wget -c https://download.acronis.com/AcronisCyberProtect15/Release/AcronisCyberProtect_15_64-bit.x86_64
chmod +x AcronisCyberProtect_15_64-bit.x86_64
./AcronisCyberProtect_15_64-bit.x86_64

Windows:

https://download.acronis.com/AcronisCyberProtect15/Release/AcronisCyberProtect_15_64-bit.exe

Raspberry Pi zero - take foto every hour Kategoria: Raspberry PI | Autor: Bartłomiej Gałęzia

mkdir -p /scripts/photo
vim /scripts/photo_every_hour.sh
DATE=`date "+%Y.%m.%d_%H.%M.%S"`
DAY=`date "+%Y.%m.%d"`
mkdir -p /scripts/photo/$DAY
/usr/bin/raspistill -n -rot 90 -o /scripts/photo/$DAY/photo_$DATE.jpg

rsync -aogv --log-file=/scripts/RSYNC_LOGS/rsync_photo_$DATE.log /scripts/photo/* pizero@192.168.1.100:/data/pizero/photo/
crontab -e
0 * * * * /scripts/photo_every_hour.sh