'분류 전체보기'에 해당되는 글 167건
- 2010.03.10 LaTeX Source Code Listing
- 2010.03.09 Bash profile
- 2010.03.08 Shortcut in Unix/Linux/OSX
- 2010.03.03 NAO installation 3
- 2010.02.17 Gantt Chart in Google Docs 1
- 2010.02.15 fork: Resource temporarily unavailable
- 2010.02.15 타임머신 사용
- 2010.02.11 Mail Backup
- 2010.02.09 TeX 시스템, 한글 환경 설치
- 2010.02.09 Show hidden files in Finder
Bash profile
OSX 2010. 3. 9. 11:22쉘을 써보려면 당연히 Terminal 이 필요 하다.
Terminal 은 위의 스샷과 같이 Application-> Utility 에 존재 한다
declare -x SHELL='/bin/bash'
위에서 보는 바와 같이 Mac OS X 의 default Shell은 Fedora나 Ubuntu 와 마찬가지로 Bash Shell 이다.
Bash shell 은 bashrc 라는 파일을 이용해서 Customizing 할 수 있다.
/etc/bashrc 라는 파일이 모든 유저에게 적용되는 bashrc 파일이고
Ubuntu 나 Fedora 에서는 $HOME/.bashrc 파일을 생성 ( 대부분 이미 생성되어 있다 ) 하여 유저별 Customizing 이 가능하다.
내가 이글을 쓰고 있다는 얘기는 $HOME/.bashrc 가 동작하지 않는 다는 얘기다.
.bashrc 를 불러 주는 건 .bash_profile 이다..
그래서 .bash_profile 을 찾아 보았는데 , 이것도 없다 ㅎㅎ
# .bash_profile
if [ -f ~/.bashrc]; then
. ~/.bashrc
fi
위와 같이 .bash_profile 을 생성해주면
이제 Terminal 을 실행 실킬때 bashrc 를 실행 해주게 된다. :)
Shortcut in Unix/Linux/OSX
OSX 2010. 3. 8. 00:16sudo ln -s /Applications/MATLAB_R2008b.app/bin/matlab /usr/bin/matlab
NAO installation
OSX 2010. 3. 3. 17:20Installation
Follow the steps below to install the SDK on your Mac OS X computer:
- Download "Mac Leopard nao SDK" from the Aldebaran website.
- Extract the contents of the SDK (.tar.gz) file in a directory (for example in "~/naoqi/").
- Create an environment variable AL_DIR: export AL_DIR="/home/mylogin/naoqi/" (of course, change 'mylogin' by your login). It can be useful to set it in the .bashrc file for permanent export.
Note: AL_DIR must be set to the directory which contains the README file.
We are now ready to compile nao SDK examples.
Warning: |
Remember that the Cross compilation is only available for Linux. |
---|
Compilation instructions (HelloWorld sample)
There are two ways to compile a module:
- As an executable (remote modules): each modules package creates an independent executable stored in "$AL_DIR/modules/bin/". At startup you need to specify the IP and the port of the NaoQi running.
- As a library: each modules package creates a dynamic library stored in "$AL_DIR/modules/lib/". To make this library loaded by NaoQi, the $AL_DIR/module/lib/autoload.ini file needs to be updated with the name of your modules library.
CMake compilation tools is used to generate make or IDE project (XCode, ...).
Compiling modules as executable
Follow the steps below to compile NaoQi SDK examples as executable:
- Be sure that the NaoQi executable and modules packages are not running.
- Go to the $AL_DIR/modules/src/examples/ directory.
- Create and jump into a temporary build directory (example $AL_DIR/modules/src/examples/build/).
- Run
- Run the configuration command
- Be sure that the HELLO_WORLD_IS_REMOTE option is set to .
- Reconfigure by pressing c.
- Quit cmake configuration by pressing g.
- Then compile: The generated binaries are copied to the modules/bin directory.
- Edit the autoload.ini file ($AL_DIR/modules/lib/autoload.ini).
> The line helloworld must not be present.
> "Autoload.ini" is used to load dynamic library at startup.
Note: |
At anytime, you can reset your project by deleting contents of the build directory and relaunch 'cmake ..' |
---|
Note: |
You can generate a XCode project with the command |
---|
Note: |
Many options are available with cmake, refer to the CMake website for further information. |
---|
Now let's start modules packages executable:
- Start the main broker by launching NaoQi executable ($AL_DIR/bin/naoqi).
- Start helloworld executable ($AL_DIR/modules/bin/helloworld).
> You will see some log in the mainbroker terminal.
- Run the python file to test helloworld:
a.
b.
At this point, the log message "Info : MyModule : Hello World!" is printed on the mainbroker (NaoQi) terminal.
Note: |
If a module package is compiled as an executable, you can connect it to the robot by editing the IP (and port if needed) of the main broker in the file. |
---|
Note: |
Once you have launched a broker, you can see the generated API http web page by using the IP and the port of this broker : http://127.0.0.1:9559 . Here you can find modules and methods descriptions. |
---|
Warning: |
The socket server may not be available when starting NaoQi. Two things can lead to this situation: - NaoQi crashed: wait few seconds, the operating system is going to free the socket. - NaoQi is still alive: kill NaoQi and restart. |
---|
Compiling modules as dynamic library
Follow the steps below to compile NaoQi SDK examples as library:
- Be sure that NaoQi executable and modules packages are not running.
- Go to the $AL_DIR/modules/src/examples/ directory.
- Create and jump into a temporary build directory (example: $AL_DIR/modules/src/examples/build/).
- Run
- Run the configuration command
- Switch OFF the HELLOWORLD_IS_REMOTE option.
- Reconfigure project by pressing c.
- Quit cmake configuration by pressing g.
- Then compile: make..
> The generated libraries are copied to the modules/lib directory ($AL_DIR/modules/lib/helloworld.so).
- Edit the autoload.ini file ($AL_DIR/modules/lib/autoload.ini) by adding this line: helloworld (before the [remote] line).
- Start NaoQi executable ($AL_DIR/bin/naoqi).
> The mainBroker starts and the module MyModule is loaded (cf log message).
- Run the python file to test helloworld:
a.
b.
At this point, the log message "Info : MyModule : Hello World!" is printed in the mainbroker (NaoQi) terminal.
Warning: |
The socket server may not be available when starting NaoQi. Two things can lead to this situation: - NaoQi crashed: wait few seconds, the operating system is going to free the socket. - NaoQi is still alive: kill NaoQi and restart. |
---|
Gantt Chart in Google Docs
Etc 2010. 2. 17. 16:07Google Spreadsheets Tips: Gantt Chart (Microsoft Project-like) using Widget
![](http://lh5.ggpht.com/_TqPdHmAEwTM/SrVeWExP8iI/AAAAAAAAFqk/ygCe1B6U0E8/al.jpg)
Google Spreadsheets is a powerful web application to do everything you do using Excel. A nice way to use it is to manage a project plan with a gantt chart (microsoft project-like) and share it on-line with your team.This is a free and versatile solution to do that. This tutorial illustrates how to use Google Spreadsheets Viewpath Gadget to implement it.
![](http://lh5.ggpht.com/antonio.lupetti/SEKeM3fPx_I/AAAAAAAABjY/2pghIuvHZBw/gantt.gif)
![](http://4.bp.blogspot.com/_TqPdHmAEwTM/R0y1sktnjaI/AAAAAAAAAlg/jcw1WbgNTso/s400/page_excel.png)
Step 1: Project Plan structure
First step is defiing your project plan structure. I suggest you to use this basic structure:
Column A: Task ID (WBS) (an unique ID which identifyes each task with a progressive number).The result is something like this:
Column B: Task description (a short description of the activity).
Column C: Percentage of completion (0%-100%).
Column D: Predecessor (finish-start relationships between tasks).
Column E: Start date (task start date).
Column F: Finis date (task finish date).
![](http://lh3.ggpht.com/antonio.lupetti/SEKljXfPyCI/AAAAAAAABjw/k9pYbSluhv8/gantt4.gif)
All previous fields are required for viewpath gadget but, if you want, you can add other columns with other infos (for example the name of a resource assigned to each task, task duration in terms of day, ecc...). When your project plan structure is completed you are ready to add Gantt Chart using Google Spreadsheets Viewpath Gadget.
Step 2: Add Gantt Gadget
Click on Chart icon and select Gadget option.
![](http://lh5.ggpht.com/antonio.lupetti/SEKhP3fPyAI/AAAAAAAABjg/_5tK1BVZrJw/gantt2.gif)
In the Gadget window find and select Gantt Chart gadget (by Viewpath) and click on Add to spreadsheet button:
![](http://lh5.ggpht.com/antonio.lupetti/SEKiz3fPyBI/AAAAAAAABjo/H0EEXtImxBk/gantt3.gif)
In the option window assign all required parameters to the correct column of your project plan structure (for example Start dates in this example are in the column E):
![](http://lh3.ggpht.com/antonio.lupetti/SEKnSXfPyDI/AAAAAAAABj4/Geh90r1jOSg/gantt5.gif)
After assigned all columns, click on apply button and see the result. Now you can save your project plan , publish and share it with all member of your team.
fork: Resource temporarily unavailable
OSX 2010. 2. 15. 15:41Mac OS X … “fork: Resource temporarily unavailable”
Almost a year ago, I made the switch to using Mac OS X as my primary workstation. As difficult as the transition was during my first 3 weeks, it has now become second nature to me. I haven’t had any major issues along the way, but now and then, I have had to tweak a thing or two. Here is the most recent such example.
Lately, I’ve been seeing a fair number of the following error, when launching commands under Bash within a local Terminal session. It’s rather annoying, because it stops me from getting any work done. As a systems administrator, I have lots of Terminal sessions open, and this is where the error has always manifested itself.
[laptop:~ root]$ ssh somehost
-bash: fork: Resource temporarily unavailable
The first time this happened to me, I didn’t think much of it, so I rebooted my system. Today, I did not feel like rebooting my system, because I have a ton of work in progress. I suspect most people won’t hit this resource limit, but if you’re a power user, you eventually might.
Like other Unix-like operating systems, Max OS X limits the maximum number of processes, system-wide and per-user, but it does so with a rather conservative number. On my Mac, system-wide processes were limited to 512, and per-user processes were limited to 266. I’ve never encountered this problem on Linux, because these values are dynamically set in the kernel, based on the amount of memory installed in the Linux system.
Here’s how I resolved this problem.
- First, determine what your system’s current limits are. These are the values on my installation of Mac OS X 10.5 with 4 GB of RAM.
[laptop:~ root]$ sysctl -a | grep maxproc | grep =
kern.maxproc = 512 kern.maxprocperuid = 266
- Now set these to higher values. I suggest approximately doubling what you already have.
[laptop:~ root]$ sysctl -w kern.maxproc=1024
[laptop:~ root]$ sysctl -w kern.maxprocperuid=512
- You’ll also want to apply these changes automatically at system bootup. To do so, add them to the /etc/sysctl.conf file.
[laptop:~ root]$ cat /etc/sysctl.conf
kern.maxproc=1024 kern.maxprocperuid=512
- At this point, launched processes will still inherit the default maxprocperuid value of 266. I would like to change this inherited default value for new processes automatically, but I haven’t found a way to increase the default system-wide soft-limit of maxprocperuid on Mac. On Linux, I simply update the /etc/security/limits.conf file, but I don’t see such a file under Mac OS X. If you know of a way to do this in Mac OS X, leave a comment below. For now, I’ve added the following command to my user’s .bash_profile file. The value of 512 is intended to match that of kern.maxprocperuid shown above.
ulimit -u 512
- To confirm the change, launch a new Terminal session, and run the following command. Before the change, you will have seen “266.” After the change, you should see “512″.
[laptop:~ root]$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) 6144
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 256
pipe size (512 bytes, -p) 1
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 512
virtual memory (kbytes, -v) unlimited
타임머신 사용
OSX 2010. 2. 15. 15:08외장하드 있으시면 일부 파티션을 나눠 타임머신으로 그 파티션을 타겟 설정해서 os 클린설치와 어플설치를 마치고 외장하드를 연결해서 한번 백업받아놓으면 나중에 OS DVD 넣어서 부팅후 타임머신 백업으로부터 복구하시면 될듯.
Mail Backup
OSX 2010. 2. 11. 22:41 술 픈앙마
1. 사파리 북마크 : 파일 메뉴의 책갈피 보내기로하여 HTML로 저장한 후 나중에 가져오기 하시면 됩니다.
2. 메일
기본적으로 ~/라이브러리/Mail/Mailboxes에 메일이 보관됩니다.
그냥 ~/라이브러리/Mail을 백업을 받으셔도 됩니다만
저라면 메일에서 각 메일상자에서 우축마우스 클릭하여 메일상자 아카이브로 저장을 하겠습니다.
환경설정은 ~/라이브러리/Preferences/com.apple.mail.plist 아마 맞을 겁니다. 환경설정은 백업해보지를 않아서요
Gmail 사용하시군요 ..저도 업무용으로만 사용합니다.
저는 Apple Mail에서삭제시 서버에서 삭제가 되지 않게 사용합니다.
Gmail은 거의 용량이 찰일이 없기 때문에 나중에 지메일에서 읽지않음으로 표시하면 Apple메일에서 다시 불러올수 있으니까요...
TeX 시스템, 한글 환경 설치
OSX 2010. 2. 9. 21:491 TeX 시스템, 한글 환경 설치 ¶
1.1 MacTeX 설치하기 ¶
# sudo tlmgr update --all --self
- 필요하다면 --repository 또는 --location 옵션으로 업데이트할 서버를 지정할 수 있다.(TL2009에서는 호환성을 위해 --location 옵션을 남겨 두었나 장차 없어질 수 있음)
1.2 한글 환경 설치와 업데이트 ¶
# sudo tlmgr --repository=http://ftp.ktug.or.kr/KTUG/texlive/2009 install collection-kotex
한글 환경은 최신의 것으로 언제라도 업데이트할 수 있다.
# sudo tlmgr --repository=http://ftp.ktug.or.kr/KTUG/texlive/2009 update --all
1.3 XeTeX 사용을 위한 설정 ¶
이 파일을 열어서 제일 마지막에 다음 한 줄을 써넣고 저장한다.
OSFONTDIR = {~/Library/Fonts;/Library/Fonts;/System/Library/Fonts}
MacTeX으로 설치한 경우 이 파일을 수정하려면 super user 권한이 필요할 수 있다.
- [1] 다른 위치의 texmf.cnf를 수정하면 안 된다.
2 작업환경 설정 ¶
2.1 Editor와 작업환경 ¶
2.1.1 TeXWorks ¶
2.1.2 TeXShop 이용하기 ¶
- 기본적으로 Mac OS X는 UTF-8 유니코드를 지원하므로 에디터를 사용하는 데 큰 문제는 없다. 파일의 인코딩을 반드시 Unicode/UTF-8로 선택해둔다.
- 실행 파일이 있는 위치는 /usr/texbin이다.
- pdftex이 디폴트이지만, latex/dvipdfmx, latex/dvips/pstopdf 를 모두 설정해서 사용할 수 있다. dvipdfmx를 위한 simpdftex_dpmx 스크립트를 misc의 Personal Script에 등록하는 것이 좋다. See TeXShop, TeXShop/DVIPDFMx
2.1.3 PDF sync ¶
3 기타 ¶
3.1 폰트 사용 ¶
3.2 운영관련 팁 ¶
3.3 테스트 ¶
3.3.1 테스트 코드 ¶
\documentclass{oblivoir} \begin{document} \section{헬로우} 안녕하세요, Hello World. \end{document}
Show hidden files in Finder
OSX 2010. 2. 9. 20:06![](http://cache.gawkerassets.com/assets/images/17/2009/07/thumb160x_b98882829e36b63a0b29085a3e4756d9.jpg)
By default, Mac OS X's Finder keeps system files - which generally start with a dot, like .bash_profile - out of your sight.
But that makes editing one of these files extremely difficult if you, say, want to customize your Terminal prompt. To do so without firing up vim (if you don't know, don't ask), set Finder to show all hidden files. OS X FAQ has the details on how to do it.
In the Terminal type:
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
To set it back (that .DS_Store on the Desktop is hella irritating), execute those same commands, but just switch that TRUE to FALSE. Handy.