aptitude install postgresql postgresql-contrib php-pgsql
check version
sudo -u postgres psql -c "SELECT version();"
vim /etc/postgresql/11/main/pg_hba.conf
local all postgres trust
service postgresql restart
sudo su - postgres -c "createuser miethek" //create user sudo su - postgres -c "createdb empg" //create db
GRANT ALL PRIVILEGES ON DATABASE empg TO miethek;
Połączenie z innych adresów:
vim /etc/postgresql/11/main/postgresql.conf
listen_addresses = '*'
vim /var/lib/pgsql/data/pg_hba.conf
host all all 0.0.0.0/0 md5
service postgresql restart
Źródło: https://linuxize.com/post/how-to-install-postgresql-on-debian-10/
$serverName = "serverName"; $connectionInfo = array( "Database"=>"DbName", "UID"=>"UserName", "PWD"=>"Password", "Encrypt"=>true, "TrustServerCertificate"=>true); $conn = sqlsrv_connect( $serverName, $connectionInfo);
Źródło: https://stackoverflow.com/questions/14959492/connecting-to-mssql-from-php-securely-with-encryption
add-apt-repository ppa:ondrej/php -y apt-get update apt-get install aptitude vim mc nmap curl apache2 php php-dev php-xml php-pear apt-get install unixodbc-dev sudo pecl install sqlsrv sudo pecl install pdo_sqlsrv printf "; priority=20\nextension=sqlsrv.so\n" > /etc/php/8.1/mods-available/sqlsrv.ini printf "; priority=30\nextension=pdo_sqlsrv.so\n" > /etc/php/8.1/mods-available/pdo_sqlsrv.ini phpenmod -v 8.1 sqlsrv pdo_sqlsrv curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list sudo apt-get update sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18 echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc source ~/.bashrc sudo apt-get install -y unixodbc-dev service apache2 restart
sudo apt install libheif-examples for file in *.HEIC; do heif-convert $file ${file%.HEIC}.jpg; done
Źródło: https://ubuntuhandbook.org/index.php/2021/06/open-heic-convert-jpg-png-ubuntu-20-04/
HTML
<div class="new-page"></div>
CSS
@media print { .new-page { page-break-after: always; } }
lub bezpośrednio w HTML
<div style="page-break-after: always;"></div>
Ważne!
Znacznik "new-page" nie może być wewnątrz znacznika <section> bo nie zadziała.
Czasami (np.: na serwerach CyberFolks) trzeba dodaj w komendzie --print-media-type
wkhtmltopdf --print-media-type http://domena.pl/file.html file_pdf.pdf
Przy próbie połączenia przez CURL z Cyber Folks do Zenbox pokazuje się błąd.
"Please wait while your request is being verified..."
"500 Internal Server Error openresty".
Trzeba to zgłosić do Zenboxa, żeby odblokowali IP serwera źródłowego na firewallu.
https://panel.zenbox.pl/index.php?m=pomoc&page=show-ticket&id=1098515
[#QJIV-9351-ECMM] - ticket z 2024.01.11 nr 1314686
yum remove epel-release yum clean all sudo yum -y install yum-utils sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm sudo yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional sudo yum install certbot sudo yum install certbot-nginx
Źródło: https://stackoverflow.com/questions/53545436/no-package-certbot-available
Menu -> Settings -> Keyboard -> Application shortcuts -> [+Add]
dm-tool lock -> Super + L
Źródło: https://askubuntu.com/questions/1242110/after-upgrading-to-ubuntu-20-04-lockscreen-not-working
Tools -> Options -> Editor -> Formatting
Language: All languages
Line wrap: Anywhere
[Apply]
Źródło: https://smallbusiness.chron.com/wrap-lines-netbeans-49331.html
Linux OS
/usr/lib/Acronis/RegisterAgentTool/RegisterAgent -o register -a http://192.168.1.100 -u [username] -p [userpass]
Windows OS
Open Command prompt and navigate to C:\Program Files\Acronis\RegisterAgentTool:
cd "%ProgramFiles%\Acronis\RegisterAgentTool"
Issue this command to register the client machine using account and password:
register_agent.exe -o register -a http://192.168.1.100 -u [username] -p [userpass]
systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
Źródło:
https://www.tecmint.com/disable-suspend-and-hibernation-in-linux/
after aptitude install
W: Possible missing firmware /lib/firmware/nvidia/gp100/gr/sw_method_init.bin for module nouveau W: Possible missing firmware /lib/firmware/nvidia/gp100/gr/sw_bundle_init.bin for module nouveau W: Possible missing firmware /lib/firmware/nvidia/gp100/gr/sw_nonctx.bin for module nouveau W: Possible missing firmware /lib/firmware/nvidia/gp100/gr/sw_ctx.bin for module nouveau W: Possible missing firmware /lib/firmware/nvidia/gp100/gr/gpccs_sig.bin for module nouveau W: Possible missing firmware /lib/firmware/nvidia/gp100/gr/gpccs_data.bin for module nouveau W: Possible missing firmware /lib/firmware/nvidia/gp100/gr/gpccs_inst.bin for module nouveau ...
vim /etc/apt/sources.list
change this
deb http://deb.debian.org/debian/ buster main
to this
deb http://deb.debian.org/debian/ buster main non-free contrib
aptitude update
aptitude install nvidia-detect
nvidia-detect
Detected NVIDIA GPUs: 02:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF100 [GeForce GTX 480] [10de:06c0] (rev a3) Checking card: NVIDIA Corporation GF100 [GeForce GTX 480] (rev a3) Your card is only supported up to the 390 legacy drivers series. It is recommended to install the nvidia-legacy-390xx-driver package.
aptitude install nvidia-legacy-390xx-driver
Źródło: https://linuxconfig.org/how-to-install-nvidia-driver-on-debian-10-buster-linux
1. Stop the VirtualBox machine.
2. Convert VDI Image to RAW Disk Format
vboxmanage clonehd --format RAW /home/user/VirtualBox_VMs/Debian_vm.vdi /home/user/VirtualBox_VMs/Debian_vm.img
3. Copy RAW image to KVM server
rsync -av --progress /home/user/VirtualBox_VMs/Debian_vm.img user@kvmserver:/home/kvm/Debian_vm.img
4. Convert RAW Image Disk Format to KVM Format
qemu-img convert -f raw Debian_vm.img -O qcow2 Debian_vm.qcow2
Źródło: https://www.tecmint.com/migrate-virtualbox-vms-into-kvm-vms/
mkdir /home/images
virsh pool-destroy default
virsh pool-edit default
change
<path>/var/lib/libvirt/images</path>
to
<path>/home/images</path>
virsh pool-start default
Create new pool for ISO files
virsh pool-define-as --name iso --type dir --target /home/iso/ virsh pool-start iso virsh pool-autostart iso
https://ostechnix.com/how-to-change-kvm-libvirt-default-storage-pool-location/
- Shut down the guest machine.
- In the 'Display spice' section, select "All interfaces" instead of 'Localhost only' in "Address"
- Restart the guest machine
Plik konfiguracyjny z wirtualką na XEN
kernel = '/usr/lib/xen-4.8/boot/hvmloader' builder = 'hvm' vcpus = '1' memory = '2048' shadow_memory = 8 localtime = 1 # Disk device(s). disk = [ 'file:/xen/ISO/Boot_media.iso,hdb:cdrom,r', 'phy:/dev/xenvms/restore_disk,xvda,w' ] boot = "dc" # Hostname name = 'system_restore' # Networking vif = [ 'mac=00:11:22:33:44:55,bridge=xenbr0' ] vnc=1 vncconsole=1 vncpasswd='password' vncunused = 1 vnclisten = '192.168.1.1' stdvga = 0 serial = 'pty' usbdevice = 'tablet' # Required for USB mouse ## Behaviour on_shutdown = 'destroy' on_poweroff = 'destroy' on_reboot = 'restart' on_crash = 'restart'
Zobacz całość
Download and unzip:
https://download.sysinternals.com/files/AutoLogon.zip
Run AutoLogon.exe
Type user login and password
Click Enable
Źródło: https://docs.microsoft.com/pl-pl/sysinternals/downloads/autologon
vim /etc/default/grub
GRUB_DEFAULT=saved
update-grub
grub-set-default 2
reboot
instalacja wolumenu
lvcreate -n nazwa_wolumenu -L 100G nazwa_grupy
ściągamu Boot_media.iso (https://kb.acronis.com/getmedia) i kopiujemy z niego kernel i ramdisc
wget -c https://[server.acronis]/Boot_media.iso mount -t iso9660 iso-cd/Boot_media.iso /mnt/iso/ cp /mnt/iso/install.amd/abr64ker.dat /xen/kernels/acronis/abr64ker.dat cp /mnt/iso/install.amd/lin64ram.dat /xen/kernels/acronis/lin64ram.dat
config do instalacji z iso
vim /xen/nazwa_maszyny/nazwa_configa.cfg
kernel = "/xen/kernels/acronis/abr64ker.dat" ramdisk = "/xen/kernels/acronis/lin64ram.dat" vcpus = '1' memory = '512' root = '/dev/xvda1 ro' disk = [ 'phy:/dev/xenvms/nazwa_wolumenu,xvda,w' ,'file:/xen/ISOs/Boot_media.iso,hdc:cdrom,r' ] name = 'nazwa_maszyny' vif = [ 'mac=00:11:22:33:44:55,bridge=xenbr0' ] on_poweroff = 'destroy' on_reboot = 'restart' on_crash = 'restart'
#uruchomienie maszyny z podłączeniem do konsoli
xm create nazwa_configa.cfg -c
1. Hardware check
egrep -c '(vmx|svm)' /proc/cpuinfo grep -E --color '(vmx|svm)' /proc/cpuinfo
2. Install packages
sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virtinst libvirt-daemon virt-manager -y
3. Check libvirt status
sudo systemctl status libvirtd.service
4. Add user to libvirt and libvirt-qemu group
adduser user1 libvirt adduser user1 libvirt-qemu
newgrp libvirt newgrp libvirt-qemu
5. Create bridged network card
vim /etc/network/interfaces
iface enp6s0 inet manual auto br0 iface br0 inet manual bridge_ports enp6s0
https://www.linuxtechi.com/install-configure-kvm-debian-10-buster/
https://www.cyberciti.biz/faq/install-kvm-server-debian-linux-9-headless-server/
bez wpisywania hasła wiele razy