Monday, June 27, 2022

qemu command line

 qemu-system-x86_64.exe -accel hax -cpu core2duo -m 1024 -hda zeroshell.vmdk -net user,hostfwd=tcp::11111-:443 -net nic,model=pcnet -device nec-usb-xhci,id=xhci -netdev user,id=eth01 -device usb-net,netdev=eth01 -device usb-host,bus=xhci.0,vendorid=0x0B95,productid=0x1790


qemu-system-x86_64.exe -accel hax -cpu core2duo -m 1024 -hda zeroshell.vmdk -net user,hostfwd=tcp::11111-:443 -net nic,model=pcnet -device qemu-xhci,id=xhci -netdev user,id=eth01 -device usb-net,netdev=eth01 -device usb-host,bus=xhci.0,vendorid=0x0B95,productid=0x1790


qemu-system-x86_64.exe -accel hax -cpu core2duo -m 1024 -hda zeroshell.vmdk -net user,hostfwd=tcp::11111-:443 -net nic,model=pcnet


device_add nec-usb-xhci

device_add usb-net

Thursday, June 16, 2022

Openwrt on vmware play12 add usb axis 88179 (usblan)

1. Install openwrt ova

 https://openwrt.org/docs/guide-user/virtualization/vmware

2. Install axis usb

opkg update

opkg install kmod-usb-net-axis-ax88179

3. Upgrade vm hardware version

    vmrun.exe" -T player upgradevm test.vmx

4. Batch command for non GUI

"C:\Program Files (x86)\VMware\VMware Player\vmrun.exe" -T player start "c:\VirtualBox VMs\vmware\test\Test.vmx" nogui

5. Add blow in test.vmx for auto attach usb when boot

usb.autoConnect.device0 = "0x0B95:0x1790"

GIMP script-fu multi-crop picture

 Sample 1 this for use in Gimp --> save to test.scm

(define (script-fu-Test_scrip image drawable)
(
(plug-in-autocrop RUN-NONINTERACTIVE image drawable)
(gimp-displays-flush)
(gimp-file-save RUN-NONINTERACTIVE image
drawable filename filename)
)
)
(script-fu-register "script-fu-Test_scrip"
  _"Add Test_scrip"
  _"Add Test_scrip123"
  "Prapop Puapermpoonsiri<prapopp@hotmail.com>"
  "Prapop Puapermpoonsiri
  "2022/06/66"
  "RGB*"
  SF-IMAGE       "Image"           0
  SF-DRAWABLE    "Drawable"        0
)
(script-fu-menu-register "script-fu-Test_scrip" "<Image>/Filters/Decor")

**** need to refresh script-fu in toobar filter

Sample2 for batch command-->

batch-autocrop.scm

  (define (batch-autocrop pattern)
  (let* ((filelist (cadr (file-glob pattern 1))))
    (while (not (null? filelist))
           (let* ((filename (car filelist))
                  (image (car (gimp-file-load RUN-NONINTERACTIVE
                                              filename filename)))
                  (drawable (car (gimp-image-get-active-layer image))))
                  
             (plug-in-autocrop RUN-NONINTERACTIVE
                                   image drawable)
                                   
             (gimp-file-save RUN-NONINTERACTIVE
                             image drawable filename filename)
             (gimp-image-delete image))
           (set! filelist (cdr filelist)))))
  1. Copy the batch-autocrop.scm into the scripts folder

Where do Gimp scripts and plugin live? It’s easy to find out. Open Gimp and within the top menu bar select Edit\Preferences\Folders, expand Folders out and Select “Scripts”. It is recommended to put your personal scripts into your configuration folder as circled in red below.

image of Gimp menu items
  1. Within a terminal change into the directory of images you want to crop and run the script
    gimp -i -b '(batch-autocrop "*.PNG")' -b '(gimp-quit 0)'            <---linux
sample2  Cr. Joe Lotz and Greg Hildström
https://www.joelotz.com/blog/2020/batch-autocrop-png-images-in-gimp.html
I addition :command on windows
C:\Me\12>gimp-2.10 -b "(batch-autocrop \"*.JPG\")" -b "(gimp-quit 0)"
Cr. for fix  Sam Kupera and  saulgoode@flashingtwelve.brickfilms.com
https://www.gimpusers.com/forums/gimp-user/3587-trouble-calling-running-batch-script-in-windows-xp#message14390