Skip to content

Home

Install MongoDB on Mac OS X

First, install Homebrew, which is the missing package management tool for OS X:

Hello everyone and welcome to another episode of Continuous Improvement. I'm your host, Victor. In today's episode, we're going to talk about installing and setting up MongoDB on your Mac using Homebrew. If you're new to MongoDB or need to refresh your memory, you've come to the right place.

Before we dive in, make sure you have Homebrew installed on your system. If you don't, don't worry, I'll guide you through the process. Open up your terminal and type in the following command:

> ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Once Homebrew is installed, let's update the formulae by running:

> brew update

With Homebrew up to date, we're ready to install MongoDB. Type in the following command:

> brew install mongodb

Great! Now that MongoDB is installed, let's make sure it starts automatically on login. Run the following command:

> ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

If you want MongoDB to load immediately, you can execute:

> launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist

Alternatively, if you prefer not to use launchctl, you can start MongoDB simply by running:

> mongod --config /usr/local/etc/mongod.conf

Remember to create the data directory by running the following command:

> sudo mkdir -p /data/db

To change the directory permissions, use the following command:

> sudo chown "$(whoami)" /data/db

Lastly, to start your MongoDB database, type in:

> mongod

And there you have it! MongoDB is now successfully installed and running on your Mac. Remember, if you encounter any difficulties during the installation process or have any questions, feel free to leave a comment or reach out to me.

That's it for today's episode of Continuous Improvement. I hope you found this guide useful and that you're now ready to make the most out of MongoDB on your Mac. Stay tuned for future episodes where we'll continue exploring different topics related to continuous improvement. Don't forget to subscribe to the podcast and leave a review if you enjoyed this episode. Until next time, happy coding!

[End of Episode]

在 Mac OS X 上安裝 MongoDB

首先,安裝 Homebrew,這是 OS X 缺少的套件管理工具:

> ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

接著,更新公式:

> brew update

然後,安裝 MongoDB:

> brew install mongodb

要讓 launchd 在登入時開始 MongoDB,執行:

> ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

要立即加載 MongoDB,執行:

> launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist

或者,如果你不想或不需要 launchctl,你可以簡單地執行:

> mongod --config /usr/local/etc/mongod.conf

同時,創建數據目錄:

> sudo mkdir -p /data/db

不要忘記更改權限:

> sudo chown "$(whoami)" /data/db

最後,啟動您的數據庫:

> mongod

Enable Automatic Login for OS X El Capitan

The Problem

I just performed a fresh install of OS X El Capitan. I attempted to enable automatic login, but it remained locked. This was frustrating.

The Solution

  1. Go to System Preferences and select Security & Privacy. Turn off FileVault for the disk.
  2. Navigate to Users & Groups and click Change Password.
  3. Rather than using my iCloud password to log in and unlock this Mac, I opted to use a separate password.
  4. I set my new password.
  5. I clicked on Login Options and enabled automatic login for my account.

Yay, it worked!

Enable Automatic Login for OS X El Capitan

The Problem

Welcome back, everyone, to another episode of Continuous Improvement. I'm your host, Victor, and today we're going to dive into a frustrating problem I recently encountered while performing a fresh install of OSX El Capitan. Stick around to hear how I managed to find a solution.

So, picture this: I had just completed the fresh install of OSX El Capitan on my computer, and I was eager to set up automatic login. But to my dismay, it just wouldn't work. It was locked, no matter what I tried. Frustration was an understatement at that point.

But don't worry, folks, because where there's a problem, there's always a solution. And lucky for you, I've got the step-by-step guide to help you resolve this annoying issue. Let's jump right into it.

Step one: Open up your System Preferences and navigate to the Security & Privacy section. Take a look around, and what you want to do here is turn off FileVault for the disk. This can often be the culprit behind automatic login being locked.

Step two: Now, it's time to head over to the Users & Groups section. Here, you'll find the option to change your password. Click on it and follow the prompts to set a new password. Remember, folks, this is an important step towards unlocking automatic login.

Step three: Here's where things get interesting. Instead of using your iCloud password to log in and unlock your Mac, choose to use a separate password. It may seem a bit counterintuitive, but trust me on this one.

Step four: Set your new password. Make sure it's strong and something you'll remember. It's always good to prioritize security, especially when dealing with automatic login.

Step five: Click on Login Options within the Users & Groups section. You'll find an option to enable automatic login for your account. Go ahead and enable it, and then restart your Mac just to be on the safe side.

And just like that, my friends, you've successfully unlocked automatic login on your freshly installed OSX El Capitan. Give yourself a pat on the back. It may have been a frustrating journey, but when you overcome a challenge, the feeling of accomplishment is simply unbeatable.

Well, that wraps up today's episode of Continuous Improvement. I hope you found this step-by-step guide helpful and that it saves you from the headache I experienced. Remember, folks, continuous improvement is all about learning from our struggles and finding solutions. Until next time, take care!

啟用 OS X El Capitan 的自動登錄

問題

我剛剛進行了 OS X El Capitan 的全新安裝。我試圖啟用自動登錄,但是它仍然被鎖定。這讓我感到困惑。

解決方案

  1. 前往系統偏好設定並選擇安全與隱私權。為磁盤關閉FileVault。
  2. 導航到使用者與群組並點擊更改密碼
  3. 我選擇使用另一個密碼而不是使用我的 iCloud 密碼來登錄並解鎖這台Mac。
  4. 我設定了我的新密碼。
  5. 我點擊了登錄選項並為我的帳戶啟用自動登錄。

耶,它成功了!

Ember Inject Controller

The Problem I Encountered:

After updating my Ember project to version 1.13.5, I received the following warning in the browser console:

_DEPRECATION: Controller#needs is deprecated. Please use Ember.inject.controller() instead._

However, I couldn't find any documentation on how to implement the new syntax.

The Solution:

Though it's marked as a private method in the Ember documentation, you can view it by selecting the "private" checkbox.

There are two ways to use Ember.inject.controller(): with and without specifying a controller name.

_App.PostController = Ember.Controller.extend({ posts: Ember.inject.controller() });_

When you don't specify the name of the controller, Ember uses the property name to look it up, as in:

posts: Ember.inject.controller('posts').

You will only need to specify the controller name if the property name and the controller name are different.

_App.PostController = Ember.Controller.extend({ myPosts: Ember.inject.controller('posts') });_

This way, you can successfully update your project to comply with the new Ember guidelines.

Ember Inject Controller

The Problem I Encountered: Welcome to Continuous Improvement, the podcast where we explore solutions to common problems faced by developers. I'm your host, Victor, and today we are diving into a recent problem I encountered while updating my Ember project.

So, after updating to version 1.13.5, I was greeted with a warning in the browser console telling me that Controller#needs is deprecated. The warning kindly suggested that I should use Ember.inject.controller() instead. But, I was left wondering, how exactly do I implement this new syntax?

Luckily, I did some digging and found a solution that I'll be sharing with you today. Firstly, let's address the Ember documentation - it marks Ember.inject.controller() as a private method. But fear not, you can still access it by selecting the "private" checkbox. It's always helpful to have access to these hidden gems, isn't it?

Now, let's dive into the implementation. There are actually two ways to use Ember.inject.controller(). The first method is without specifying a controller name. For example, you can define it like this:

Victor (cont.): App.PostController = Ember.Controller.extend({ posts: Ember.inject.controller() });

What happens here is that Ember uses the property name, in this case 'posts', to look up the controller. So, whenever you access 'this.posts' in your code, Ember will automatically fetch the 'posts' controller for you.

But what if the property name and controller name are different? Well, that's where the second method comes in. You can specify the controller name using Ember.inject.controller(). For example:

Victor (cont.): App.PostController = Ember.Controller.extend({ myPosts: Ember.inject.controller('posts') });

Here we have 'myPosts' as the property name and 'posts' as the controller name. Now, whenever you access 'this.myPosts', Ember will fetch the 'posts' controller for you.

And there you have it - a solution to the deprecation warning you may face when updating your Ember project. By using Ember.inject.controller(), you can ensure your code complies with the latest Ember guidelines.

That's it for today's episode of Continuous Improvement. I hope this solution helps you tackle any similar issues you may encounter in your own projects. Remember, continuous improvement is the key to becoming a better developer.

If you have any questions or topics you'd like us to explore in future episodes, feel free to reach out to us. Thank you for tuning in, and until next time, keep coding and keep improving.

Ember注入控制器

我遇到的問題:

在將我的Ember專案更新到1.13.5版本後,我在瀏覽器控制台中收到以下警告:

_棄用警告: Controller#needs 已被棄用。請改用 Ember.inject.controller() 。_

然而,我找不到任何關於如何實現新語法的文檔。

解決方案:

雖然它在Ember文檔中被標記為私有方法,但你可以選擇“私有”複選框來查看它。

使用Ember.inject.controller()有兩種方式:指定和不指定控制器名稱。

_應用程序.貼文控制器 = Ember.控制器.extend({ 文章: Ember.inject.控制器() });_

當你不指定控制器的名稱時,Ember會使用屬性名來查找,例如:

文章: Ember.注入.控制器('文章').

只有在屬性名稱和控制器名稱不同的情況下,你才需要指定控制器名稱。

_應用程序.貼文控制器 = Ember.控制器.extend({ 我的帖子: Ember.注入.控制器('文章') });_

這樣,您就可以成功地將您的專案更新以符合新的Ember指南。

Fun Things to Do in Hanoi, Vietnam

My ambition is to travel the world, although I realize that may be a bit too ambitious.

One essential lesson I've learned in software engineering is how to manage complexity. By breaking down a large challenge into smaller, more manageable pieces, we can accomplish meaningful goals step by step. Taking a weekend getaway to Vietnam is one of those simple joys that doesn't require using annual vacation days.

Here are some fun things to do in Hanoi:

Halong Bay Kayaking - My Instagram photos may have multiple filter layers, but the scenery in Halong Bay is as beautiful as postcard pictures without any need for Photoshop. Though the journey from the city took four hours, this UNESCO World Heritage site was well worth the effort. Kayaking is my favorite way to get up close and personal with the magnificent limestone formations. If you go, remember to bring a waterproof bag to protect your iPhone in case you fall into the water.

Nature's Marvel - Dong Thien Cung Cave - Shaped by wind and water over millennia, the Dong Thien Cung cave is awe-inspiring. With a little imagination, you might see a dragon, lion, or even a breast-shaped formation among the colorful stalagmites. Interestingly, some superstitious women who struggle with breastfeeding pray for milk blessings in front of that particular rock.

Navigating the Night Market - The experience was both fantastic and overwhelming. During the Mid-Autumn Festival, I visited the bustling night market but also found myself stuck in the crowd. It seemed everyone on the street had an ice cream cone, so I got one too. The mint flavor tasted like toothpaste but was refreshing on a hot, humid night. Crossing the road in Hanoi, congested with motorcycles, is a real challenge. Regardless of whether the light is red or green, people just keep moving. Successfully crossing the street amid cars, motorcycles, and pushcarts coming from all directions takes courage. Thankfully, I made it unscathed.

Savor the Street Food - If you're adventurous, be prepared to sample a variety of local dishes. While I was there, I tried to remember the Vietnamese names of the foods, but now that I'm back home, they've slipped my mind. Although the language sounds melodic, I still can't comprehend the nuanced tones.

Egg Coffee - Don't knock it until you've tried it; it's not as off-putting as it sounds. Traditional Vietnamese egg coffee (Cà Phê Trứng) is primarily found in Hanoi. Thanks to a local guide, I enjoyed this beverage at a hidden upstairs coffee shop, priced similarly for tourists and locals. As a coffee enthusiast, another visit to a historic coffee shop for the famous condensed milk coffee—a perfect blend of sweet and bitter—is a must.

Visit the Hoa Lo Prison Museum - Let me clarify, I didn't do anything wrong! I visited the Hoa Lo Prison Museum after touring the French-style St. Joseph's Cathedral. I've always been fascinated by the darker aspects of human nature, such as torture and execution. Reflecting on history, I feel fortunate to live in an era and place without oppressive political regimes and major conflicts. The Vietnam War is not just a movie topic; it's a real-life historical event built on dubious political justifications. Each soldier has a family, and each death brings them sorrow. At that moment, I found myself missing my partner and wishing for her continued safety.

So, it's time to start planning your trip. There's so much to see and do in Hanoi that I almost missed my flight back. I plan to continue exploring and seeing what the world has to offer. Can't wait for the next adventure! If you book early, you might even find some great deals.

Fun Things to Do in Hanoi, Vietnam

Welcome to "Continuous Improvement," the podcast that brings you practical tips and insights for personal and professional growth. I'm your host, Victor, and today we're going to talk about the joy of traveling and the importance of managing complexity.

So, my ambition is to travel the world. But, let's face it, that can be quite ambitious, right? That's why I've learned a valuable lesson in software engineering that applies to other aspects of life as well - managing complexity by breaking it down into smaller, more manageable pieces.

Today, we're going to dive into one of those smaller pieces. I recently took a weekend getaway to Hanoi, Vietnam, and let me tell you, it was a fantastic experience. I want to share some of the fun things I did there, so if you're ever planning to visit, you know what to check out.

The first highlight of my trip was kayaking in Halong Bay. Trust me when I say the beauty of this UNESCO World Heritage site is beyond compare. Those limestone formations are stunning! And kayaking was the perfect way to experience them up close and personal. Just a tip: don't forget to bring a waterproof bag for your phone. You never know what could happen!

Another natural marvel that left me with a sense of awe was the Dong Thien Cung cave. This cave, shaped by wind and water over thousands of years, is truly a sight to behold. If you have a vivid imagination, you might even spot some interesting rock formations, including one that supposedly resembles a breast. Believe it or not, some superstitious women pray for milk blessings in front of that particular formation.

Now, one of the most exciting and challenging experiences in Hanoi has to be navigating the night market. Picture this: during the Mid-Autumn Festival, the streets are crowded, full of people enjoying the festivities. And there I was, ice cream cone in hand, trying to maneuver through it all. Crossing the road in Hanoi is an adventure in itself! Motorcycles, cars, and pushcarts coming from all directions, but guess what? I made it across the street safely, and that's an achievement worth celebrating!

Now, let's talk about food. Oh boy, Hanoi is a street food lover's paradise. The flavors, the variety, it's a culinary adventure like no other. I wish I could remember all the Vietnamese names for the dishes I tried. But trust me, they were delicious. And if you're feeling daring, you must try the famous Vietnamese egg coffee. I know, it might sound strange, but don't knock it until you've tried it. And while you're at it, make sure to visit a historic coffee shop for a taste of their famous condensed milk coffee.

Now, no trip to Hanoi would be complete without a visit to the Hoa Lo Prison Museum. I know, it's not the cheeriest of attractions, but it's a part of history that we shouldn't forget. As I walked through the museum, reflecting on the past and the conflicts that occurred, it reminded me how fortunate we are to live in a time and place without oppressive regimes. It also made me appreciate the safety and well-being of my loved ones. Deep thoughts, right?

So, my takeaway from this trip is that even though my ambition of traveling the world may seem overwhelming, it's all about managing complexity and breaking it down into smaller, more achievable pieces. By doing so, I had the chance to experience the wonders of Hanoi, embark on unforgettable adventures, and truly immerse myself in the culture.

That's it for today's episode of "Continuous Improvement." I hope you enjoyed hearing about my Hanoi trip and learned a thing or two about managing complexity along the way. Remember, in life, just as in software engineering, taking things one step at a time can lead to great achievements.