Disable tombol download HTML5 video
<video width="600" height="350" controls controlsList="nodownload">
<source data-src="video1.ogg" type="video/mp4">
</video>
Open Source Software in My Daily Life
<video width="600" height="350" controls controlsList="nodownload">
<source data-src="video1.ogg" type="video/mp4">
</video>
# virsh dumpxml <GuestName>
contoh:
# virsh dumpxml Digitos_U22_5
<domain type='kvm'>
<name>Digitos_U22_5</name>
<uuid>0d737f69-3200-440f-8117-8506bacde339</uuid>
<metadata xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0" xmlns:cockpit_machines="https://github.com/cockpit-project/cockpit-machines">
<libosinfo:libosinfo>
<libosinfo:os id="http://ubuntu.com/ubuntu/22.04"/>
</libosinfo:libosinfo>
<cockpit_machines:data>
<cockpit_machines:has_install_phase>false</cockpit_machines:has_install_phase>
<cockpit_machines:install_source_type>file</cockpit_machines:install_source_type>
<cockpit_machines:install_source>/server_images/ubuntu-22.04.3-live-server-amd64.iso</cockpit_machines:install_source>
<cockpit_machines:os_variant>ubuntu22.04</cockpit_machines:os_variant>
</cockpit_machines:data>
</metadata>
<memory unit='KiB'>2097152</memory>
<currentMemory unit='KiB'>2097152</currentMemory>
<vcpu placement='static'>2</vcpu>
<os>
<type arch='x86_64' machine='pc-q35-rhel8.6.0'>hvm</type>
</os>
<features>
<acpi/>
<apic/>
<vmport state='off'/>
</features>
<cpu mode='host-model' check='partial'/>
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<pm>
<suspend-to-mem enabled='no'/>
<suspend-to-disk enabled='no'/>
</pm>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native'/>
<source dev='/dev/vmdiskpool/vmdisk5'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
</disk>
...
Terlihat bahwa disk image ada di : /dev/vmdiskpool/vmdisk5
# virt-df -h
Misalnya :
# virt-df -h -a /dev/vmdiskpool/vmdisk5
Filesystem Size Used Available Use%
vmdisk5-100g:/dev/sda2 1.7G 130M 1.5G 8%
vmdisk5-100g:/dev/ubuntu-vg/ubuntu-lv
8.0G 4.2G 3.4G 53%
lvrename /dev/vmdiskpool/vmdisk5 /dev/vmdiskpool/vmdisk5.backup
# lvcreate -L <new-size>G -n <nama-disk> <disk-pool>/dev/vg_guests
contoh:
# lvcreate -L 100G -n vmdisk5 /dev/vmdiskpool
Bagi yang belum terinstall virt-resize, untuk pengguna Ubuntu, Debian dapat memasangnya sbb:
# apt-get install libguestfs-tools
Berikut penggunaannya:
# virt-resize /dev/vmdiskpool/vmdisk5-backup /dev/vmdiskpool/vmdisk5 --resize /dev/sda2=1.8G --expand /dev/sda3 --LV-expand /dev/ubuntu-vg/ubuntu-lv
Output nya kira-kira akan seperti ini:
[ 0.0] Examining /dev/vmdiskpool/vmdisk5-backup
**********
Summary of changes:
/dev/sda1: This partition will be left alone.
/dev/sda2: This partition will be resized from 1.8G to 1.8G. The
filesystem ext4 on /dev/sda2 will be expanded using the ‘resize2fs’
method.
/dev/sda3: This partition will be resized from 8.2G to 98.2G. The LVM PV
on /dev/sda3 will be expanded using the ‘pvresize’ method.
/dev/ubuntu-vg/ubuntu-lv: This logical volume will be expanded to maximum
size. The filesystem ext4 on /dev/ubuntu-vg/ubuntu-lv will be expanded
using the ‘resize2fs’ method.
**********
[ 3.7] Setting up initial partition table on /dev/vmdiskpool/vmdisk5
[ 14.9] Copying /dev/sda1
[ 14.9] Copying /dev/sda2
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
[ 18.7] Copying /dev/sda3
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
[ 46.2] Expanding /dev/sda2 using the ‘resize2fs’ method
[ 46.3] Expanding /dev/sda3 using the ‘pvresize’ method
[ 46.3] Expanding /dev/ubuntu-vg/ubuntu-lv using the ‘resize2fs’ method
Resize operation completed with no errors. Before deleting the old disk,
carefully check that the resized disk boots and works correctly.
Reference:
Default
# mysqldump --no-create-info --complete-insert --insert-ignore pintar_db > pintar_db-20230824-2208.insert-ignore.data
File backup yang dihasilkan:
mysqldump --no-create-info --replace pintar_db > pintar_db-20230827-1554.replace.data
File backup yang dihasilkan:
Jika Anda akan dumping tabel-tabel t1, t2, dan t3 dari mydb:
mysqldump -u... -p... mydb t1 t2 t3 > mydb_tables.sql
Sebaliknya, Jika Anda akan dumping semua tabel kecuali tabel-tabel t1, t2, dan t3 dari mydb:
DBTODUMP=mydb
SQL="SET group_concat_max_len = 10240;"
SQL="${SQL} SELECT GROUP_CONCAT(table_name separator ' ')"
SQL="${SQL} FROM information_schema.tables WHERE table_schema='${DBTODUMP}'"
SQL="${SQL} AND table_name NOT IN ('t1','t2','t3')"
TBLIST=`mysql -u... -p... -AN -e"${SQL}"`
mysqldump -u... -p... ${DBTODUMP} ${TBLIST} > mydb_tables.sql
Note: Anda dapat mengubah SQL="${SQL} AND table_name NOT IN ('t1','t2','t3')" to SQL="${SQL} AND table_name NOT LIKE 'foo\_%'". Anda juga dapat mengganti kondisi menjadi ‘%foo%’ untuk mendapatkan semua table yang menggandung kosa-kata ‘foo’ dalam nama tabelnya (termasuk didalamnya seperti: ‘food’, ‘fool’, dst).
Cara lain jika Anda akan dumping semua tabel kecuali tabel-tabel t1, t2, dan t3 dari mydb:
mysqldump -uusername -ppassword dbname \
--ignore-table=schema.t1 \
--ignore-table=schema.t2 \
--ignore-table=schema.t3 > mysqldump.sql
File backup yang dihasilkan:
References:
Plugin ini tergolong sudah tua, latest release saat tulisan ini dibuat adalah 4 tahun yang lalu. Walaupun demikian plugins ini tetap bisa digunakan, walaupun Anda tetap perlu memastikannya.
Plugin yang digunakan : Backup and Restore Command-Line Interface
Admin tools ::: tool_brcli
Plugin site : BrCLI
Tujuan penggunaan:
Melakukan backup dan restore courses yang berada pada/ke sebuah course category.
Courses yang berada pada category yang dipilih akan dibuat backup sebuah file *mbz untuk masing-masing course
Sedangkan untuk restore, file-file course-backup (*.mbz) harus berada pada sebuah direktory/folder tertentu dan akan menuju ke category_id tertentu pula
Pengertian role di postgresql
Roles ini berbeda dengan pengertian role di sistem operasi Unix. Disini tidak ada pembedaan antara users dan groups. Roles dapat diubah-ubah, dan lebih flexible. Misalnya role dapat menjadi anggota dari role yang lain. Role juga dapat memiliki objek dan access control terhadap object2 tersebut. Secara default setiap user memiliki role sendiri.
Melihat user yang sudah ada :
postgres=# SELECT rolname FROM pg_roles; rolname ---------- postgres (1 row)
Sebuah role adalah entitas yang dapat memiliki objek database, dan memiliki wewenang terhadap database. Role juga dapat dianggap seperti sebuah “user”, sebuah “group” atau keduanya sekaligus tergantung bagaimana menggunakannya.
Membuat user baru artinya sama dengan membuat role baru :
postgres=# CREATE ROLE admin; CREATE ROLE postgres=# SELECT rolname FROM pg_roles; rolname ---------- postgres admin (2 rows)
Sekarang terlihat sudah ada 2 buah user/role : postgres dan admin.
Memberikan password pada user/role :
postgres=# ALTER ROLE admin WITH PASSWORD 'adminpassword'; ALTER ROLE
Syntax dasar perintah rsync
# rsync options source destination
Beberapa opsi (options) dari perintah rsync yang dapat kita manfaatkan, antara lain
Contoh copy secara lokal server
rsync -zvh contoh.tar.gz /tmp/backups/
Contoh 1 copy ke remote server
rsync -avzh /root/rpmpkgs [email protected]:/direktoritujuan
Jika file yang akan dicopy berukuran cukup besar, maka apabila proses copy terputus ditengah jalan, jangan khawatir, rsync akan meneruskan atau melanjutkan sisa yang belum tercopy .
Contoh 2 copy ke remote server
rsync -avu --progress /var/www/moodle-data [email protected]:/data/
Perintah ini akan membuat direktori moodle-data di bawah direktori /data pada tempat tujuan copy, sekaligus menyalin seluruh isinya
Contoh 3 copy ke remote server
rsync -avu --progress /var/www/moodle-data/ [email protected]:/data/
Perintah ini tidak akan membuat direktori moodle-data di bawah direktori /data pada tempat tujuan copy, tetapi sekaligus menyalin seluruh isinya direktori moodle-data langsung di dalam direktori /data/
File konfigurasi yang perlu di edit adalah php.ini yang letaknya bisa berbeda tergantung modul php yang digunakan, antara lain:
Versi php dapat disesuaikan
Parameter yang perlu diatur adalah :
post_max_size = 100M
upload_max_filesize = 100M
Besar ukuran dapat diubah sesuai kebutuhan
Jangan lupa setelah itu, web server Apache perlu di restart
$ sudo service apache2 restart
Moodle specification:
Version 3.9.x, 3.10.x
Theme: Enlightlite
changing in enlightlite/classes/core/course_renderer.php
search: top_course_menu
$sql = "SELECT a.category , a.cnt from ( SELECT category , count(category) as cnt FROM {course} C";
$sql .= " INNER JOIN {course_categories} cc ON cc.id = c.category WHERE category != 0 and c.visible <>1 and cc.visible<>1 group by category ) as a order by a.cnt desc ";