顯示具有 ubuntu 標籤的文章。 顯示所有文章
顯示具有 ubuntu 標籤的文章。 顯示所有文章

2015年3月25日 星期三

Linux Gimp Script from bmp to SGI (*.rgb)

bmp2rgb

#!/bin/bash
{
cat <<EOF
(define
(bmp-sgi
  input
output
)
(let*
  (
(image
  (car
(gimp-file-load
RUN-NONINTERACTIVE
input
input
)
)
)
(drawable
  (car
  (gimp-image-get-active-drawable
image
)
)
)
)
(gimp-image-flatten
  image
)
(let*
  (
  (newdrawable
(car
  (gimp-image-get-active-drawable
image
)
)
  )
)
(file-sgi-save
RUN-NONINTERACTIVE
image
newdrawable
output
output
0
)
)
)
)
EOF

for i in *.bmp; do
  echo "(gimp-message \"$i\")"
  echo "(bmp-sgi \"$i\" \"${i%%.bmp}.rgb\")"
done

echo "(gimp-quit 0)"
} | gimp -i -b -

最重要的是file-sgi-save這個函式
有六個參數 要填對

2014年10月17日 星期五

nVidia gamework opengl samples build error

./../../../extensions/externals/lib/linux64/libglfw3.a(x11_gamma.c.o): In function `_glfwInitGammaRamp':
x11_gamma.c:(.text+0x49): undefined reference to `XRRGetScreenResources'
====================================================
linux ubuntu 14.04
  1. cd /usr/bin/
  2. sudo rm ld
  3. sudo ln -s ld.gold ld

2012年12月28日 星期五

打造自己的ubuntu

https://help.ubuntu.com/community/LiveCDCustomization

解壓縮 iso

Extract the CD .iso contents

Mount the Desktop .iso
mkdir mnt
sudo mount -o loop ubuntu-9.04-desktop-i386.iso mnt
Extract .iso contents into dir 'extract-cd'
mkdir extract-cd
sudo rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd

Extract the Desktop system

Extract the SquashFS filesystem

sudo unsquashfs mnt/casper/filesystem.squashfs
sudo mv squashfs-root edit


壓縮iso


sudo mksquashfs edit extract-cd/casper/filesystem.squashfs -b 1048576