Allocate lo0 IP address using Mac login hook automatically




Hello everyone it’s me candle.
In this time we would like to use the login hook of Mac and automatically allocate the local ip address.
You can use the default lolcal IP address on your Mac.
However when using it with docker, you need to prepare other local IP address separately.


You use Mac.

Check the IP address of lo0

Fist you check the IP address allocated to mac lo0 with ifconfig command.


You can see the

Make a sh file which allocates IP address

Let’s make the shell script file which allocates IP address.

touch ~/

Open the file and write this code.


sudo ifconfig lo0 alias

Save it.

As a supplemental explanation, In general it seems to be allocated or etc.
However in my case, since I couldn’t use that IP address in docker, I choose the IP address written in the docker official page.

Register to Mac login hook

Grant execution permission to the created

chmod u+x ~/

Next change the executable user so that the root user can execute it.

suso chown root:wheel ~/

The file state is like this.

Register to login hook.

sudo defaults write LoginHook ~/

You can confirm it with this command.

sudo defaults read LoginHook

how does it work

Restart the Mac PC and run ifconfig command.



Using mac login hook, you can allocate any IP address without executing the IP address registration command every time.


If you think this article is good, share it please




Your email address will not be published. Required fields are marked *


Using vc to manage git on emacs25

Abstract Hello everyone it’s me candle. In this article we would like to use vc(version controll) which is included by deault in emacs. It seems that vc supports to both subversion and git, not git-specific functions. If you want to use git with emacs in earnest, I recommend magit. On the other hand, since vc is installed in by default, it is good for user who want to use it easily. Precondition You use emacs You have a basic git skill. vc-git configuration of emacs Although vc supports to git, ‘git add’ and ‘git reset HEAD’ do not exist. I …

Fix emacs powerline character gets corruption(mojibake) on Mac standard terminal or iTerm2

Abstract Hello everyone it’s me candle. In this time I will show you how to fix emacs powerline character corruption(mojibake). I am referring to this site. I will explain both iterm2 and mac standard terminal. In my case I launch the Emacs with iterm2, the arrow of powerline gets garbled. Let’s fix. Precondition You use emacs Your emacs was installed powerline. You use emacs with iTerm2 or mac standard terminal.

Write haml with Atom

English 日本語 Abstract Hello everybody, it’s candle. In this time we will write haml with Atom. I’m coding with emacs for all time. but sotimes I use atom. When I open a haml file, there is no coloring and syntax, I try to add plugin. Premise You have Atom editor.

Build PlantUML environment on Mac using brew

Abstract Hello everybody it’s me candle. In this article, I would like to build a plantUML environment which can make UML easily on Mac. I have been used starUML for making UML. plantUML seems to be much more useful than that. Precondition You already use brew. Check java version I think that java is already installed in your mac pc. PlantUML can be run with mac default java. So you launch terminal app and check the java version with the below command. java -version Probably it can be work in java version around 1.8.x . Install graphviz graphviz is a …

How to send pdf from Mac to iphone or ipod using iBooks

English 日本語 Abstract Hello everyone, It’s me candle. In this time, I will show you how to send a pdf file from Mac to iphone or ipod. Sometimes I want to read the pdf document in the train, so I wrote the article about it. Before you send a pdf file to the iphone, you add the pdf to iBooks app. Then you will send the pdf with itunes. Precondition Mac PC iphone or ipod or ipad pdf file


I work in the venture company as a CTO. I start to write program in University, first I learned java, C++ and PHP. In the company, I'm developing web services by Rails. I do like to automation.