tag:blogger.com,1999:blog-45312239428828644252024-02-19T10:43:43.645+08:00My Linux LifeNews and my experience working with GNU/Linux and open source softwares.Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.comBlogger227125tag:blogger.com,1999:blog-4531223942882864425.post-47021413995609054332023-10-03T17:14:00.001+08:002023-10-03T17:14:13.728+08:00Second monitor no display after latest update - KDE-neon<p> After latest update as of Oct 3, 2023, my second monitor was undetected with latest kernel (6.2.0-33-generic). If I boot with previous kernel, it can be detected. After searching a little bit, one suggestion is to delete kscreenrc directory in .local/share and then reboot.</p><p>Voila!... it was detected and the second monitor was running well</p><p>TQ for the tip. </p><p>Source: https://forum.endeavouros.com/t/2nd-monitor-disabled-in-kde-plasma/34239</p><p><br /></p>Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-45956959692394632462023-09-14T12:34:00.005+08:002023-09-20T20:02:55.079+08:00KDE: bluetooth headset battery percentage<p> If you like mine, I can't view my headset's battery percentage in my KDE's bluetooth notification.</p><p>To be able to see it, I need to add a line as below to /etc/bluetooth/main.conf under [General] section:</p><p><span style="color: #351c75; font-family: Noto Mono, Menlo, Monaco, Consolas, monospace;"><span style="font-size: 13px;">Experimental = true</span></span></p><p><span style="font-family: Noto Mono, Menlo, Monaco, Consolas, monospace;"><span style="font-size: 13px;">Then you need to restart bluetooth service thusly:</span></span></p><p><span style="color: #351c75; font-family: Noto Mono, Menlo, Monaco, Consolas, monospace;"><span style="font-size: 13px;">systemctl restart bluetooth</span></span></p><p><span style="font-family: Noto Mono, Menlo, Monaco, Consolas, monospace;"><span style="font-size: 13px;"><br /></span></span></p><p><span style="font-family: Noto Mono, Menlo, Monaco, Consolas, monospace;"><span style="font-size: 13px;">You can see the percentage as screenshot below:</span></span></p><p><span style="font-family: Noto Mono, Menlo, Monaco, Consolas, monospace;"><span style="font-size: 13px;"><br /></span></span></p><p><span style="font-family: Noto Mono, Menlo, Monaco, Consolas, monospace;"><span style="font-size: 13px;"></span></span></p><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Noto Mono, Menlo, Monaco, Consolas, monospace;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuEOsSi-s9loHkMDGKdcfrPvOVWw-4zQ-DoErPM48pg8sjzHjIqX2S8E0Vrs4SAkEXwpXQIRKrtaEJtQujiBPIAxMYYTvkOPm3AZj4bEd1wgj1R5K4EBX_6brI7lnG2067XjiOWv4OtP0v6SbQyFrpyOO2jdBazRnAjaRC__E4AS1HT1HRjwHzndpDsUE/s503/Screenshot_20230914_122950.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="503" data-original-width="447" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuEOsSi-s9loHkMDGKdcfrPvOVWw-4zQ-DoErPM48pg8sjzHjIqX2S8E0Vrs4SAkEXwpXQIRKrtaEJtQujiBPIAxMYYTvkOPm3AZj4bEd1wgj1R5K4EBX_6brI7lnG2067XjiOWv4OtP0v6SbQyFrpyOO2jdBazRnAjaRC__E4AS1HT1HRjwHzndpDsUE/s320/Screenshot_20230914_122950.png" width="284" /></a></span></div><span style="font-family: Noto Mono, Menlo, Monaco, Consolas, monospace;"><br /><div class="separator" style="clear: both; text-align: center;"><br /></div>If you still can't see the percentage, it may mean your device or driver does not support it. </span><p></p><p><span style="font-family: Noto Mono, Menlo, Monaco, Consolas, monospace;"><span style="font-size: 13px;">That's all there is to it<br /><br /></span></span></p><p><span style="font-family: Noto Mono, Menlo, Monaco, Consolas, monospace;"><span style="font-size: 13px;"><br /></span></span></p>Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-46796763230442119972023-09-07T12:40:00.004+08:002023-09-07T12:40:58.005+08:00Installing kde-neon user edition using btrfs for root filesystem<p> If you want to install KDE-Neon using btrfs as / filesystem, there is a bug that preventing it to boot successfully to console or to X or Wayland. For simplicity and laziness :)), i won't show here the errors but straight to solution or workaround.</p><p>1. Boot to live CD installer</p><p>2. Go to Konsole and edit file: sudo vi /calamares/desktop/modules/fstab.conf </p><p>3. find word space_cache and change it to space_cache=v2</p><p>4. Start Installer and choose btrfs as filesystem for / </p><p>It should successfully install KDE-Neon and boot to the new system successfully.</p><p><br /></p><p>That's all there is to it. Have fun</p>Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-17406772637812963212023-06-14T17:40:00.004+08:002023-09-07T12:41:44.986+08:00How to resize a partition in proxmox 5 or 6<p><b>Background</b></p><p>1. The partition is ordinary partition and not LVM</p><p>2. The filesystem is ext4</p><p>3. The steps tested on proxmox 5 and 6 and maybe applicable to other versions of Proxmox</p><p><br /></p><p><b>Step by step</b></p><p>1. Select and resize the disk you want in proxmox gui<a href="https://blogger.googleusercontent.com/img/a/AVvXsEhCOy3Ku3qhLCL_wYSsCFAEz6t9n5ITGGpKbc3V0-AwvYqM2H3uKj2rCzNulGGMb88dMtKWU102150D6iXv-5Gn5dVAHg4Cw_WP-5ualrfkHx3eGXhL7feH5AKiquDddlX_KiLJg9WIiq_kHNl7i8OFnMcoW39gT1rW_hjb-D7jUTtA1ss7HPBG0EGJ" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="" data-original-height="152" data-original-width="254" height="191" src="https://blogger.googleusercontent.com/img/a/AVvXsEhCOy3Ku3qhLCL_wYSsCFAEz6t9n5ITGGpKbc3V0-AwvYqM2H3uKj2rCzNulGGMb88dMtKWU102150D6iXv-5Gn5dVAHg4Cw_WP-5ualrfkHx3eGXhL7feH5AKiquDddlX_KiLJg9WIiq_kHNl7i8OFnMcoW39gT1rW_hjb-D7jUTtA1ss7HPBG0EGJ" width="320" /></a></p><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">2. Login to the VM and type dmesg command to see the relevant device that has changed i.e /dev/vde</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">3. unmount the partition i.e /dev/vde1 : umount /dev/vde1</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">4. use parted to extend the disk's size:</div><div class="separator" style="clear: both; text-align: left;"><span> 4.1 parted /dev/vde</span><br /></div><div class="separator" style="clear: both; text-align: left;"><span><span> 4.2 resizepart 1</span><br /></span></div><div class="separator" style="clear: both; text-align: left;"><span><span><span> 4.3 q</span><br /></span></span></div><div class="separator" style="clear: both; text-align: left;"><span><span><span><br /></span></span></span></div><div class="separator" style="clear: both; text-align: left;"><span><span><span>5. unmount the partition if it is automatically mounted. If it is not, then proceed to the next step: </span></span></span></div><div class="separator" style="clear: both; text-align: left;"><span><span><span> <span> </span>umount /dev/vde1</span></span></span></div><div class="separator" style="clear: both; text-align: left;"><span><span><span><br /></span></span></span></div><div class="separator" style="clear: both; text-align: left;"><span><span><span>6. run filesystem check: e2fsck -f /dev/vde1</span></span></span></div><div class="separator" style="clear: both; text-align: left;"><span><span><span><br /></span></span></span></div><div class="separator" style="clear: both; text-align: left;"><span><span><span>7. filesystem resize: resize2fs /dev/vde1</span></span></span></div><div class="separator" style="clear: both; text-align: left;"><span><span><span><br /></span></span></span></div><div class="separator" style="clear: both; text-align: left;"><span><span><span>8. mount the partition i.e mount to /data: mount /dev/vde1 /data</span></span></span></div><div class="separator" style="clear: both; text-align: left;"><span><span><span><br /></span></span></span></div><div class="separator" style="clear: both; text-align: left;"><span><span><span>9. Check and verify</span></span></span></div><div class="separator" style="clear: both; text-align: left;"><span><span><span><br /></span></span></span></div><div class="separator" style="clear: both; text-align: left;"><span><span><span>That's all there is to it. Have fun!</span></span></span></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><br /><br /><p></p>Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-31523822251051333902023-04-02T20:34:00.001+08:002023-04-02T20:34:27.968+08:00Install a Sectigo Domain Validation SSL certificate in ZimbraWe usually get the below four files from Sectigo in the certificate bundle. The file name may vary depending on the certificate type <div><br /></div><div><ol style="text-align: left;"><li>yourdomain.com.crt – main certificate </li><li>AAACertificateServices.crt – Root
Certificate </li><li>USERTrustRSAAAACA.crt – Intermediate Certificate – 1</li><li>SectigoRSADomainValidationSecureServerCA.crt – Intermediate Certificate – 2 </li></ol></div><div><br /></div><div> Step 1: We shall create two files as below</div><div><br /></div><div><div><ul style="text-align: left;"><li>commercial_ca.crt (includes root certificate and two intermediate certificates)</li><li>commercial.crt (includes main certificate, root certificate and two intermediate certificates)</li></ul><div>Step 2: Login to Zimbra server, move to directory /opt/zimbra/ssl/zimbra/commercial and create two files as below.</div></div></div><div><br /></div><div><div>root@mail:~# cd /opt/zimbra/ssl/zimbra/commercial/</div><div>root@mail:/opt/zimbra/ssl/zimbra/commercial# touch commercial_ca.crt</div><div>root@mail:/opt/zimbra/ssl/zimbra/commercial# touch commercial.crt</div></div><div><br /></div><div><div>Step 3: Provide ownership to Zimbra.</div><div><br /></div><div><div>root@mail:/opt/zimbra/ssl/zimbra/commercial# chown zimbra:zimbra commercial_ca.crt</div><div>root@mail:/opt/zimbra/ssl/zimbra/commercial# chown zimbra:zimbra commercial.crt</div></div></div><div><br /></div><div>Step 4: Add the certificates into respective files as mentioned above.</div><div><br /></div><div>root@mail:/opt/zimbra/ssl/zimbra/commercial# vim commercial_ca.crt</div><div><br /></div><div><div>-----BEGIN CERTIFICATE-----</div><div><root certificate is here></div><div>-----END CERTIFICATE-----</div><div><br /></div><div>-----BEGIN CERTIFICATE-----</div><div><intermediate certificate 1 is here></div><div>-----END CERTIFICATE-----</div><div><br /></div><div>-----BEGIN CERTIFICATE-----</div><div><intermediate certificate 2 is here></div><div>-----END CERTIFICATE---</div></div><div><br /></div><div>root@mail:/opt/zimbra/ssl/zimbra/commercial# vim commercial.crt</div><div><br /></div><div><div>-----BEGIN CERTIFICATE-----</div><div><main certificate is here></div><div>-----END CERTIFICATE-----</div><div><br /></div><div>-----BEGIN CERTIFICATE-----</div><div><root certificate is here></div><div>-----END CERTIFICATE-----</div><div><br /></div><div>-----BEGIN CERTIFICATE-----</div><div><intermediate certificate 1 is here></div><div>-----END CERTIFICATE-----</div><div><br /></div><div>-----BEGIN CERTIFICATE-----</div><div><intermediate certificate 2 is here></div><div>-----END CERTIFICATE-----</div></div><div><br /></div><div><div>Step 5: Execute below command as Zimbra user to verify the certificate.</div><div><br /></div></div><div><br /></div><div>zimbra@mail:~/ssl/zimbra/commercial$ /opt/zimbra/bin/zmcertmgr verifycrt comm /opt/zimbra/ssl/zimbra/commercial/commercial.key /opt/zimbra/ssl/zimbra/commercial/commercial.crt /opt/zimbra/ssl/zimbra/commercial/commercial_ca.crt</div><div><br /></div><div><div>Step 6: Install the certificate.</div><div><br /></div></div><div><div>zimbra@mail:~/ssl/zimbra/commercial$ /opt/zimbra/bin/zmcertmgr deploycrt comm /opt/zimbra/ssl/zimbra/commercial/commercial.crt /opt/zimbra/ssl/zimbra/commercial/commercial_ca.crt</div></div><div><br /></div><div><br /></div><div><div>Step 7: Restart Zimbra service to take effect the changes.</div><div><br /></div></div><div><div>zimbra@mail:~$ zmcontrol restart</div></div><div><br /></div><div>Source: https://tweenpath.net/install-sectigo-domain-validation-ssl-certificate-zimbra/</div>Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-58012962963691699172022-12-21T11:54:00.002+08:002022-12-21T11:54:24.788+08:00What package does cal utility comes from in Ubuntu Jammy?<p> The package name is bsdmainutils, so:</p><p><span> </span>apt install bsdmainutils</p><p><br /></p><p>That's all there is to it. </p>Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-44839422523923562722022-07-19T10:13:00.001+08:002022-07-20T10:24:45.078+08:00Workaround: insync icon doesn't show up in KDE's tray in Wayland session<p> This is a workaround for <a href="https://insync.io" target="_blank">insync</a> icon doesn't show up in KDE's tray in Wayland session</p><p>1. Go to System Settings</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgZ7nmEHNfAEL8Wa2msrJB15dU5A4hoTBt9y8FV77YQWgY0FoipYPSy0kqFdhuQGOoGccPBFRs_igp-L09qMBZLGd5QSWsq22mH81NMpfjouziGjrsUC6RAA0hfenEx9eORA2l3D-sb35FWubPVyd4PDxBRW7cBmtMwlrvTq_3EjaajbbEajEI0TQKK" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="801" data-original-width="1431" height="256" src="https://blogger.googleusercontent.com/img/a/AVvXsEgZ7nmEHNfAEL8Wa2msrJB15dU5A4hoTBt9y8FV77YQWgY0FoipYPSy0kqFdhuQGOoGccPBFRs_igp-L09qMBZLGd5QSWsq22mH81NMpfjouziGjrsUC6RAA0hfenEx9eORA2l3D-sb35FWubPVyd4PDxBRW7cBmtMwlrvTq_3EjaajbbEajEI0TQKK=w457-h256" width="457" /></a></div><br />2. Click on Startup and Shutdown menu on the left<p></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEiIYMmU5b0GE0c5xs3aVYo-tcsMmwfJN86x4Ic1-JU6J_fjynvHZbspzyEj2gm3QjyNzN9Ri0oQJOx60WJjNdKn_kC9vtDXR2VZ-66fBQdDCrXo3sN7oXMIu5aR_k23E4V_JsCDoYx8tDQ1Go6PkJnTOrxnPTunnc4QwjiM8ZILujGNJkfFhlRZ8z8b" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="802" data-original-width="1433" height="248" src="https://blogger.googleusercontent.com/img/a/AVvXsEiIYMmU5b0GE0c5xs3aVYo-tcsMmwfJN86x4Ic1-JU6J_fjynvHZbspzyEj2gm3QjyNzN9Ri0oQJOx60WJjNdKn_kC9vtDXR2VZ-66fBQdDCrXo3sN7oXMIu5aR_k23E4V_JsCDoYx8tDQ1Go6PkJnTOrxnPTunnc4QwjiM8ZILujGNJkfFhlRZ8z8b=w443-h248" width="443" /></a></div><br />3. Clik on + Add... button to add insync and then select + Add Application...<p></p><p>4. Select insync in the dialog and click OK</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEj-H2nb9jQsfxEqMcEzBGI5RP8cxi0uB1zKRRqmYHvhdf6BVDjseOJAfgT1dmnMWF-qL7hO99BkqBWdrj5URYWf3ithz-pkEp5-FElUgiPGZxKiuNml7lBJVw5x68J_6Uy0AVBCufD2ugG8mtOm01zFtNmna7hADe5OLr1Tdk22dhROgOmyn7kMQGIb" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="671" data-original-width="306" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEj-H2nb9jQsfxEqMcEzBGI5RP8cxi0uB1zKRRqmYHvhdf6BVDjseOJAfgT1dmnMWF-qL7hO99BkqBWdrj5URYWf3ithz-pkEp5-FElUgiPGZxKiuNml7lBJVw5x68J_6Uy0AVBCufD2ugG8mtOm01zFtNmna7hADe5OLr1Tdk22dhROgOmyn7kMQGIb" width="109" /></a></div><br />5. insync should be listed in the Autostart <p></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEg6L6YFdq-CBxkNjY87Lpu2vb60_xGHn1usI2OsMaxMgZvrEW8M7JpDPPTAaC7GVPESGdFyDrsxsBx3BIB-1p7i3VBY37KkEKtt5fSGJYRPfr7SoLUVR1KvUw0AkUq9hz3-8tCoCCy0k4DbMxI7hllp1Ue3NZTSjqx0F4Fz9UFnY-unI2pEBKS-ZKB7" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="799" data-original-width="1432" height="179" src="https://blogger.googleusercontent.com/img/a/AVvXsEg6L6YFdq-CBxkNjY87Lpu2vb60_xGHn1usI2OsMaxMgZvrEW8M7JpDPPTAaC7GVPESGdFyDrsxsBx3BIB-1p7i3VBY37KkEKtt5fSGJYRPfr7SoLUVR1KvUw0AkUq9hz3-8tCoCCy0k4DbMxI7hllp1Ue3NZTSjqx0F4Fz9UFnY-unI2pEBKS-ZKB7" width="320" /></a></div><br /><br /><p></p><p>6. Click on the insync's Properties button</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjwR-JD-93svOQIHqDcymS32NLbf-UJ0f-LEBv23QdPcrAFW6selzxM7VAMlaxxHEiKLAxMTYRaDYpcI1uTXQDAu3KapMJvoovKKutWi3OvutrFX1nMS1K_agYZnPGNFXn0Fz4mr4PYFNybwpSaOnzkgtmlnz3ykuWMenPt-0hQVEOH_A98aPVCDbjo" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="795" data-original-width="894" height="334" src="https://blogger.googleusercontent.com/img/a/AVvXsEjwR-JD-93svOQIHqDcymS32NLbf-UJ0f-LEBv23QdPcrAFW6selzxM7VAMlaxxHEiKLAxMTYRaDYpcI1uTXQDAu3KapMJvoovKKutWi3OvutrFX1nMS1K_agYZnPGNFXn0Fz4mr4PYFNybwpSaOnzkgtmlnz3ykuWMenPt-0hQVEOH_A98aPVCDbjo=w376-h334" width="376" /></a></div><br />7. Go o Application tab and add QT_QPA_PLATFORM=xcb in the Command section as below and then click OK button to save the settings:<p></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhSm5jdKnvp63V-QXNkzdp_-EpnVUAE4Xnjv4o3vh00cBDKuCgmbaYYH53yyPwTjeCbTrs6AMXOlZTXQiXo4loC6ihCwG2lyKuOKtELnpjY1w3nZP-yr524rG4XWfgbPz3-Y7s479-eFcMwZK_Ios7QzNYoW2Pk5qgqAjbC8z8TanEg2-f4-YVaJasl" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="489" data-original-width="595" height="325" src="https://blogger.googleusercontent.com/img/a/AVvXsEhSm5jdKnvp63V-QXNkzdp_-EpnVUAE4Xnjv4o3vh00cBDKuCgmbaYYH53yyPwTjeCbTrs6AMXOlZTXQiXo4loC6ihCwG2lyKuOKtELnpjY1w3nZP-yr524rG4XWfgbPz3-Y7s479-eFcMwZK_Ios7QzNYoW2Pk5qgqAjbC8z8TanEg2-f4-YVaJasl=w395-h325" width="395" /></a></div><br />8. Reboot your computer. The insync's tray icon should show up in the tray.<div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgccaNzIDqxiWTt-VgYD85bpJ2VrJ2844HKD2KkzwYgTdI8IRCUpLRTB8qOtYFYLv4rakmb7xi0_YajyrZMnwVfnjOIGbQdg3G0mFsTXbyPqUL33V8sQ1eU2Od31eyzBlX0KH3LUTEvTm8gz49vAgT7LR6urE25S9fn3sgC5kmeO4jOGbQ4IXGRVH6j" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="41" data-original-width="517" height="25" src="https://blogger.googleusercontent.com/img/a/AVvXsEgccaNzIDqxiWTt-VgYD85bpJ2VrJ2844HKD2KkzwYgTdI8IRCUpLRTB8qOtYFYLv4rakmb7xi0_YajyrZMnwVfnjOIGbQdg3G0mFsTXbyPqUL33V8sQ1eU2Od31eyzBlX0KH3LUTEvTm8gz49vAgT7LR6urE25S9fn3sgC5kmeO4jOGbQ4IXGRVH6j" width="320" /></a></div><br /><br /><p></p><p>That's all there is to it.</p><p><br /></p></div>Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-68838621504414046882021-10-12T18:12:00.003+08:002021-10-12T18:12:24.449+08:00KDE: How to make firefox to open kde's file manager (Dolphin) when saving or open file in KDE<p> Make sure your Mozilla Firefox is version > 78. Mine is version 93 as of 12 Oct 2021.</p><p>1. Open firefox and type in the address bar : about:config</p><p>2. Ignore the warning by clicking "Accept the risk and Continue" button</p><p>3. type in the search bar: widget.use-xdg-desktop-portal and change the value to true</p><p>4. Restart the browser</p><p> Have fun! <br /></p><p><br /></p>Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-58378703585959973202021-07-29T15:04:00.006+08:002021-07-29T15:04:55.094+08:00How to enable hardware acceleration on firefox<p> Below are the steps to check and enable harware acceleration on Firefox browser:</p><p>1. launch firefox and type in address bar: about:config</p><p>2. Accept the risk if prompted.</p><p>3. Type layers.acceleration.force-enabled in the search bar</p><p>4. Turn it to true</p><p>5. Close all browser's windows and restart firefox to make it effective</p><p>Cheers. <br /></p>Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-32012289811743710962021-07-29T14:57:00.001+08:002021-07-29T14:57:13.964+08:00How to run firefox in Wayland?<p>Firefox is not running in wayland mode by default. The comma<span style="font-family: inherit;">nd belo</span>w is to run firefox browser in wayland:</p><pre class="_3GnarIQX9tD_qsgXkfSDz1"><code class="_34q3PgLsx9zIU5BiSOjFoM">MOZ_ENABLE_WAYLAND=1 firefox &</code></pre><pre class="_3GnarIQX9tD_qsgXkfSDz1"><code class="_34q3PgLsx9zIU5BiSOjFoM"> </code><span style="font-family: inherit;"><code class="_34q3PgLsx9zIU5BiSOjFoM"> </code></span></pre><pre class="_3GnarIQX9tD_qsgXkfSDz1"><span style="font-family: inherit;"><code class="_34q3PgLsx9zIU5BiSOjFoM">You can also put this in your desktop's shortcut for firefox in wayland environment.</code></span></pre><pre class="_3GnarIQX9tD_qsgXkfSDz1"><span style="font-family: inherit;">To verify whether Wayland support is enabled, go to <code>about:support</code>,and check “WebGL 1 Driver </span></pre><pre class="_3GnarIQX9tD_qsgXkfSDz1"><span style="font-family: inherit;">WSI Info” and/or “WebGL 2 Driver WSI Info”. If they say something about <code>GLX</code>, Wayland support </span></pre><pre class="_3GnarIQX9tD_qsgXkfSDz1"><span style="font-family: inherit;">is not enabled. If they say something about <code>EGL</code>, it is. <code class="_34q3PgLsx9zIU5BiSOjFoM"></code></span></pre><pre class="_3GnarIQX9tD_qsgXkfSDz1"><span style="font-family: inherit;"><code class="_34q3PgLsx9zIU5BiSOjFoM"> </code></span></pre><pre class="_3GnarIQX9tD_qsgXkfSDz1"><span style="font-family: inherit;"><code class="_34q3PgLsx9zIU5BiSOjFoM">That's all there is to it. Cheers </code></span></pre><pre class="_3GnarIQX9tD_qsgXkfSDz1"><code class="_34q3PgLsx9zIU5BiSOjFoM"><br /></code></pre>Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-71459898279399072492021-07-06T17:35:00.009+08:002021-07-07T12:50:38.827+08:00Wireguard on Linux : A basic approach using Ubuntu 20.04 LTS server and client<p> We begin with a fresh installation of Ubuntu server 20.04 LTS</p><p><b>Server</b></p><p></p><ol style="text-align: left;"><li>Install wireguard</li><ul><li>sudo apt install wireguard</li></ul><li>Generate server and client keys</li><ul><li>umask 077</li><li>wg genkey | tee server_private_key | wg pubkey > server_public_key</li><li>wg genkey | tee client_private_key | wg pubkey > client_public_key</li></ul><li>Create server config</li><ul><li>Create a file wg0.conf in /etc/wireguard/</li><li><span class="line" style="font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace; font-size: 12px; white-space: pre;"><span class="o" style="font-weight: bold;">[</span>Interface<span class="o" style="font-weight: bold;">]</span>
</span><span class="line" style="font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace; font-size: 12px; white-space: pre;"><span class="nv" color="rgb(38, 139, 210) !important">Address</span> <span class="o" style="font-weight: bold;">=</span> 10.199.0.1/24
</span><span class="line" style="font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace; font-size: 12px; white-space: pre;"><span class="nv" color="rgb(38, 139, 210) !important">SaveConfig</span> <span class="o" style="font-weight: bold;">=</span> <span class="nb" color="rgb(133, 153, 0) !important">true</span>
</span><span class="line" style="font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace; font-size: 12px; white-space: pre;"><span class="nv" color="rgb(38, 139, 210) !important">PrivateKey</span> <span class="o" style="font-weight: bold;">=</span> <insert server_private_key>
</span><span class="line" style="font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace; font-size: 12px; white-space: pre;"><span class="nv" color="rgb(38, 139, 210) !important">ListenPort</span> <span class="o" style="font-weight: bold;">=</span> 51820
</span><span class="line" style="font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace; font-size: 12px; white-space: pre;">
</span><span class="line" style="font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace; font-size: 12px; white-space: pre;"><span class="o" style="font-weight: bold;">[</span>Peer<span class="o" style="font-weight: bold;">]</span>
</span><span class="line" style="font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace; font-size: 12px; white-space: pre;"><span class="nv" color="rgb(38, 139, 210) !important">PublicKey</span> <span class="o" style="font-weight: bold;">=</span> <insert client_public_key>
</span><span class="line" style="font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace; font-size: 12px; white-space: pre;"><span class="nv" color="rgb(38, 139, 210) !important">AllowedIPs</span> <span class="o" style="font-weight: bold;">=</span> 10.199.0.2/24 <-- it means 254 IPs allowed to connect</span></li><li><span class="line" style="font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace; font-size: 12px; white-space: pre;"><div style="font-family: "Times New Roman"; font-size: medium; white-space: normal;"><span style="font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace; font-size: 12px; white-space: pre;">Note: If you only want 1 IP to connect,change /24 to /3</span><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">You can change filename from wg0.conf to vpn.conf or whatever name </span></span><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">you want</span></span></div></span></li></ul><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">Running the wireguard's service</span></span></li><ul><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">sudo systemctl enable wg-quick@wg0 <-- need to run for the first time only</span></span></li><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">sudo systemctl start wg-quick@wg0</span></span></li></ul><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">Enable IP forwarding (Applicable for internet-enabled vpn connection. See client's note below)</span></span></li><ul><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">echo 1 > /proc/sys/net/ipv4/ip_forward</span></span></li><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">sudo sysctl -p <-- to make the above change effective without reboot</span></span></li></ul></ol><div><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;"><b>Client</b></span></span></div><div><ol style="text-align: left;"><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">Install wireguard package</span></span></li><ul><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">sudo apt install wireguard</span></span></li></ul><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">Create a file in /etc/wireguard called wg0.conf</span></span></li><ul><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;"><span class="o" style="font-weight: bold;">[</span>Interface<span class="o" style="font-weight: bold;">]</span>
<span class="line"><span class="nv">Address</span> <span class="o" style="font-weight: bold;">=</span> 10.199.0.2/24
</span><span class="line"><span class="nv">PrivateKey</span> <span class="o" style="font-weight: bold;">=</span> <insert client_private_key>
</span><span class="line"><span class="nv">DNS</span> <span class="o" style="font-weight: bold;">=</span> 1.1.1.1
</span><span class="line">
</span><span class="line"><span class="o" style="font-weight: bold;">[</span>Peer<span class="o" style="font-weight: bold;">]</span>
</span><span class="line"><span class="nv">PublicKey</span> <span class="o" style="font-weight: bold;">=</span> <insert server_public_key>
</span><span class="line"><span class="nv">Endpoint</span> <span class="o" style="font-weight: bold;">=</span> <insert vpn_server_address>:51820
</span><span class="line"><span class="nv">AllowedIPs</span> <span class="o" style="font-weight: bold;">=</span> 10.199.0.0/24
</span><span class="line"><span class="nv">PersistentKeepalive</span> <span class="o" style="font-weight: bold;">=</span> 60</span></span></span></li><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;"><span class="line">Note: Address parameter is the IP address for the client</span></span></span></li><ul><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;"><span class="line">you can also change the name of the file wg0.conf to something else</span></span></span></li><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;"><span class="line">EndPoint is the wireguard server's IP address above.You can use IP or domain name</span></span></span></li><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;"><span class="line">DNS is the IP of DNS server for the client. </span></span></span></li><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;"><span class="line">*IF* the AllowedIPs is 0.0.0.0/0, it means all the traffic from the client </span></span></span></li><ul><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;"><span class="line">will go through vpn server and if you want the client to be able to go to </span></span></span></li><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;"><span class="line">the internet, you must add this rule in the server:</span></span></span></li><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;"><span class="line">iptables -t nat -A POSTROUTING -s 10.199.0.0/24 -o eth0 -j MASQUERADE or</span></span></span></li><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;"><span class="line">You can put the iptables command above in server's wireguard config as below under [Interface]:</span></span></span></li><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;"><span class="line">PostUp = </span></span></span>iptables -t nat -A POSTROUTING -s 10.199.0.0/24 -o eth0 -j MASQUERADE </li></ul></ul></ul><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;"> Connect the client</span></span></li><ul><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">sudo systemctl enable wg-quick@wg0 <-- run only this time</span></span></li><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">sudo systemctl start wg-quick@wg0</span></span></li><li><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">Test the connection: ping 10.199.0.1</span></span></li></ul></ol></div><div><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">That'sall there is to it. Hope it is working for you.</span></span></div><div><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;"><br /></span></span></div><div><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">Cheers!</span></span></div><div><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;"><br /></span></span></div><div><span style="font-family: Menlo, Monaco, Andale Mono, lucida console, Courier New, monospace;"><span style="font-size: 12px; white-space: pre;">PS: Check this out! Easy setup for wireguard : https://github.com/burghardt/easy-wg-quick</span></span></div><div style="text-align: left;"><span style="font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace; font-size: 12px; white-space: pre;"> </span><span style="font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace; font-size: 12px; white-space: pre;"> </span><span style="font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace; font-size: 12px; white-space: pre;"> </span></div><p></p>Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-14817476523362416512020-06-10T11:45:00.002+08:002020-06-10T11:45:46.499+08:00DNS error: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP<div>I saw a lot of errors like below in my /var/log/syslog:</div><div><br /></div><div>Jun 10 11:06:39 zabbix systemd-resolved[30232]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.<br />Jun 10 11:06:48 zabbix systemd-resolved[30232]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.<br />Jun 10 11:06:51 zabbix systemd-resolved[30232]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.<br />Jun 10 11:06:51 zabbix systemd-resolved[30232]: message repeated 4 times: [ Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.]<br />Jun 10 11:07:02 zabbix systemd-resolved[30232]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.<br /></div><div><br /></div><div>I checked my /etc/resolv.conf and it symlinked to a file which was not exist.</div><div><br /></div><div>ls -l /etc/resolv.conf <br />lrwxrwxrwx 1 root root 39 Apr 27 2018 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf<br /></div><div><br /></div><div>So I removed it and symlinked it to /run/systemd/resolve/resolv.conf which is systemd's resolv.conf file because I am using systemd's resolver.</div><div><br /></div><div>So,</div><div><br /></div><div>ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf</div><div><br /></div><div>Then restart the relevant service: systemctl restart systemd-resolved</div><div><br /></div><div>I checked again and the errors was gone.</div><div><br /></div><div>That's all there is to it.<br /></div>Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-86449804220382643942020-06-04T17:25:00.001+08:002020-06-04T17:25:34.138+08:00How to upgrade Ubuntu 19.04 to 19.10<p>Steps to upgrade from 19.04 to 19.10</p>
<pre><code>1. sudo cp /etc/apt/sources.list.bak /etc/apt/sources.list
2. sudo sed -i -e 's|cosmic|eoan|g' /etc/apt/sources.list
3. sudo apt update
4. sudo apt upgrade
<br /><br />Happy upgrading!<br /></code></pre>Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-48250583225433149322020-06-04T17:21:00.001+08:002020-06-04T17:37:29.769+08:00How to upgrade ubuntu 18.10 to 19.04Since 18.10 no longer supported you can upgrade manually to 19.04<br />
<pre><code>Steps to upgrade:
1. mkdir /tmp/upgrade
2. cd /tmp/upgrade
3. wget http://old-releases.ubuntu.com/ubuntu/dists/disco-updates/</code></pre>
<pre><code> main/dist-upgrader-all/current/disco.tar.gz
4. tar -xvf disco.tar.gz
5. sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
6. /etc/apt/sources.list change all links prefix to -></code></pre>
<pre><code> http://old-releases.ubuntu.com/
7. sudo python3 dist-upgrade.py or run do-release-upgrade
If you run do-release-upgrade, answer yes to all the questions asked.
Happy upgrading!</code></pre>
Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-60018013563875475612020-03-03T14:58:00.000+08:002020-03-03T14:58:24.517+08:00zfs and megacliRecently I had a task to replace a disk in my server that was throwing many smart errors to my email. It was actually an indicator that the disk is failing. Maybe not as critical as it seemed because it is a mirrored disk. But i didn't like it when it happened.<br />
<br />
The error I got in my email as below:<br />
<br />
<div class="gs">
<div class="gE iv gt">
<table cellpadding="0" class="cf gJ"><tbody>
<tr class="acZ"><td class="gF gK"></td><td class="gH bAk"><br /></td></tr>
</tbody></table>
</div>
</div>
This message was generated by the smartd daemon running on:<br />
<br />
host name: hq-hv-06<br />
DNS domain: mydomain.com.my<br />
<br />
The following warning/error was logged by the smartd daemon:<br />
<br />
Device: /dev/bus/1 [megaraid_disk_03] [SAT], 1 Offline uncorrectable sectors<br />
<br />
Device info:<br />
WDC WD2002FAEX-007BA0, S/N:WD-WCAY00005116, WWN:5-0014ee-206439d3b, FW:05.01D05, 2.00 TB<br />
<br />
For details see host's SYSLOG.<br />
<br />
You can also use the smartctl utility for further investigation.<br />
The original message about this issue was sent at Sun Jan 13 02:43:43 2019 +08<br />
Another message will be sent in 24 hours if the problem persists.<br />
<br />
To replace the disk, since I use mega RAID card, I have to use megacli utility for removal of the old disk and to replace with the new disk<br />
<br />
These commands should be run before disk removal:<br />
<br />
<ol>
<li> Offline the disk: <b>megacli -PDOffline -Physdrv[252:3] -a0</b></li>
<li>Mark the disk as missing: <b>megacli -PDMarkMissing -Physdrv[252:3] -a0</b></li>
<li>Prepare for removal: <b>megacli -PDPrpRmv -Physdrv[252:3] -a0</b></li>
</ol>
Then, you can remove the disk from the slot and insert the new disk. When you remove the disk, the zpool status shows <b>DEGRADED</b> state<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheTeRGua82u-lXPu7GEcpDo1Mj0Xk2h0LyPTAJbfYIoCC3NTksxf0yW20LF_3N7i0iOvYhnMMa8dHhUus7Yigvu6OgKh6t5h8xoZ2ZLMyncgsvyrsXyzHaQcqiAqIOJSBvRSsouGI1jEw/s1600/photo6262545076643277174.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="406" data-original-width="624" height="416" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheTeRGua82u-lXPu7GEcpDo1Mj0Xk2h0LyPTAJbfYIoCC3NTksxf0yW20LF_3N7i0iOvYhnMMa8dHhUus7Yigvu6OgKh6t5h8xoZ2ZLMyncgsvyrsXyzHaQcqiAqIOJSBvRSsouGI1jEw/s640/photo6262545076643277174.jpg" width="640" /></a></div>
<br />
Let the server detects the disk and check the info of the disk by running :<br />
<br />
<b>megacli -PDInfo -PhysDrv[252:3] -a0</b><br />
<br />
The you run this command to create virtual disk:<br />
<br />
<b>megacli -cfgLDAdd -r0 [252:3] -a0</b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfCGHEklqXH3nlzX_Ol_rwOMI8VWDQWp9-JP3LwJr7n2ecY8g0u1jLX9TJ1D5iad4Vdrfy19VFoxupZIQr3Fw_GD3UA-qi2j-wjwh0xOmDi5SCA3KOMJ89WKqKjUOlL7L9Be9jg14GlW4/s1600/photo6262545076643277173.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="118" data-original-width="425" height="176" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfCGHEklqXH3nlzX_Ol_rwOMI8VWDQWp9-JP3LwJr7n2ecY8g0u1jLX9TJ1D5iad4Vdrfy19VFoxupZIQr3Fw_GD3UA-qi2j-wjwh0xOmDi5SCA3KOMJ89WKqKjUOlL7L9Be9jg14GlW4/s640/photo6262545076643277173.jpg" width="640" /></a></div>
<br />
<br />
and you can also use megaclisas-status command :<br />
<br />
<b>megaclisas-status</b><br />
<br />
The output is as below: <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhh4j9SeNehHtzvzGdRk_ojSanAVfKljF681YTIZSVsDjtYlVyHd-_1COHoqxFZyS9yEmxp9whmNwyztu6G1IbkthA5uf93d9T4XBIQz4yYdHScXjfJUHeY8EveeMiiWtCSwpPYGXOSsC4/s1600/photo6260548144483903889.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="378" data-original-width="1057" height="228" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhh4j9SeNehHtzvzGdRk_ojSanAVfKljF681YTIZSVsDjtYlVyHd-_1COHoqxFZyS9yEmxp9whmNwyztu6G1IbkthA5uf93d9T4XBIQz4yYdHScXjfJUHeY8EveeMiiWtCSwpPYGXOSsC4/s640/photo6260548144483903889.jpg" width="640" /></a></div>
<br />
<span style="font-size: small;">But, If you get this error:</span><br />
<br />
<span style="font-family: inherit; font-size: large;"><span style="font-size: x-small;"><code class="plain plain">The current operation is not allowed because the controller has data in cache for offline or missing virtual drives</code></span></span><br />
<span style="font-size: large;"><br /></span>
<span style="font-family: inherit; font-size: large;"><span style="font-size: x-small;"><code class="plain plain">Run this command the find what disk cause the cache:</code></span></span><br />
<br />
<span style="font-size: large;"><code class="plain plain"><br /></code></span>
<b><span style="font-size: large;"><code class="plain plain"><code class="bash comments">megacli -GetPreservedCacheList -a0</code></code></span></b><br />
<br />
<span style="font-size: large;"><code class="plain plain"><code class="bash comments">The output is:</code></code></span><br />
<br />
<div class="line number14 index13 alt1">
<b><span style="font-size: large;"><code class="bash plain">Adapter </code><code class="bash comments">#0</code></span></b></div>
<div class="line number15 index14 alt2">
</div>
<div class="line number16 index15 alt1">
<b><span style="font-size: large;"><code class="bash plain">Virtual Drive(Target ID 03): Missing.</code></span></b></div>
<div class="line number17 index16 alt2">
</div>
<div class="line number18 index17 alt1">
<b><span style="font-size: large;"><code class="bash plain">Exit Code: 0x00</code></span></b></div>
<div class="line number18 index17 alt1">
</div>
<div class="line number18 index17 alt1">
</div>
<span style="font-size: large;"><code class="plain plain"><code class="bash comments">then run this command to discard the cache:</code></code></span><br />
<br />
<b><span style="font-size: large;"><code class="plain plain"><code class="bash comments"><code class="bash comments">megacli -DiscardPreservedCache -L"03" -a0</code></code></code></span></b><br />
<br />
<span style="font-size: large;"><code class="plain plain"><code class="bash comments"><code class="bash comments">The output:</code></code></code></span><br />
<br />
<div class="line number3 index2 alt2">
<b><span style="font-size: large;"><code class="bash plain">Adapter </code><code class="bash comments">#0</code></span></b></div>
<div class="line number4 index3 alt1">
</div>
<div class="line number5 index4 alt2 highlighted">
<b><span style="font-size: large;"><code class="bash plain">Virtual Drive(Target ID 03): Preserved Cache Data Cleared.</code></span></b></div>
<div class="line number6 index5 alt1">
</div>
<div class="line number7 index6 alt2">
<b><span style="font-size: large;"><code class="bash plain">Exit Code: 0x00</code></span></b></div>
<div class="line number7 index6 alt2">
</div>
<div class="line number7 index6 alt2">
<span style="font-size: large;"><span style="font-family: inherit;"><code class="bash plain">Then you can run the command above to create a virtual disk.</code></span></span></div>
<div class="line number7 index6 alt2">
</div>
<div class="line number7 index6 alt2">
<span style="font-size: large;"><span style="font-family: inherit;"><code class="bash plain">Then run megaclisas-status again to check whether the virtual disk is created</code></span></span></div>
<div class="line number7 index6 alt2">
</div>
<div class="line number7 index6 alt2">
<span style="font-size: large;"><span style="font-family: inherit;"><code class="bash plain">If it is successfully created, for zfs, run command to replace the disk:</code></span></span></div>
<div class="line number7 index6 alt2">
</div>
<div class="line number7 index6 alt2">
<span style="font-size: large;"><span style="font-family: inherit;"><code class="bash plain"><b>zpool replace rpool /dev/sdd</b> </code></span></span></div>
<div class="line number7 index6 alt2">
</div>
<div class="line number7 index6 alt2">
<span style="font-size: large;"><span style="font-family: inherit;"><code class="bash plain">(if the disk is sdd)</code><code class="plain plain"><code class="bash comments"><code class="bash comments"> and if it is successful, it will start the resilvering process</code></code></code></span></span></div>
<code class="plain plain"><code class="bash comments"><code class="bash comments"> </code> </code></code><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrhdgdGvOObB_eRsRWfvO_W2AHJp6yzGHti42jBV-1N5fVIs2LH3HcYUMjGRk02UorErfAN11oTAcMuwu0MjZnqiSU3kgn22NSJx8aytbmGVkuqDTJ5OaNhhkMnMG9q0vVjBjRahA10Sw/s1600/photo6262545076643277175.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="479" data-original-width="641" height="476" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrhdgdGvOObB_eRsRWfvO_W2AHJp6yzGHti42jBV-1N5fVIs2LH3HcYUMjGRk02UorErfAN11oTAcMuwu0MjZnqiSU3kgn22NSJx8aytbmGVkuqDTJ5OaNhhkMnMG9q0vVjBjRahA10Sw/s640/photo6262545076643277175.jpg" width="640" /></a></div>
<br />
Check the status: zpool status rpool<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv0ifX7q_ZwiFTADhpCZlKjnxoU3Et13xHwWd2f3OQZB351PHMpYUROQ3RHf2rlmXbBLZqBrJ9RALHhTWwIIm360nAvmMFw2AwB-S3kawx9-JroQQr35ZOtTIG1fMEq3MeWEYI_P43G-o/s1600/photo6262545076643277172.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="441" data-original-width="595" height="474" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv0ifX7q_ZwiFTADhpCZlKjnxoU3Et13xHwWd2f3OQZB351PHMpYUROQ3RHf2rlmXbBLZqBrJ9RALHhTWwIIm360nAvmMFw2AwB-S3kawx9-JroQQr35ZOtTIG1fMEq3MeWEYI_P43G-o/s640/photo6262545076643277172.jpg" width="640" /></a></div>
<br />
When the resilvering process finish, check zfs zpool status<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ8qS3dtp4h-vaWiCWHBK1bnfZ2y-1U0LPzfObnDs879Zc938lhoVRpOq-5-_xnmEBnHr9KV5eMRjQmVMOL_Jg7vaAHHUkIkILePobXb5d1oBFYKk-F1OUHeqx9gbSTKL3dyre3xDWOVQ/s1600/photo6262545076643277205.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="400" data-original-width="773" height="330" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ8qS3dtp4h-vaWiCWHBK1bnfZ2y-1U0LPzfObnDs879Zc938lhoVRpOq-5-_xnmEBnHr9KV5eMRjQmVMOL_Jg7vaAHHUkIkILePobXb5d1oBFYKk-F1OUHeqx9gbSTKL3dyre3xDWOVQ/s640/photo6262545076643277205.jpg" width="640" /></a></div>
<br />
That's all there is to it<br />
<br />Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-23375751164425133942019-03-12T12:01:00.003+08:002019-03-12T12:01:51.203+08:00time synchronization on Ubuntu 16.04Hi there,<br />
<br />
If you use Ubuntu 16.04 or Ubuntu-Debian derivatives and above, systemd provides an easier way to do time synchronization to time server.<br />
<br />
First you have to install ntdate package:<br />
<br />
<blockquote class="tr_bq">
sudo apt install ntpdate</blockquote>
<br />
Secondly, you have to edit /etc/systemd/timesyncd.conf and add your prefered time server to sync to:<br />
<br />
[Time]<br />NTP=0.asia.pool.ntp.org<br />
FallbackNTP=ntp.ubuntu.com<br />
<br />
Save the file and restart the time synchronization service:<br />
<br />
<blockquote class="tr_bq">
sudo systemctl restart systemd-timesyncd </blockquote>
<br />
To check the status:<br />
<br />
<blockquote class="tr_bq">
sudo systemctl status systemd-timesyncd</blockquote>
<br />
<br />
<br />
<br />Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-63826756589323672162018-10-13T16:55:00.002+08:002018-10-13T16:55:44.653+08:00Redirect http connection to https for zimbra 8.8.9Run this command as zimbra:<br />
<br />
<blockquote class="tr_bq">
<span style="font-family: monospace;"><span style="background-color: white;">zmprov ms webmail.myserver.yourdomain.com zimbraReverseProxyMailMode redirect</span></span></blockquote>
<span style="font-family: monospace;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: monospace;"><span style="background-color: white;">Substitute the hostname with yours.</span></span><br />
<span style="font-family: monospace;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: monospace;"><span style="background-color: white;">That's all there is to it.</span></span><br />
<span style="font-family: monospace;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: monospace;"><span style="background-color: white;">Have fun.</span></span><br />
<span style="font-family: monospace;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: monospace;"><span style="background-color: white;"><br /></span></span>Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-72631492297385699772018-10-09T23:36:00.005+08:002023-06-27T09:33:18.260+08:00How to install oci8 instant client for Ubuntu Linux<br />
<ul>
<li>First prerequirements are a working apache2 and php7.2 (Ubunti 18.04) environment.</li>
<li>Download the basic (like instantclient-basic-linux.x64-12.2.0.1.0.zip) and the sdk (instantclient-sdk-linux.x64-12.2.0.1.0.zip) package from the Oracle Website <a href="http://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html">http://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html</a></li>
<li>Upload both files to your webserver, you can use WinSCP (windows) or rsync/scp (linux) for it</li>
<li>Unzip both files on server, in my case, you will get a new folder named "instantclient_12_2"</li>
<li><span style="font-family: inherit; font-style: inherit; font-weight: inherit;">Create destination folder : </span><b style="font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit;">mkdir /opt/oracle</b></li>
<li><span style="font-family: inherit; font-style: inherit; font-weight: inherit;">Move and rename the instantclient folder: </span><b style="font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit;">mv instantclient_12_2 /opt/oracle/instantclient</b></li>
<li><span style="font-family: inherit; font-style: inherit; font-weight: inherit;">Change rights on folder: </span><b style="font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit;">chown -R root:www-data /opt/oracle</b><span style="font-family: inherit; font-style: inherit; font-weight: inherit;"> </span></li>
<li><span style="font-family: inherit; font-style: inherit; font-weight: inherit;">Check if you have the required packages for installing OCI8: </span><b style="font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit;">apt install php7.2-dev php-pear build-essential libaio1 </b></li>
<li><span style="font-family: inherit; font-style: inherit; font-weight: inherit;">Create necessary soft links: </span><b style="font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit;">ln -s /opt/oracle/instantclient/libclntsh.so.12.1 /opt/oracle/instantclient/libclntsh.so; ln -s /opt/oracle/instantclient/libocci.so.12.1 /opt/oracle/instantclient/libocci.so</b></li>
<li><span style="font-family: inherit; font-style: inherit; font-weight: inherit;">Add instant client to ld config files : </span><b style="font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit;">echo /opt/oracle/instantclient > /etc/ld.so.conf.d/oracle-instantclient.conf</b></li>
<li><span style="font-family: inherit; font-style: inherit; font-weight: inherit;">Update Dynamic Linker Run-Time Bindings : </span><b style="font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit;">ldconfig</b></li>
<li><span style="font-family: inherit; font-style: inherit; font-weight: inherit;">Now install OCI8 by pecl: </span><b style="font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit;">pecl install oci8 </b></li>
<li><span style="font-family: inherit; font-style: inherit; font-weight: inherit;">The OCI8 installation is asking you for the right folder: </span><b style="font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit;">instantclient,/opt/oracle/instantclient</b></li>
<li><span style="font-family: inherit; font-style: inherit; font-weight: inherit;">Add oci lib to the cli php config (console php): </span><b style="font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit;">echo "extension = oci8.so" >>/etc/php/7.2/cli/php.ini</b></li>
<li><span style="font-family: inherit; font-style: inherit; font-weight: inherit;">Add oci lib to the apache php config: </span><b style="font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit;">echo "extension = oci8.so" >> /etc/php/7.2/apache2/php.ini</b></li>
<li><span style="font-family: inherit; font-style: inherit; font-weight: inherit;">Set environment variables for the cli version (you will need to reboot the server after): </span><b style="font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit;">echo "LD_LIBRARY_PATH=\"/opt/oracle/instantclient\"" >> /etc/environment echo "ORACLE_HOME=\"/opt/oracle/instantclient\"" >> /etc/environment</b></li>
<li><span style="font-family: inherit; font-style: inherit; font-weight: inherit;">Set environement variables for the apache version: </span><b style="font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit;">echo "export LD_LIBRARY_PATH=\"/opt/oracle/instantclient\"" >> /etc/apache2/envvars; echo "export ORACLE_HOME=\"/opt/oracle/instantclient\"" >> /etc/apache2/envvars</b><span style="font-family: inherit; font-style: inherit; font-weight: inherit;"> </span></li>
<li><span style="font-family: inherit; font-style: inherit; font-weight: inherit;">Restart Apache: </span><b style="font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit;">service apache2 restart or systemctl restart apache2</b><span style="font-family: inherit; font-style: inherit; font-weight: inherit;"> </span></li>
<li>You're done, now you can test your connection to the Oracle database</li>
</ul>
<div><br /></div>Update: If you're using Ubuntu 22.04 LTS with php 8.1, then <b style="font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit;">then pecl install oci8-3.2.1</b><br /><br /><div>
Original source: <a href="https://serverfault.com/questions/911475/howto-install-oracle-oci8-instantclient-on-ubuntu-18-04">https://serverfault.com/questions/911475/howto-install-oracle-oci8-instantclient-on-ubuntu-18-04</a></div>Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-86792733856705335632018-10-04T15:16:00.000+08:002018-10-04T15:16:10.923+08:00Enabling java plugin in Chromium on LinuxHi there,<br />
<br />
In certain situations you may need to use java plugin in chromium to access certain functions in a website such as server's console accessed via IPMI page.<br />
<br />
On Linux ( I use Ubuntu 18.04), install icedtea-plugin package:<br />
<br />
<blockquote class="tr_bq">
sudo apt install icedtea-plugin</blockquote>
<br />
To enable chromium to run java, make a symbolic link of icedtea plugin to plugin directory of chromium:<br />
<br />
<blockquote class="tr_bq">
sudo ln -s /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so /usr/lib/chromium-browser/plugins/</blockquote>
<div>
<br /></div>
<div>
Have fun!</div>
Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-87548623804765019502018-09-08T20:57:00.003+08:002018-10-01T23:37:59.866+08:00Zimbra migration<h3>
1. Introduction</h3>
Zimbra project doesn’t have a cross migration or proper account
transfer documentation. All they tell is to do copy the folder
/opt/zimbra to your new servers. But if any of those files infected with
a rootkit or other malicious scripts , then your new server also will
be compromised. So never sync or copy the entire directory of your
zimbra installation. Zimbra also tell you to upgrade your production
server to the latest version before migration. But improper upgrade may
result in entire data lose. With this procedure you can do:<br />
<ul>
<li>Migrate zimbra from one Operating System To another.</li>
<li>Migrate zimbra account between any hardware and Operating systems configurations.</li>
<li>No interruption on production server like software upgrade or service disable.</li>
<li>Migrate zimbra from old version to a new version server</li>
<li>Zimbra cross migrations without copying entire directories.</li>
</ul>
<h3>
<a href="https://www.blogger.com/null" name="2"></a>2. Requirement</h3>
You need an old server with zmibra account and a new fresh server
with the Os you wish. Dont’ create or make any custom configuration or
setting in you new server. Please make sure to set your new servers
hostname same as the old one.<br />
<ul>
<li><b>Old server</b>
<ul>
<li>Need ssh root login</li>
<li>Need zimbra admin logins</li>
<li>Enough HDD space to store backups</li>
</ul>
</li>
<li><b>New server</b>
<ul>
<li>Must be installed with latest stable zimbra</li>
<li>Need ssh root logins</li>
<li>Need zimbra admin logins</li>
<li>Enough HDD space to store backups</li>
</ul>
</li>
</ul>
<h3>
<a href="https://www.blogger.com/null" name="3"></a>3. Presetup</h3>
You need to setup an ssh key from the new server’s root account to the old server’s root account.<br />
Reduce the TTL of MX records of your domain to 500 seconds . So that you
can easily switch the domain’s IP after migration. Please remember to
schedule the migration task on non peek hours.<br />
Create a directory in both new and old server into which we store all required files and data for doing the migration<br />
<pre>[root@zimbra ~]# mkdir /backups/zmigrate
[root@zimbra ~]# chown zimbra.zimbra /backups/zmigrate
[root@zimbra ~]# su - zimbra
</pre>
All operation in your Zimbra server must be performed as Zimbra user
itself, otherwise you will get permission and ownership issues in your
zimbra server<br />
<h3>
<a href="https://www.blogger.com/null" name="4"></a>4. Backup all data from Old server</h3>
We are going to copy all data from old server without interrupting the services.<br />
<h4>
<a href="https://www.blogger.com/null" name="41"></a>4.1 Find all domains</h4>
You need to find all the domains from your old server. We will store
the domain list in a file called domains.txt. You need to back all the
domains list as follows,<br />
<pre>zimbra@zimbra:~$ cd /backups/zmigrate
zimbra@zimbra:/backups/zmigrate$ zmprov gad > domains.txt
zimbra@zimbra:/backups/zmigrate$ cat domains.txt
fun.com
myserver.com
justfortest.com
checkit.com
dieanotherday.com
gnutest.com
foo.com
zimbra.foo.com
zimbra@zimbra:/backups/zmigrate$
</pre>
Now remove all domains and subdomains related with the main hostname
of your server foo.com , from this list (domains.txt) because it was
already created in your new server. So there is no need to create a new
domain with the same name.<br />
<h4>
<a href="https://www.blogger.com/null" name="42"></a>4.2 Find all admin accounts</h4>
Most of these servers will have only one admin. But some servers have
multiple admins. So it will be good to find all admin accounts. We will
store the admins list in admins.txt<br />
<pre>zimbra@zimbra:/backups/zmigrate$ zmprov gaaa > admins.txt
zimbra@zimbra:/backups/zmigrate$ cat admins.txt
admin@foo.com
zimbra@zimbra:/backups/zmigrate
</pre>
<h4>
<a href="https://www.blogger.com/null" name="43"></a>4.3 Find all email accounts</h4>
Next step is to find all the email accounts hosted in your old
server. Get a list of your email accounts and save in the file
emails.txt . So from this file we can see how many accounts that need to
migrate.<br />
<pre>zimbra@zimbra:/backups/zmigrate$ zmprov -l gaa >emails.txt
zimbra@zimbra:/backups/zmigrate$ cat emails.txt
gm@fun.com
forest@fun.com
galsync@fun.com
fax@myserver.com
paul@myserver.com
angela@myserver.com
brooke@myserver.com
hnmobile1@myserver.com
maria@justfortest.com
samantha@justfortest.com
backupmail@justfortest.com
admin@checkit.com
sandra@checkit.com
zimbra@zimbra:/backups/zmigrate$
</pre>
Please remove all the email accounts from the file
/backups/zmigrate/emails.txt with a starting words like spam, virus,
ham, galsync . There is no need to restore these accounts. Even if you
still need to restore , you can do it. I don’t like spam and virus
emails.<br />
<br />
If you want to list all email accounts and their status, run this command as zimbra:<br />
<br />
<b>zmaccts</b><br />
<br />
It is good to view the output to get some information about the status of the accounts so that I can exclude irrelevant accounts such as closed ones.<b> </b> <br />
<h4>
<a href="https://www.blogger.com/null" name="44"></a>4.4 Get all distribution lists</h4>
You need to get all the distributions list and store it in a file called distributinlist.txt.<br />
<pre>
zimbra@zimbra:~$ zmprov gadl > /backups/zmigrate/distributinlist.txt
zimbra@zimbra:~$ cat /backups/zmigrate/distributinlist.txt
budgetrtodomainusers@fun.com
healthnowdomainusers@myserver.com
checkit.comdomainusers@checkit.com
northpointessdomainusers@dieanotherday.com
parkatnorthhillsdomainusers@gnutest.com
zimbra@zimbra:~$
</pre>
<h4>
<a href="https://www.blogger.com/null" name="45"></a>4.5 Get all members in distribution lists</h4>
In this step we are going to collect all members in each of these
distributions. We will create a folder called distributinlist_members
and create a file under this folder named distributinlist.txt , then
store all the distributions members.<br />
<pre>zimbra@zimbra:~$ mkdir /backups/zmigrate/distributinlist_members
zimbra@zimbra:~$ for i in `cat /backups/zmigrate/distributinlist.txt`; do zmprov gdlm $i > /backups/zmigrate/distributinlist_members/$i.txt ;echo "$i"; done
budgetrtodomainusers@fun.com
healthnowdomainusers@myserver.com
checkit.comdomainusers@checkit.com
</pre>
<h4>
<a href="https://www.blogger.com/null" name="46"></a>4.6 Find all email account’s passwords</h4>
Now need to find the encrypted password of all of your old email
accounts and store it under a folder named userpass/ as follows:<br />
<pre>zimbra@zimbra:/backups/zmigrate$ mkdir userpass
zimbra@zimbra:/backups/zmigrate$ for i in `cat emails.txt`; do zmprov -l ga $i userPassword | grep userPassword: | awk '{ print $2}' > userpass/$i.shadow; done
</pre>
<h4>
<a href="https://www.blogger.com/null" name="47"></a>4.7 Backup all user names , Display names and Given Names</h4>
Zimbra will accept a Names and Disaplay names in email accounts
during account creation. So we need to restore those data too. We will
create a directory called userdata/ which contains these details of each
of those email accounts<br />
<pre>zimbra@zimbra:/backups/zmigrate$ mkdir userdata
zimbra@zimbra:/backups/zmigrate$ for i in `cat emails.txt`; do zmprov ga $i | grep -i Name: > userdata/$i.txt ; done
</pre>
<h4>
<a href="https://www.blogger.com/null" name="48"></a>4.8 Now backup all email account</h4>
This will take some time to take backup of all email accounts. So you
can run this command behind “screen”. A tgz file will be created with
each emails name. We will use this files to transfer email accounts.<br />
<pre>
zimbra@zimbra:/backups/zmigrate$ for email in `cat /backups/zmigrate/emails.txt`; do zmmailbox -z -m $email getRestURL '/?fmt=tgz' > $email.tgz ; echo $email ; done
gm@fun.com
forest@fun.com
galsync@fun.com
fax@myserver.com
fax2@myserver.com
paul@myserver.com
</pre>
This tgz files contains<br />
<ul>
<li>Mail</li>
<li>Contacts</li>
<li>Calendars</li>
<li>Briefcase</li>
<li>Tasks</li>
<li>Searches</li>
<li>Tags</li>
<li>Folders</li>
</ul>
All subfolders are included, except Junk and Trash. There is no way
to include these in the big dump, but they can be exported separately:<br />
<h4>
<a href="https://www.blogger.com/null" name="49"></a>4.9 Now backup alias</h4>
Some times your server may have email aliases for certain accounts.
So you need to copy those aliases too. We will create a sub folder
called alias/ for storing the backup of Alias.<br />
<pre>
zimbra@zimbra:/backups/zmigrate$ mkdir -p alias/
zimbra@zimbra:/backups/zmigrate$ for i in `cat emails.txt`; do zmprov ga $i | grep zimbraMailAlias |awk '{print $2}' > alias/$i.txt ;echo $i ;done
gm@fun.com
forest@fun.com
</pre>
Some of your email accounts don’t have alias. So the above created
files may be an empty file. Remove those empty files as follows,’\<br />
<pre>zimbra@zimbra:/backups/zmigrate$ find alias/ -type f -empty | xargs -n1 rm -v
</pre>
<h4>
<a href="https://www.blogger.com/null" name="40"></a>4.10 Rsync folder to new server</h4>
Now we have all the required data to do the migration process. As a summery :<br />
<ul>
<li>/backups/zmigrate – Have all the backups stored</li>
<li>/backups/zmigrate/domains.txt – Contains the domains names</li>
<li>/backups/zmigrate/emails.txt – Contains the list of email accounts</li>
<li>/backups/zmigrate/distributinlist.txt – Contains the distribution lists</li>
<li>/backups/zmigrate/distributinlist_members – Contains the members in each of your distributions</li>
<li>/backups/zmigrate/userpass – Contains the encrypted password of your email accounts</li>
<li>/backups/zmigrate/userdata – containts the email accounts user informations</li>
<li>/backups/zmigrate/alias – Contains all the aliases of your email accounts</li>
</ul>
Also the parent folder /backups/zmigrate contains a lot of zip file which are the data inside emails.<br />
Now rsync the files as follows,<br />
<pre>root@newserver # rsync -avp -e 'ssh -p 22' root@old-server-ip:/backups/zmigrate /backups/
</pre>
<h3>
<a href="https://www.blogger.com/null" name="5"></a>5. Restore in new server</h3>
So after finishing the rsync process , we need to restore this in your new server as follows:<br />
All this operations must be carried out as zimbra sudo user itself. Don’t use root account to store the backups<br />
<pre>[root@zimbra ~]# su - zimbra
[zimbra@zimbra]$
</pre>
<h4>
<a href="https://www.blogger.com/null" name="51"></a>5.1 Restore all domains</h4>
Now create all the domains that we have from the file /backups/zmigrate/domains.txt<br />
<pre>[zimbra@zimbra zmigrate]$ for i in `cat /backups/zmigrate/domains.txt `; do zmprov cd $i zimbraAuthMech zimbra ;echo $i ;done
2c86f244-de9d-4b7c-8e22-2246a8256219
myserver.com
dbf75058-d85e-4d60-8b69-1f148a456eb6
justfortest.com
ee90ffa2-505d-449f-82fd-129acb21cb5e
checkit.com
8b6bf287-f61e-4930-ada0-96b817292556
dieanotherday.com
17d3c73c-14f7-43aa-9fd2-c9be9e29c9e5
</pre>
You can also verify the domains created from the zimbra admin panel too<br />
<h4>
<a href="https://www.blogger.com/null" name="52"></a>5.2 Create email accounts and set the old password</h4>
We need to create the email accounts for storing the mails. We also
need to set the old passwords too. We already collected the account info
and passwords.<br />
To Create email accounts and restore passwords . Please use the following script to create it<br />
<pre>#!/bin/bash
#Scrit for creating the email accounts createacct.sh
USERPASS="/backups/zmigrate/userpass"
USERDDATA="/backups/zmigrate/userdata"
USERS="/backups/zmigrate/emails.txt"
for i in `cat $USERS`
do
givenName=$(grep givenName: $USERDDATA/$i.txt | cut -d ":" -f2)
displayName=$(grep displayName: $USERDDATA/$i.txt | cut -d ":" -f2)
shadowpass=$(cat $USERPASS/$i.shadow)
tmpPass="CHANGEme"
zmprov ca $i CHANGEme cn "$givenName" displayName "$displayName" givenName "$givenName"
zmprov ma $i userPassword "$shadowpass"
done
</pre>
<h4>
<a href="https://www.blogger.com/null" name="53"></a>5.3 Restore email accounts</h4>
Now we are going to restore the emails from the Zip file. This
process may take some hours. So it will be good to run behind “screen”
command.<br />
<pre>[zimbra@zimbra zmigrate]$ for i in `cat /backups/zmigrate/emails.txt`; do zmmailbox -z -m $i postRestURL "/?fmt=tgz&resolve=skip" /backups/zmigrate/$i.tgz ; ; echo "$i -- finished "; done
gm@fun.com -- finished
forest@fun.com -- finished
</pre>
<h4>
<a href="https://www.blogger.com/null" name="54"></a>5.4 Now recreate the distribution lists</h4>
It is time to recreate all the distribution lists as follows.<br />
<pre>[zimbra@zimbra zmigrate]$ for i in `cat distributinlist.txt`; do zmprov cdl $i ; echo "$i -- done " ; done
2a852fd8-6e66-426e-a76d-15192536042a
budgetrtodomainusers@fun.com -- done
a0f6ddb3-8525-4194-9397-6cf0a920dda6
</pre>
<h4>
<a href="https://www.blogger.com/null" name="55"></a>5.5 Restore the distribution lists</h4>
After creating the distribution lists we need to add all the members
inside the distribution lists. We have the distribution lists in the
folder distributinlist_members/ and the list is in distributionlist.txt
file. Please use the following small script to restore the distribution
lists.<br />
<pre>[zimbra@zimbra zmigrate]$ cat restoredist.sh
#!/bin/bash
# add all memebers to each of these distribution lists
for i in `cat distributinlist.txt`
do
for j in `grep -v '#' distributinlist_members/$i.txt |grep '@'`
do
zmprov adlm $i $j
echo " $j member has been added to list $i"
done
done
</pre>
<h4>
<a href="https://www.blogger.com/null" name="56"></a>5.6 Restore Alias accounts</h4>
Please use the following script to restore alias. This will add all the aliases in your email accounts.<br />
<pre>#!/bin/bash
for i in `cat /backups/zmigrate/emails.txt`
do
if [ -f "alias/$i.txt" ]; then
for j in `grep '@' /backups/zmigrate/alias/$i.txt`
do
zmprov aaa $i $j
echo "$i HAS ALIAS $j --- Restored"
done
fi
done
</pre>
<h3>
<a href="https://www.blogger.com/null" name="6"></a>6. Conclusion</h3>
So now we migrated all our email accounts. It is time for DNS change.
You need to shut down the old zimbra services and change the DNS. After
that send some test emails and make sure everything is working fine.
Next step is to secure your zimbra server. You need to install ssl
certificates and firewall in your new zimbra server. Now you have a new
server with new packages and files with the same old email accounts and
its data.<br />
<br />
Credits go to : Sherin and Syslint (<a href="https://syslint.com/blog/tutorial/zimbra-server-migration-and-zimbra-account-transfer-the-perfect-method/" target="_blank">Web</a>) <br />
<h3>
<a href="https://www.blogger.com/null" name="7"></a>7. References</h3>
<pre>https://wiki.zimbra.com/wiki/Zmprov_Examples
https://wiki.zimbra.com/wiki/Zmprov
https://wiki.zimbra.com/wiki/Backing_up_and_restoring_Zimbra_%28Open_Source_Version%29
'https://xmission.com/blog/2015/04/30/zimbra-server-admin-tip-mailbox-password-migration-and-server-settings-comparison'
http://stdout.no/zimbra-open-source-backup-strategy-and-scripts/
</pre>
Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-28017770554719745252018-07-10T02:05:00.000+08:002018-07-10T02:07:49.177+08:00Zimbra: Restore or import a user mailbox from backup using CLIIf you have backed up or exported an account and named the compressed backup file as backup.tgz, you can restore or import using zimbra webgui or CLI. CLI is the preferred method if involving backup file bigger than 500MB. The command is as below(run as user zimbra):<br />
<br />
<span style="font-family: monospace;"><span style="background-color: white;">zmmailbox -z -m email@domain.com postRestURL "/?fmt=tgz&resolve=skip" backup.tgz</span></span><br />
<span style="font-family: monospace;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: monospace;"><span style="background-color: white;">That's all there is to it.</span></span><br />
<br />
<br />Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-50056473356366836032018-01-10T10:28:00.001+08:002018-01-10T10:28:16.512+08:00Problem with KDE Look and Feel and Desktop Theme page empty in KDE System Settings (Ubuntu-based distro)If you're experiencing empty page of KDE Look and Feel and Desktop Theme (mine from KDE Neon beta), please do these steps:<br />
<br />
sudo apt update<br />
sudo apt dist-upgrade<br />
sudo apt install qml-module-org-kde-kcm<br />
<br />
It should work.<br />
<br />
That's all there is to it.Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-18298900406578394682017-12-30T17:55:00.002+08:002017-12-30T17:56:50.844+08:00Setup SSL for JiraHow to do it...<br />
<br />
Perform the following steps to import an SSL certificate:<br />
<br />
1. Open up a command window and go to the directory where the certificate file<br />
resides.<br />
<br />
2. Generate a Java KeyStore (JKS) for JIRA by running the<br />
<br />
keytool -genkey -alias jira -keyalg RSA -keystore /opt/jks/jira.jks<br />
<br />
3. Import the certificate into KeyStore repository<br />
keytool -import -alias jira -keystore JIRA_INSTALL/jira.jks -file file.crt<br />
<br />
where file.crt is the certificate file.<br />
<br />
4. Open the server.xml file located in the /opt/atlassian/jira/conf directory in a text editor.<br />
<br />
5. Locate and uncomment the following XML configuration snippet:<br />
<br />
<connector br="" maxhttpheadersize="8192" nbsp="" port="8443" sslenabled="true">maxThreads="150"<br />minSpareThreads="25" maxSpareThreads="75"<br />enableLookups="false"<br />disableUploadTimeout="true"<br />acceptCount="100" scheme="https" secure="true"<br />clientAuth="false"<br />sslProtocol="TLS" useBodyEncodingForURI="true"</connector><br />
keystoreFile="/opt/jks/jira.jks"<br />
keystorePass="mypassword"<br />
keyAlias="jira"<br />
keystoreType="JKS"/><br />
<br />
<br />
<br />
<br />
Letsencrypt<br />
<br />
Install certbot ppa:<br />
<br />
sudo add-apt-repository ppa:certbot/certbot<br />
<br />
then install certbot:<br />
sudo apt install certbot <br />
<br />
<br />
run certbot for manual installation of letsencrypt using challenge via DNS:<br />
<br />
sudo certbot certonly --manual --preferred-challenges dns<br />
<br />
openssl pkcs12 -export -in fullchain1.pem -inkey privkey1.pem -out cert_and_key.p12 -name tomcat -CAfile chain1.pem -caname root<br />
<pre><code>
</code></pre>
<pre><code>keytool -importkeystore -srcstorepass ppz2017 -deststorepass ppz2017 </code></pre>
<pre><code>-destkeypass ppz2017 -srckeystore jira.siza.my/cert_and_key.p12 </code></pre>
<pre><code>-srcstoretype PKCS12 -alias tomcat </code></pre>
<pre><code>-keystore jira.jks</code></pre>
<pre><code>
</code></pre>
<pre><code></code></pre>
<pre>TO see what contains in the keystore:
<code></code></pre>
keytool -list -keystore /opt/jks/jira.jks<br />
<br />
6. Restart JIRA to apply the changes.<br />
sudo systemctl stop jira<br />
sudo systemctl start jira<br />
<br />
<br />
<br />Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-36772980696062348422017-12-30T17:54:00.001+08:002017-12-30T17:54:34.571+08:00Navigate through bash history with page up/down key<h1 class="page-title">
Linux bash history with Page up / Page down</h1>
<div class="field field-name-body">
<div style="text-align: justify;">
In linux you can configure the
pgup/pgdown keys to navigate through commands you typed that begin with
the string you just typed. Type "mysql" and then hit "Page up", and you
will see nothing but mysql-related commands.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Unfortunately this has to be configured anew on every machine or
server/vm I work on, and I always forget where this is configured (and
it takes a while to find it in google), so I thought I should write it
down.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In /etc/inputrc, uncomment:</div>
<div class="codeblock" style="text-align: justify;">
<code># alternate mappings for "page up" and "page down" to search the history<br />"\e[5~": history-search-backward<br />"\e[6~": history-search-forward</code></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Restart your shell or use Ctrl+X, Ctrl+R to tell it to re-read.<br />
(thanks <a href="http://stackoverflow.com/questions/1030182/how-do-i-change-bash-history-completion-to-complete-whats-already-on-the-line">stackoverflow</a>)</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Yep, it's not ".bashrc" but "inputrc". Not sure why this one is not hidden, but so it is. You could try ~/.inputrc for a local, user-specific configuration.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Tried this in Ubuntu, and it works.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
And I tried it in kde-neon and it works.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Credit goes to Andreas Hennings aka "donquixote". Visit his page about this <a href="http://dqxtech.net/blog/2011-03-06/linux-bash-history-pgup-pgdown" target="_blank">here</a> </div>
</div>
Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0tag:blogger.com,1999:blog-4531223942882864425.post-81100771797822838172017-10-20T11:56:00.001+08:002017-10-20T11:56:42.505+08:00Error mounting NFS volumeIf you got error to mount NFS volume in CentOS like below:<br />
<br />
#mount -t nfs 10.12.1.23:/volume1/test /mnt/test <br />mount: wrong fs type, bad option, bad superblock on 10.12.1.230:/volume1/test,<br /> missing codepage or helper program, or other error<br /> (for several filesystems (e.g. nfs, cifs) you might<br /> need a /sbin/mount.<type> helper program)<br /><br /> In some cases useful info is found in syslog - try<br /> dmesg | tail or so.</type><br />
<br />
<br />
<br />
<br />
To solve this problem, you need to install nfs-utils package:<br />
<br />
#yum install nfs-utils<br />
<br />
In debian-based distros, you can try install nfs-common package:<br />
<br />
#apt install nfs-common<br />
<br />
<br />
That's all there is to it!<br />
<br />
Have fun :)<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />Zamrihttp://www.blogger.com/profile/06523690857579401169noreply@blogger.com0