Showing posts with label mac. Show all posts
Showing posts with label mac. Show all posts

Tuesday, May 17, 2016

OS X El Capitan 10.11.5 Combo update

About the OS X El Capitan v10.11.5 Update

This update is recommended for all OS X El Capitan users.

The OS X El Capitan v10.11.5 Update improves the stability, compatibility, and security of your Mac, and is recommended for all users.
This update includes the following enterprise changes:
  • Fixes an issue where applying a configuration profile to set allowSpotlightInternetResults toFalse would cause Spotlight to use large amounts of CPU time.
  • Fixes an issue where applying a configuration profile to set ShutDownDisabledWhileLoggedIn to Truewould have no effect.
  • Fixes an issue where only a single NetBoot image would appear in the Startup Disk pane of System Preferences, even if multiple NetBoot images were configured on the server.
For detailed information about the security content of this update, see Apple Security Updates.
https://support.apple.com/kb/DL1876
http://support.apple.com/downloads/DL1876/en_US/osxupdcombo10.11.5.dmg

Sunday, March 6, 2016

애플 (아이폰, 아이패드, 아이팟, 아이팟터치, 맥) 제품의 일련번호 찾기

Apple 제품의 일련 번호 찾기

iPhone, iPad, iPod touch, iPod, Mac 또는 기타 Apple 제품의 일련 번호를 찾는 방법에 대해 알아봅니다.

먼저 다음을 확인합니다.

다음과 같이 제품에 따라 일련 번호를 찾을 수 있는 위치가 달라집니다.
  • 제품 겉면.
  • iTunes와 동기화되는 제품의 경우 iTunes 내부.
  • Mac의 경우 Apple 메뉴에서 '이 Mac에 관하여' 선택.
  • iPhone, iPad, iPod touch 또는 iPod의 경우 '설정' > '일반' > '정보'에서 확인.

현재 제품을 가지고 있지 않거나 전원이 켜지지 않을 경우

  • 제품 겉면에서 일련 번호를 찾을 수 있습니다.
  • 제품의 원래 포장 상자가 있는 경우 바코드를 확인하여 일련 번호를 찾을 수 있습니다.
  • iPhone, iPad, iPod touch 또는 iPod의 경우 iTunes 환경설정의 '장비' 탭에서 일련 번호를 찾을 수 있습니다.
  • 원래 제품 영수증 또는 송장에서도 제품의 일련 번호를 찾을 수 있습니다.

일련 번호를 찾는 데 대한 자세한 내용은 아래에서 제품을 선택하여 확인할 수도 있습니다.

장비

Mac

기타

도움말 얻기

Apple 등록 번호 및 Apple 하드웨어 제품의 일련 번호에는 숫자 '0'(영)이 사용될 수 있으나 알파벳 'O'는 사용되지 않습니다.
최근 수정일:

Thursday, August 21, 2014

Screen shot setting on Mac OS X

파일 타입 변경:
defaults write com.apple.screencapture type jpg

가능한 파일 타입에는 bmp, pdf, jpg, jp2, tif, pict, tga, png 등이 있습니다.


파일명 prefix 지정:
defaults write com.apple.screencapture name "capture-"

지정된 prefix 문구 뒤에 날짜와 시간은 자동으로 붙습니다.

Tuesday, February 11, 2014

vi command : find and replace

reference : http://vim.wikia.com/wiki/Search_and_replace

Basic search and replace

The :substitute command searches for a text pattern, and replaces it with a text string. There are many options, but these are what you probably want:
:%s/foo/bar/g
Find each occurrence of 'foo' (in all lines), and replace it with 'bar'.
:s/foo/bar/g
Find each occurrence of 'foo' (in the current line only), and replace it with 'bar'.
:%s/foo/bar/gc
Change each 'foo' to 'bar', but ask for confirmation first.
:%s/\/bar/gc
Change only whole words exactly matching 'foo' to 'bar'; ask for confirmation.
:%s/foo/bar/gci
Change each 'foo' (case insensitive) to 'bar'; ask for confirmation.
This may be wanted after using :set noignorecase to make searches case insensitive.
:%s/foo/bar/gcI
Change each 'foo' (case sensitive) to 'bar'; ask for confirmation.
This may be wanted after using :set ignorecase to make searches case sensitive (the default).
The g flag means global – each occurrence in the line is changed, rather than just the first. This tip assumes the default setting for the 'gdefault' and 'edcompatible' option (off), which requires that the g flag be included in %s///g to perform a global substitute. Using :set gdefault creates confusion because then %s/// is global, whereas %s///g is not (that is, g reverses its meaning).
When using the c flag, you need to confirm for each match what to do. Vim will output something like: replace with foobar (y/n/a/q/l/^E/^Y)? (where foobar is the replacement part of the :s/.../.../ command. You can type y which means to substitute this match, n to skip this match, a to substitute this and all remaining matches ("all" remaining matches), q to quit the command, l to substitute this match and quit (think of "last"), ^Eto scroll the screen up by holding the Ctrl key and pressing E and ^Y to scroll the screen down by holding the Ctrl key and pressing Y. However, the last two choices are only available, if your Vim is a normal, big or huge built or the insert_expand feature was enabled at compile time (look for +insert_expand in the output of :version).
Also when using the c flag, Vim will jump to the first match it finds starting from the top of the buffer and prompt you for confirmation to perform replacement on that match. Vim applies the IncSearch highlight group to the matched text to give you a visual cue as to which match it is operating on (set to reverse by default for all three term types as of Vim 7.3). Additionally, if more than one match is found and you have search highlighting enabled with :set hlsearch, Vim highlights the remaining matches with the Search highlight group. If you do use search highlighting, you should make sure that these two highlight groups are visually distinct or you won't be able to easily tell which match Vim is prompting you to substitute.

Details

Search range:
:s/foo/bar/gChange each 'foo' to 'bar' in the current line.
:%s/foo/bar/gChange each 'foo' to 'bar' in all the lines.
:5,12s/foo/bar/gChange each 'foo' to 'bar' for all lines from line 5 to line 12 (inclusive).
:'a,'bs/foo/bar/gChange each 'foo' to 'bar' for all lines from mark a to mark b inclusive (see Notebelow).
:'<,'>s/foo/bar/gWhen compiled with +visual, change each 'foo' to 'bar' for all lines within a visual selection. Vim automatically appends the visual selection range ('<,'>) for any ex command when you select an area and enter :. Also, see Note below.
:.,$s/foo/bar/gChange each 'foo' to 'bar' for all lines from the current line (.) to the last line ($) inclusive.
:.,+2s/foo/bar/gChange each 'foo' to 'bar' for the current line (.) and the two next lines (+2).
:g/^baz/s/foo/bar/gChange each 'foo' to 'bar' in each line starting with 'baz'.
Note: As of Vim 7.3, substitutions applied to a range defined by marks or a visual selection (which uses a special type of marks '< and '>) are not bounded by the column position of the marks by default. Instead, Vim applies the substitution to the entire line on which each mark appears unless the \%V atom is used in the pattern like: :'<,'>s/\%Vfoo/bar/g.

When searching:
.*\[^, and $ are metacharacters.
+?|&{(, and ) must be escaped to use their special function.
\/ is / (use backslash + forward slash to search for forward slash)
\t is tab, \s is whitespace
\n is newline, \r is CR (carriage return = Ctrl-M = ^M)
After an opening [, everything until the next closing ] specifies a /collection. Character ranges can be represented with a -; for example a letter a, b, c, or the number 1 can be matched with [1a-c]. Negate the collection with [^ instead of [; for example [^1a-c] matches any character except a, b, c, or 1.
\{#\} is used for repetition. /foo.\{2\} will match foo and the two following characters. The \ is not required on the closing } so /foo.\{2} will do the same thing.
\(foo\) makes a backreference to foo. Parenthesis without escapes are literally matched. Here the \ is required for the closing \).
When replacing:
\r is newline, \n is a null byte (0x00).
\& is ampersand (& is the text that matches the search pattern).
\0 inserts the text matched by the entire pattern
\1 inserts the text of the first backreference. \2 inserts the second backreference, and so on.
You can use other delimiters with substitute:
:s#http://www.example.com/index.html#http://example.com/#
Save typing by using \zs and \ze to set the start and end of a pattern. For example, instead of:
:s/Copyright 2007 All Rights Reserved/Copyright 2008 All Rights Reserved/
Use:
:s/Copyright \zs2007\ze All Rights Reserved/2008/

Using the current word or registers

:%s//bar/g
Replace each match of the last search pattern with 'bar'.
For example, you might first place the cursor on the word foo then press * to search for that word.
The above substitute would then change all words exactly matching 'foo' to 'bar'.
:%s/foo//g
Replace each occurrence of 'foo' with the word under the cursor.
 means that you press Ctrl-R then Ctrl-W.
The word under the cursor will be inserted as though you typed it.
:%s/foo//g
Replace each occurrence of 'foo' with the WORD under the cursor (delimited by whitespace).
 means that you press Ctrl-R then Ctrl-A.
The WORD under the cursor will be inserted as though you typed it.
:%s/foo/a/g
Replace each occurrence of 'foo' with the contents of register 'a'.
a means that you press Ctrl-R then a.
The contents of register 'a' will be inserted as though you typed it.
:%s/foo/\=@a/g
Replace each occurrence of 'foo' with the contents of register 'a'.
\=@a is a reference to register 'a'.
The contents of register 'a' is not shown in the command. This is useful if the register contains many lines of text.
:%s////g
Replace each match of the last search pattern with the / register (the last search pattern).
After pressing Ctrl-R then / to insert the last search pattern (and before pressing Enter to perform the command), you could edit the text to make any required change.
:%s/*/bar/g
Replace all occurrences of the text in the system clipboard (in the * register) with 'bar' (see next example if multiline).
On some systems, selecting text (in Vim or another application) is all that is required to place that text in the *register.
:%s/a/bar/g
Replace all occurrences of the text in register 'a' with 'bar'.
a means that you press Ctrl-R then a. The contents of register 'a' will be inserted as though you typed it.
Any newlines in register 'a' are inserted as ^M and are not found.
The search works if each ^M is manually replaced with '\n' (two characters: backslash, 'n').
This replacement can be performed while you type the command:
:%s/=substitute(@a,"\n",'\\n','g')/bar/g
The "\n" (double quotes) represents the single character newline; the '\\n' (single quotes) represents two backslashes followed by 'n'.
The substitute() function is evaluated by the = (Ctrl-R =) expression register; it replaces each newline with a single backslash followed by 'n'.
The  indicates that you press Enter to finish the = expression.

Additional examples

:%s/foo/bar/
On each line, replace the first occurrence of "foo" with "bar".
:%s/.*\zsfoo/bar/
On each line, replace the last occurrence of "foo" with "bar".
:%s/\//g
On each line, delete all occurrences of the whole word "foo".
:%s/\.*//
On each line, delete the whole word "foo" and all following text (to end of line).
:%s/\.\{5}//
On each line, delete the first occurrence of the whole word "foo" and the following five characters.
:%s/\\zs.*//
On each line, delete all text following the whole word "foo" (to end of line).
:%s/.*\//
On each line, delete the whole word "foo" and all preceding text (from beginning of line).
:%s/.*\ze\//
On each line, delete all the text preceding the whole word "foo" (from beginning of line).
:%s/.*\(\\).*/\1/
On each line, delete all the text preceding and following the whole word "foo".
:s/^\(\w\)/\u\1/
If the first character at the beginning of the current line is lowercase, switch it to uppercase using \u (seeswitching case of characters).
:%s/\(.*\n\)\{5\}/&\r/
Insert a blank line every 5 lines.
The pattern searches for \(.*\n\) (any line including its line ending) repeated five times (\{5\}).
The replacement is & (the text that was found), followed by \r (newline).
:%s/\/\=len(add(list, submatch(1)))?submatch(0):submatch(0)/g
Get a list of search results. (the list must exist)
Sets the modified flag, because of the replacement, but the content is unchanged.
Note: With a recent enough Vim (version 7.3.627 or higher), you can simplify this to:
:%s/\/\=add(list, submatch(1))/gn
This has the advantage, that the buffer won't be marked modified and no extra undo state is created. The expression in the replacement part is executed in the sandbox and not allowed to modify the buffer.

Special cases

For substituting patterns with a corresponding case-sensitive text, Michael Geddes's keepcase plugin can be used, e.g.:
:%SubstituteCase/\cHello/goodBye/g
Substitute 'Hello hello helLo HELLO' by 'Goodbye goodbye goodBye GOODBYE'
For changing the offsets in a patch file (line number of a block), this little snippet can be used:
s/^@@ -\(\d\+\),\(\d\+\) +\(\d\+\),\(\d\+\) @@$/\="@@ -".eval(submatch(1)+offsetdiff).",".submatch(2)." +".eval(submatch(3)+offsetdiff).",".submatch(4)." @@"/g
Useful when we want to strip some blocks from a patch, without patch having to complain about offset differences.
Note Should try to make the expression more compact, but don't know how without having the possibility of modifying unwanted lines.

Sunday, September 22, 2013

Linux output redirection with error

리눅스/유닉스의 콘솔/터미널의 bash 쉘 등에서는 재지향(Redirection)이라는 방법으로, 각종 명령어 출력 결과를 파일로 저장할 수 있습니다.

예를 들어 ls 명령의 출력 결과를, 연필로 옮겨쓰는 대신에
ls > out.txt

라고 하면 out.txt 라는 파일로 ls 명령의 결과가 간단히 저장됩니다. ls뿐 아니라 다른 모든 명령들도 마찬가지입니다.

> 이런 기호는, 글자들의 출력 방향을 화면이 아닌, 파일 같은 다른 데로 전환시키는 것입니다.


에러 메시지까지 파일로 저장하는 방법


그런데 위의 재지향 방법으로는 에러 메시지 출력은 저장되지 않습니다. 에러 메세지까지 파일로 저장되어 버리면, 에러가 났는지 알 수 없기 때문입니다. 기술적으로 말하자면, 일반 문자열은 "표준 출력(Standard Output)"으로 출력되고, 에러는 "표준 에러 출력(Standard Error)"으로 출력되기에 재지향이 안되는 것입니다.

에러까지 재지향하여 파일로 저장하는 방법이 있습니다.

ls ewyrsyrwyy >& out.txt

이렇게 &> 기호로 재지향하면 됩니다. ewyrsyrwyy 라는 이름의 파일이 없을 것이기에, ls 에서 그런 파일을 찾을 수 없다(No such file or directory)고 에러가 납니다. 그 에러 메시지가 out.txt 라는 파일로 저장됩니다.

출처:
http://mwultong.blogspot.com/2006/10/linux-unix-output-to-file.html
https://kldp.org/node/1742

Wednesday, July 25, 2012

맥에서 오프라인 위키피디아 설정 [Set up offline Wikipedia on Mac OS X]


  1. System 
    1. Operating system : OS X Mountain Lion 10.8 GM (Build 12A269)
    2. Hardware : 2010 Mid Macbook Pro 2.53GHz + 8GB RAM
  2. Install MAMP
    1. http://www.mamp.info/en/index.html
    2. one click install Mysql, Apache, PHP for Mac
    3. mysql configure file : sudo vi /Applications/MAMP/Library/my.cnf
  3. Install MediaWiki
    1. http://www.mediawiki.org/wiki/MediaWiki
  4. Download Wikipedia db
    1. http://en.wikipedia.org/wiki/Wikipedia:Database_download#Where_are_images_and_uploaded_files
  5. Import db
    1. http://www.mediawiki.org/wiki/Manual:MWDumper

Thursday, July 19, 2012

맥에서 안드로이드 개발을 위한 준비 과정 [How to set up for android development on Mac OS X]


Logged at July 18, 2012 by Kunsu OH
  1. System 
    1. Operating system : OS X Mountain Lion 10.8 GM (Build 12A269)
    2. Hardware : 2010 Mid Macbook Pro 2.53GHz + 8GB RAM
  2. Install Eclipse
    1. http://www.eclipse.org/downloads/
    2. Download "Eclipse IDE for Java Developers" (~150MB)
    3. Untar and Move "eclipse" folder to "Applications" folder
    4. Run Eclipse
  3. Install Android ADT
    1. Help > Check for Updates
    2. Help > Install New Software
    3. Work with: > Click "Add..." > Name: Android ADT > Location: https://dl-ssl.google.com/android/eclipse > OK
    4. Select All > Next > Next > ... accept ... > Finish > waiting sometime > 
  4. Install Android SDK
    1. http://developer.android.com/sdk/index.html
    2. Download "android-sdk_r20.0.1-macosx.zip" (~60MB)
    3. Use existing SDKs > Existing Location > Next > Next ... > updates
    4. Done!
  5. Hello World
    1. http://istarcube.tistory.com/entry/맥에서-안드로이드-개발을-위한-준비과정-4-안드로이드-테스트-어플-시연해보기
  6. Reference
    1. http://istarcube.tistory.com/

Tuesday, July 17, 2012

맥에서 wget 대신 curl 사용법 [How to use "curl" command instead of "wget" on OS X]

wget {URL}    =    curl {URL} -o {FILENAME}   


또는 아래 사이트에서 다운 받아서,
./configure
make
sudo make install



Friday, July 13, 2012

맥에서 Gmail 푸쉬설정 (How to Push enable for Gmail in Mac OS X)


Take advantage of push email servers in Mail.app Apps
This should be manifestly obvious (and that's probably why I couldn't find any documentation for it). But then again, you'd think they would put it in, for instance, Gmail's IMAP setup help page, but it's not...

I am sure we all have heard about Push in Apple's Mail by now. For those folks who use email to the point of obsession (I'm afraid I do), this is a great way to keep your mailboxes up-to-the-second current without having Mail.app hog the bandwidth, checking every minute or five minutes. If your server supports IDLE (Gmail, .Mac/MobileMe, and most university servers do), then the only things you need to do are:
  1. Go into Mail » Preferences » Accounts (Advanced) and make sure that Use IDLE command if the server supports it is enabled (it's enabled by default).
  2. (This is the fun part) Again go into Mail » Preferences » General and set Check for new Mail to Manually.
Now send yourself a new message (preferably from a different account) and watch the fun.

[robg adds: If you have a mix of accounts some of which include IDLE support and some which don't (as I do), here's another way to set this up. For the IDLE-enabled accounts, uncheck the box next to 'Include when automatically checking for new mail' on the Advanced tab of that account's settings pages. For the non-IDLE accounts, leave this box checked.

Then, in General in Mail's Preferences, leave the 'Check for new mail' pop-up set to whatever time interval you prefer. This way, your IDLE-enabled email will show up as soon as the server pushes it to your machine, but you'll still check the non-IDLE accounts on a regular basis. This works quite well for me -- three of my accounts have IDLE enabled and the email just shows up, while the other two accounts are checked using Mail's automatic checks.]

Friday, September 23, 2011

RSA인증을 이용한 SSH 접속

1. client
$ cd
$ mkdir .ssh
$ chmod 700 .ssh
$ ssh-keygen -q -f .ssh/id_rsa -t rsa
Enter passphrase (empty for no passphrase): ## input personal passwd
Enter same passphrase again: ## input same personal passwd

$ chmod go-rwx .ssh/*

$ scp .ssh/id_rsa.pub userid@server.phys.pusan.ac.kr:/home/server

2. server
$ cd
$ mkdir .ssh
$ chmod 700 .ssh
$ cat id_rsa.pub >> .ssh/authorized_keys
$ chmod 600 .ssh/authorized_keys
$ rm id_rsa.pub

  1. http://leanu.tistory.com/entry/OpenSSH-Public-Key-Authentication#recentTrackback
  2. http://sial.org/howto/openssh/publickey-auth/
  3. http://guni.tistory.com/138