Ubuntu 管理心得

搜尋此網誌

2021年2月23日 星期二

Change ( Remove ) mayo theme from drupal 9

sudo vim /home/chiao/public_html/drupal9/web/sites/default/settings.php
Uncomment this line:
# $config['system.theme']['default'] = 'stark';
Namely,  $config['system.theme']['default'] = 'stark';
 
Go back to drupal site and change the default theme.
Then, comment the above line in settings.php

 

2021年2月18日 星期四

Shrink vmware vmdk size

 cf: https://blog.xuite.net/tolarku/blog/331992410-%E7%B8%AE%E5%B0%8F+VMDK+%E8%99%9B%E4%BD%94%E7%94%A8%E7%9A%84%E7%A9%BA%E9%96%93+-+shrink+a+thin+provisioned+disk

https://longfamily.pixnet.net/blog/post/350412959-vmware-virtual-disk-shrink-%E5%B0%87vmdk%E6%AA%94%E6%A1%88%E7%B8%AE%E5%B0%8F

  1. Assume that mydisk.vmdk is mounted on /dev/sda1 with directory /BACKUP
  2. Suppose 950GB to be shrink. Issue this:
    sudo dd bs=1M count=950000 if=/dev/zero of=/BACKUP/zero.dat status=progress
    This is for creating a 1M * 950000 = 950GB  zero filled file, zero.dat
  3. Then, delete this file,
    sudo /bin/rm -rf
    /BACKUP/zero.dat
  4. Close vmware-workstation and go back to host. Go to the vmdk file directory, say /vmware/mydisk.vmdk
  5. Make sure /vmware has doule size space of mydisk.vmdk because the following shrinking command will create another mydisk.vmdk.tmp file.
  6. sudo vmware-vdiskmanager -k mydisk.vmdk
  7. Go back to vmware-workstation. Click the 'Compact Disk' in the setting windows.
However, the process above can only reduce the logic size rather than the physical size of the hard disk. The vmdk is still of original size. One way to really reduce the vmdk is only to create another vmdk, say my60GB.vmdk.
  1. Use clonezilla to boot the vmware guest.
  2. Enter the expert mode,unclick and click options as follows:

  3. Start to disk to disk cloning.
  4. Done

2021年2月14日 星期日

enable lock

gsettings set org.gnome.desktop.lockdown disable-lock-screen false
 

press Super-L to activate lock.  

2021年2月13日 星期六

sudo without password

 Put the following line at the END of /etc/sudoers

chiao    ALL=(ALL) NOPASSWD:ALL

2021年2月10日 星期三

Disable numpad digits

 https://askubuntu.com/questions/1135192/how-to-disable-numpad-digits-in-ubuntu-18

Open Onboard, keyin (click actually)  the following command:

 xmodmap -e "remove mod2 = Num_Lock"


2021年2月7日 星期日

Clone persistent live usb (ubuntu 20.20) to vmware

  1.  Use gnome-disks to backup the usb image
  2. Create a new vmware new virtual machine. Create a 75GB disk. Use ubuntu cd to boot the virtual machine.
  3. Inside the virtual machine, 
    1. Connect the host with nfs,
    2. Open gnome-disks
    3. Select the 75GB disk
    4. Restore the backup image in host

       
  4. Make sure the restored disk is good. Open gparted to check it.
  5. It should be good for booting from the restored disk.

 

網誌存檔