Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Monday, July 02, 2012

Pipe a tar command after find command

For example, we want to pack all pdf file from a folder tree :

neo@sd2bsp:~$find 15r6 -type f -name \*.pdf -print0 | tar --null -cvjf pdfpack.tar.bz2 -T -

man find :

       -print0
              True; print the full file name on the standard  output,  followed  by  a  null  character
              (instead of the newline character that -print uses).  This allows file names that contain
              newlines or other types of white space to  be  correctly  interpreted  by  programs  that
              process the find output.

man tar :
       --null --files-from reads null-terminated names, disable --directory

       -T, --files-from F
     get names to extract or create from file F

More over, move all pdf files from one folder to another :

neo@sd2bsp:/tmp/all_pdf$ find ~/vendor/15r6 -type f -name \*.pdf -print0 | tar --null -cvf - -T - | tar x


Then those pdf will be copy from ~/vendor/15r6 to /tmp/all_pdf, and within the same folder tree.



Sunday, March 04, 2012

Build UEFI EDK2 UnixPkg 64bit under Ubuntu 11.10


Fellow the instruction here :
http://blog.xuite.net/meloscheng/note/56299386

Two place need to modify :

1. Link crt*.o to correct place :

root@neou11:/usr/lib# ls /usr/lib/crt* -l

lrwxrwxrwx 1 root root 32 2012-03-04 02:37 /usr/lib/crt1.o -> /usr/lib/x86_64-linux-gnu/crt1.o
lrwxrwxrwx 1 root root 32 2012-03-04 02:37 /usr/lib/crti.o -> /usr/lib/x86_64-linux-gnu/crti.o
lrwxrwxrwx 1 root root 32 2012-03-04 02:37 /usr/lib/crtn.o -> /usr/lib/x86_64-linux-gnu/crtn.o

2. Use GCC 4.6 instead of 4.4 :


neo@neou11:~/work/edk2-12898/UnixPkg$ svn diff build64.sh
Index: build64.sh
===================================================================
--- build64.sh (revision 12898)
+++ build64.sh (working copy)
@@ -41,7 +41,7 @@
 # Pick a default tool type for a given OS
 #
 TARGET_TOOLS=MYTOOLS
-UNIXPKG_TOOLS=GCC44
+UNIXPKG_TOOLS=GCC46
 NETWORK_SUPPORT=
 case `uname` in
   CYGWIN*) echo Cygwin not fully supported yet. ;;

Then SecMain could be built, and running.

Thursday, March 01, 2012

Don`t mess your environment, use schroot instead

以 Linux 當開發環境的人, 常在系統裡安裝一堆有的沒的 Library, 特別是要 match 某些 open source 的開發需求時, 有時候萬一一個不小心, 把你日常的桌面環境搞爆炸了, 復原或是重新安裝可就是一筆大工程...

在一個對網路不友善的環境中,  要是爆炸了, 那更是一種難受的折磨...

要是純是 x86 的開發需求, 可以用單純的 chroot 環境來應付, cross compiler 也有成熟的 sandbox mode 相關的工具,  另外 schroot 則是補足 chroot 的需求, 讓一般的用戶也可以切換到一個隔離的開發環境, 適合在多人分享的 build server 下使用...

This note is Chinese, but author too busy to finish them all :-(
http://novus.pixnet.net/blog/post/29322140-%E5%A5%BD%E7%94%A8%E7%9A%84-schroot

This note is English, but with simple step-by-step :-)
https://dev.launchpad.net/Running/Schroot

Monday, June 21, 2010

Assign user name, password in smbclient



smbclient -L //192.168.x.x -o --user=USER%PASS
where USER is the user name, PASS is the password

Wednesday, March 14, 2007

設定 Linux root 密碼

眼下 LiveCD 橫行,有時想做些 root 的事,又不知 root 密碼

sudo passwd root

再來就可以 su 成 root 然後 own the world 了