~andrewzah/personal-site

ce895d7f8c79e9ed2146b0f5231def9a9e5f4eed — Andrew Zah 5 months ago ae5f68c
rename post folders, add new post!!
20 files changed, 506 insertions(+), 469 deletions(-)

M Makefile
R content/posts/a_new_year_2018/{index.md => _year_2018/index.md}
R content/posts/discord_bot_crystal_intro/{index.md => stal/index.md}
R content/posts/selfhosted_git_gitea_docker_caddy/{index.md => ocker_caddy/index.md}
R content/posts/growth_as_software_dev_2018/{index.md => e_dev_2018/index.md}
R content/posts/korean_cooking_eating_reference/{index.md => _reference/index.md}
R content/posts/programming_korean/{index.md => ing_korean/index.md}
R content/posts/korean_learning_resources_2019/{index.md => urces_2019/index.md}
R content/posts/padrino_nested_forms/{index.md => sted_forms/index.md}
R content/posts/things_to_avoid_in_anki/{index.md => id_in_anki/index.md}
R content/posts/anki_usage_guide/{index.md => sage_guide_2019/index.md}
R content/posts/zola_caddy_git_automatic_deploy/{index.md => tic_deploy/index.md}
R content/posts/backpacking_six_month_retrospective/{index.md => ro/index.md}
R content/posts/remote_workflow_2019/{index.md => kflow_2019/index.md}
R content/posts/home_server_with_freenas/{index.md => th_freenas/index.md}
A content/posts/2019_12_22_minecraft_freenas_jails_bungee/index.md
D content/posts/books_for_2018/index.md
D content/posts/korean_series_1/index.md
D content/posts/korean_series_2/index.md
D content/posts/shinkansen_green_beetle_ferry/index.md
M Makefile => Makefile +2 -2
@@ 51,6 51,7 @@ build: $(CONTENT_FILES)
	zola build

static: build
	@find ./public/posts -name "*.png" -exec rm {} \;
	rsync -arv public/* ../blog-assets

up:


@@ 63,8 64,7 @@ up:

push:
	git push origin master
	git push github master
	git push self master
	git push gh master

deploy:
	git submodule update --recursive --remote

R content/posts/a_new_year_2018/index.md => content/posts/2018_02_01_a_new_year_2018/index.md +0 -0

R content/posts/discord_bot_crystal_intro/index.md => content/posts/2018_03_05_discord_bot_crystal/index.md +0 -0

R content/posts/selfhosted_git_gitea_docker_caddy/index.md => content/posts/2018_05_15__selfhosted_git_gitea_docker_caddy/index.md +0 -0

R content/posts/growth_as_software_dev_2018/index.md => content/posts/2018_11_18_growth_as_software_dev_2018/index.md +0 -0

R content/posts/korean_cooking_eating_reference/index.md => content/posts/2018_12_18_korean_cooking_eating_reference/index.md +0 -0

R content/posts/programming_korean/index.md => content/posts/2019_02_16_programming_korean/index.md +0 -0

R content/posts/korean_learning_resources_2019/index.md => content/posts/2019_03_04_korean_learning_resources_2019/index.md +0 -0

R content/posts/padrino_nested_forms/index.md => content/posts/2019_04_11_padrino_nested_forms/index.md +0 -0

R content/posts/things_to_avoid_in_anki/index.md => content/posts/2019_05_18_things_to_avoid_in_anki/index.md +0 -0

R content/posts/anki_usage_guide/index.md => content/posts/2019_05_19_anki_usage_guide_2019/index.md +0 -0

R content/posts/zola_caddy_git_automatic_deploy/index.md => content/posts/2019_06_02_zola_caddy_git_automatic_deploy/index.md +0 -0

R content/posts/backpacking_six_month_retrospective/index.md => content/posts/2019_09_19_backpacking_six_month_retro/index.md +0 -0

R content/posts/remote_workflow_2019/index.md => content/posts/2019_10_19_remote_workflow_2019/index.md +0 -0

R content/posts/home_server_with_freenas/index.md => content/posts/2019_12_21_home_server_with_freenas/index.md +1 -1
@@ 6,7 6,7 @@ template = "post.html"

[taxonomies]
tags = ["servers", "workflow"]
categories = ["self"]
categories = ["selfhosting"]

[extra]
keywords = "home server setup amd ryzen ixsystems freebsd freenas"

A content/posts/2019_12_22_minecraft_freenas_jails_bungee/index.md => content/posts/2019_12_22_minecraft_freenas_jails_bungee/index.md +503 -0
@@ 0,0 1,503 @@
+++
title = "Hosting Minecraft Servers + BungeeCord with FreeNAS"
slug = "hosting-minecraft-servers-bungeecord-freenas"
date = 2019-12-22
template = "post.html"

[taxonomies]
tags = ["minecraft", "freebsd"]
categories = ["selfhosting"]

[extra]
keywords = "minecraft spigot bukkit"
summary = "This is my personal workflow for being productive remotely on OSX in 2019."

resources = [
  ["iocage - A FreeBSD Jail Manager", "https://iocage.readthedocs.io/en/latest/"],
  ["Tuning the JVM - G1GC Garbage Collector Flags for Minecraft", "https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/"],
  ["Installing a Minecraft server on FreeNAS", "https://devpro.media/minecraft-server-freenas/"],
  ["What is a Netmask?", "https://www.computerhope.com/jargon/n/netmask.htm"]
]
+++

Learn how to set up multiple minecraft servers in FreeNAS with a bungeecord/waterfall proxy.

This guide assumes you're running a FreeNAS server on a local network. If not, you'll have to update your ip address and default gateway settings accordingly.

{{image(
  url="https://s3.amazonaws.com/andrewzah.com/posts/freenas_minecraft_guide/dynmap.png",
  desc="Dynmap rendering of our FreeNAS minecaft server",
  t="Dynmap rendering of our FreeNAS minecaft server"
)}}

## Prerequisites

* Console access to a server running FreeNAS

(Don't download these yet, read on)
* Your server jarfile: [spigot.jar][bungee], or [paper.jar][paper], etc.
* Your proxy jarfile: [bungeecord.jar][bungee], or [waterfall.jar][waterfall], etc.

This guide will be using `Paper` and `Waterfall` as they are more
performant versions of spigot and bungeecord, respectively. They also fully support spigot/bungee plugins.

[bungee]: https://www.spigotmc.org/wiki/bungeecord/
[spigot]: https://www.spigotmc.org/wiki/about-spigot/
[paper]: https://papermc.io/downloads#Paper-1.15
[waterfall]: https://papermc.io/downloads#Waterfall

## Preparing the Jails

The first thing we'll need to do is create the main jail (the one running bungeecord or waterfall).
Alter the version for the current one your server is running.

```
echo '{"pkgs":["openjdk12", "curl"]}' > /tmp/minecraft.json
```

When a jail is created, `pkg` isn't installed by default. Using this saves us some commands in the next step.

```bash
iocage create \
  --name <name> \
  --pkglist /tmp/minecraft.json
  --release 11.2-RELEASE \
  ip4_addr="vnet0|192.168.1.xxx/24" \
  defaultrouter="192.168.1.1" \
  vnet="on" \
  allow_raw_sockets="1" \
  boot="on" 
```

`ip4_addr` and `defaultrouter` configure the network for our jail. If you're running the server on your local network, then it's likely the address of your router. (Typically x.x.x.1 or x.x.x.255, consult your router's manual). `ip4_addr` is the address you want to assign to the jail.

For `name`: If you're just creating a single server, the name `minecraft` would suffice, but I recommend a structure like:

```
mc_main
mc_survival
mc_creative
...etc
```

Next, let's create directories in the jails and mount them in the root system:

```bash
# Creates the directories in the root system
mkdir -p /xxx/data/minecraft/mc_main
mkdir -p /xxx/data/minecraft/waterfall

# Creates the directories in the jail
iocage exec mc_main mkdir /root/minecraft
iocage exec mc_main mkdir /root/waterfall

# Mounts the directories in the root system
iocage fstab -a mc_main \
  /xxx/data/minecraft/mc_main /root/minecraft nullfs rw 0 0
iocage fstab -a mc_main \
  /xxx/data/minecraft/waterfall /root/waterfall nullfs rw 0 0
```

Change `/xxx/data/` to a relevant filepath for your setup. My main ZFS pool is named `lily`, so I put my minecraft folders under `/mnt/lily/data/`.

## Setting up Minecraft
We can access our jails with:

```bash
iocage console mc_main
```

Now we can cd to the minecraft directory and download our server jarfile:
```bash
cd /root/minecraft

# paper
curl -L 'https://papermc.io/api/v1/paper/1.15.1/27/download' -o paper-1.15.1_27.jar
```

Run your server jarfile with:

```bash
java -jar /root/minecraft/paper-1.15.1_27.jar
```

The process should end shortly, printing text about a `eula.txt`. Edit the file with:

```bash
sed -i .bak 's/eula=false/eula=true/g' /root/minecraft/eula.txt
```

We also need to edit the `server.properties` file. Open it and change the server port to `25566`. We're changing this value because our proxy server (bungeecord/waterfall) will listen to the default port later.


Now we can run the server!

```bash
java -Xms1024M -Xmx1024M -jar /root/minecraft/<name>.jar
```

Observe the text output for any errors, and then go ahead and connect to it! (Go to the `Multiplayer` tab, click `Add Server`, and type in the ip address of your server, e.g. `192.168.1.xx:25566`) Once you join, text should get printed to the screen.

However, we have an issue. The server is currently running in an interactive session (i.e. we ran it manually). We need it to run by itself, in a noninteractive session. Some guides will recommend using `screen` or `tmux`, but I strongly recommend not using them. If your server ever restarts, you will have to go in manually and restart screen/tmux, and then your minecraft server.

It's far better to let [rc.d](https://www.freebsd.org/cgi/man.cgi?query=rc.d&sektion=8&n=1) manage it for us. Add this script to `/usr/local/etc/minecraftd`:

```bash
#!/bin/sh
#
# PROVIDE: minecraftd
# REQUIRE: LOGIN DAEMON NETWORKING mountcritlocal
# KEYWORD: shutdown
#
# Use the following variables to configure the minecraft server. For example, to
# configure the ON/OFF knob variable:
# sysrc minecraftd_enable="YES"
#
# minecraftd_enable="YES"
# minecraftd_user_dir="/root/minecraft"
# minecraftd_jar_path="/root/minecraft/server.jar"
# minecraftd_java_opts="-Xms1024M -Xmx1024M"

. /etc/rc.subr

name=minecraftd
rcvar=`set_rcvar`
pidfile=/var/run/minecraftd.pid

load_rc_config $name

start_cmd="${name}_start"
stop_cmd="${name}_stop"
status_cmd="${name}_status"

: ${minecraftd_enable="NO"}
: ${minecraftd_user_dir="/root/minecraft"}
: ${minecraftd_jar_path="/root/minecraft/server.jar"}
: ${minecraftd_java_opts="-Xms1024M -Xmx1024M"}

minecraftd_start() {
    if [ -e $pidfile ]; then
        echo "$name already running."
    else
        echo "Starting $name..."
        /usr/sbin/daemon -f -p $pidfile \
            /usr/local/bin/java -Duser.dir=$minecraftd_user_dir \
            $minecraftd_java_opts \
            -jar $minecraftd_jar_path nogui
        echo "$name started."
    fi
}

minecraftd_stop() {
    if [ -e $pidfile ]; then
        echo "Stopping $name..."
        cat $pidfile | xargs kill
        echo "Stopped."
    else
        echo "$name is not running."
    fi
}

minecraftd_status() {
    if [ -e $pidfile ]; then
        echo "$name is running."
    else
        echo "$name is not running."
    fi
}

run_rc_command $1
```

We have to make the service file executable, so run:

```bash
chmod +x /usr/local/etc/rc.d/minecraftd
```

Essentially, this script lets us not have to manage the server process manually. However we also need to update some settings:

```bash
sysrc minecraftd_enable="YES"
sysrc minecraftd_jar_path="/root/minecraft/server.jar"
sysrc minecraftd_java_opts="-Xms1G -Xmx1G"
```

Make sure to change the `minecraftd_jar_path` to reflect your downloaded jarfile, and `minecraftd_java_opts` for how much memory you want to give it.

Now you should be able to the following:

```bash
service minecraftd start
```

Confirm it with:

```bash
ps aux | grep openjdk
```

You should see something like:
```bash
root  72816  1.2  2.5 3156872 1273052  -  IJ   Fri19   99:04.12 /usr/local/openjdk12/bin/java -Duser.dir=/root/minecraft -Xms1G -Xmx1G -jar /root/minecraft/paper-1.15.1_27.jar
```

If not, double check your settings in `/etc/rc.conf`, and make sure they point to the right files. Manually run the command to make sure it's not a minecraft configuration issue (i.e. no warnings/errors show up in the console).

Connect to the server again to make sure it works, then stop the server with:

```
service minecraftd stop
```

In order for bungee/waterfall to work, we need to edit the `server.properties` file again. Change `online-mode` to `false`.

In `spigot.yml`, update `bungeecord` to `true`.

In `paper.yml`, update `bungee-online-mode` to `true`.

In `bukkit.yml`, update `connection-throttle` to `-1`.

That's it! Now we just need to set up our proxy to get access to the server again.

## Setting up Waterfall/Bungeecord
If you're not in the `mc_main` jail already, access it with:

```bash
iocage console mc_main
```

Now can cd to the waterfall directory and download `waterfall.jar`.

```bash
cd /root/waterfall
```

The process for the jarfile is the same as before, except we're going to the `waterfall` directory now.
```bash
cd /root/waterfall

# waterfall
curl -L 'https://papermc.io/api/v1/waterfall/1.15/309/download' -o waterfall-1.15_309.jar
```

Run the proxy jarfile with:

```bash
java -jar /root/waterfall/waterfall-1.15_309.jar
```

If necessary, edit `eula.txt` again:

```bash
sed -i .bak 's/eula=false/eula=true/g' /root/waterfall/eula.txt
```

Now we need to edit `config.yml`. Look for the `servers` section, and change it to the following:
```yaml
servers:
  hub:
    motd: '&1My amazing hub server'
    address: localhost:25566
    restricted: false
```

Under `listeners`, change `priorities` to:
```yaml
priorities:
  - hub
```

Change `host` to:
```yaml
  host: 0.0.0.0:25565
```

Finally, set `ip_forward: true`.

In order to run `waterfall` noninteractively, we'll use a similar `rc.d` script like before:

```bash
#!/bin/sh
#
# PROVIDE: waterfall
# REQUIRE: LOGIN DAEMON NETWORKING mountcritlocal
# KEYWORD: shutdown
#
# Use the following variables to configure the minecraft server. For example, to
# configure the ON/OFF knob variable:
# sysrc waterfall_enable="YES"
#
# waterfall_enable="YES"
# waterfall_user_dir="/root/waterfall"
# waterfall_jar_path="/root/waterfall/waterfall.jar"
# waterfall_java_opts="-Xms512M -Xmx1024M"

. /etc/rc.subr

name=waterfall
rcvar=`set_rcvar`
pidfile=/var/run/waterfall.pid

load_rc_config $name

start_cmd="${name}_start"
stop_cmd="${name}_stop"
status_cmd="${name}_status"

: ${waterfall_enable="NO"}
: ${waterfall_user_dir="/root/waterfall"}
: ${waterfall_jar_path="/root/waterfall/waterfall.jar"}
: ${waterfall_java_opts="-Xms512M -Xmx1024M"}

waterfall_start() {
    if [ -e $pidfile ]; then
        echo "$name already running."
    else
        echo "Starting $name..."
        cd $waterfall_user_dir
        /usr/sbin/daemon -f -p $pidfile \
            /usr/local/bin/java -Duser.dir=$waterfall_user_dir \
            $waterfall_java_opts \
            -jar $waterfall_jar_path  nogui
        echo "$name started."
    fi
}

waterfall_stop() {
    if [ -e $pidfile ]; then
        echo "Stopping $name..."
        cat $pidfile | xargs kill
        echo "Stopped."
    else
        echo "$name is not running."
    fi
}

waterfall_status() {
    if [ -e $pidfile ]; then
        echo "$name is running."
    else
        echo "$name is not running."
    fi
}

run_rc_command $1
```

We have to make the service file executable again, so run:

```bash
chmod +x /usr/local/etc/rc.d/waterfall
```

Like before, we'll need to edit some settings:

```bash
sysrc waterfall_enable="YES"
sysrc waterfall_jar_path="/root/waterfall/waterfall-1.15_309.jar"
```

Now run the following and connect to your server!

```bash
service waterfall start
```

---

Congrats, you've set up a minecraft server and a proxy server in FreeNAS!

For more servers, create more jails with the instructions from earlier, and follow the same server javafile setup. In `server.properties`, change `ip-address` to the address of the jail, and update waterfall's config to something like below:

```yaml
servers:
  hub:
    motd: 'My hub server'
    address: localhost:25566
    restricted: false
  creative:
    motd: 'My creative server'
    address: 192.168.1.21:25566
    restricted: false
  survival:
    motd: 'My survival server'
    address: 192.168.1.22:25566
    restricted: false
```

## Databases for Plugins

Many minecraft plugins can use mysql or postgres for storage. I highly recommend setting up mysql in a jail and connecting your plugins to it. Here's how you can do it:

```bash
echo '{"pkgs":["mysql80-server"]}' > /tmp/mysql.json
```

```bash
iocage create \
  --name mysql \
  --pkglist /tmp/minecraft.json
  --release 11.2-RELEASE
  ip4_addr="vnet0|192.168.1.xxx/24" \
  defaultrouter="192.168.1.1" \
  vnet="on" \
  boot="on"
```

```bash
# Creates the directories in the root system
mkdir -p /xxx/configs/mysql
mkdir -p /xxx/data/mysql

# Creates the directories in the jail
iocage exec mysql mkdir /config
iocage exec mysql mkdir /data

# Mounts the directories in the root system
iocage fstab -a mysql \
  /xxx/configs/mysql /config nullfs rw 0 0
iocage fstab -a mysql \
  /xxx/data/mysql /data nullfs rw 0 0
```

```bash
iocage console mysql
```

```bash
sysrc mysql_enable="YES"
sysrc mysql_dbdir="/data"
sysrc mysql_confdir="/config"
sysrc mysql_optfile="/config/my.cnf"
```

```bash
cp /usr/local/etc/mysql/my.cnf /config/my.cnf
```

Now edit `/config/my.cnf` and change `bind-address` to `0.0.0.0`. This lets us connect remotely, except for `root`. We don't want to run things as root, anyway.

Connect to the local mysql database after creating the root user and password:

```bash
service mysql-server start
mysql_secure_installation
mysql -uroot -p
```

Once connected, create the database and user that the plugin will be using. For example, if we were making a database for `coreprotect`:

```bash
create database coreprotect_hub;

CREATE USER 'coreprotect'@'192.168.1.0/255.255.255.0' IDENTIFIED WITH mysql_native_password BY 'password';

grant all privileges on coreprotect_hub.* to 'coreprotect'@'192.168.1.0/255.255.255.0';
```

The reason we're using `@'192.168.1.0/255.255.255.0'` is to allow remote connections, but only within the local network.

Now update your plugin's `config.yml`, where `host` is the ip address of the mysql jail, and `port` is `3306`.

It's a good idea to create a separate database and user for each plugin and server. For example, I have the databases `coreprotect_survival`, and `coreprotect_creative`, both of which have different users.

D content/posts/books_for_2018/index.md => content/posts/books_for_2018/index.md +0 -71
@@ 1,71 0,0 @@
+++
title = "Books for 2018"
slug = "books-for-2018"
date = 2018-02-24
template = "post.html"

[taxonomies]
tags = ["books", "philosophy", "programming"]
categories = ["life"]

[extra]
keywords = ""
summary = "Books that I want to read for 2018"
+++

My biggest regret of 2017 was reading few books. I want to change that for 2018, so here's a list of books that I am reading, or want to read—and why.

<!-- more -->

## Korea's Place in the Sun

Despite the title (which has nothing to do with Japan), this book is an elegant summary of East Asian history pertaining to Korea.

Having lived in Korea, I want to learn more about its history. Did you know that Korea invented a printing press about 200 years before Gutenberg?

## Programming Rust

I want to learn Rust well. This book has a lot of recommendations and, from what I've read so far, is compelling.

## Peopleware: Productive Projects and Teams

We often read books on programming, but businesses are run by humans. In addition to programming, I want to improve my interpersonal / "soft" skills.

So far this book has been a page turner. It's suprisingly short but gives a lot of material to think about, in a humorous fashion.

It does *not* reflect well on managers and executives. Bad ones, that is.

## The Timeless Way of Building

Written by Christopher Alexander, *Peopleware* references this book a few times. The premise is compelling and I don't want to only read programming-oriented books.

## The Road to Wigan Pier (!)

I heard about this book when listening to one of Jordan Peterson's interviews. George Orwell's critique so far is profound.

> I have known numbers of bourgeois Socialists, I have listened by the hour to their tirades against their own class, and yet never, not even once, have I met one who had **picked up proletarian table-manners**.

> The fact that has got to be faced is that to abolish class-distinctions means abolishing a part of yourself. Here am I, a typical member of the middle class. It is easy for me to say that I want to get rid of class-distinctions, but nearly everything I think and do is a result of class-distinctions. All my notions — notions of good and evil, of pleasant and unpleasant, of funny and serious, of ugly and beautiful — are essentially middle-class notions; my taste in books and food and clothes, my sense of honour, my table manners, my turns of speech, my accent, even the characteristic movements of my body, are the products of a special kind of upbringing and a special niche about half-way up the social hierarchy.

(emphasis mine)

I may not write a book review for all of these books, but I definitely will for this one.

## The Open Society and Its Enemies

I find it difficult to not purchase philosophy texts. This book piqued my interest due to Karl R. Popper's quote on the [Paradox of Intolerance][paradox].

> Unlimited tolerance must lead to the disappearance of tolerance. If we extend unlimited tolerance even to those who are intolerant, if we are not prepared to defend a tolerant society against the onslaught of the intolerant, then the tolerant will be destroyed, and tolerance with them. 

> In this formulation, I do not imply, for instance, that we should always suppress the utterance of intolerant philosophies; as long as we can counter them by rational argument and keep them in check by public opinion, suppression would certainly be unwise. But we should claim the right to suppress them if necessary even by force; for it may easily turn out that they are not prepared to meet us on the level of rational argument, but begin by denouncing all argument; they may forbid their followers to listen to rational argument, because it is deceptive, and teach them to answer arguments by the use of their fists or pistols. We should therefore claim, in the name of tolerance, the right not to tolerate the intolerant.

I'm also interested in Popper's perspective as he was born in 1902 in Austria, and was directly affected by the Nazi annexation.

[paradox]: https://en.wikipedia.org/wiki/Paradox_of_tolerance 

## 아마존 웨이 — Amazon Way

I saw this at 부산역 — Busan Train Station — and decided I'd try to read an entire Korean book in 2018. Not my brightest idea, but I'll slowly do it.

This page will be updated as I continue to finish books and find new ones.
Of course, recommendations are always welcome.

D content/posts/korean_series_1/index.md => content/posts/korean_series_1/index.md +0 -191
@@ 1,191 0,0 @@
+++
title = "Korean Progress #1"
slug = "korean-progress-1"
date = 2019-02-24
template = "post.html"

[taxonomies]
tags = ["korean", "learning"]
categories = ["korean-progress"]

[extra]
keywords = "korean hangeul language learning methods self study progress"
summary = "My Korean learning progress #1"
citations = [
  ["~아/어/여 놓다", "https://www.howtostudykorean.com/unit0/unit0lesson1/"],
  ["Almost: 거의 and ~ㄹ/을 뻔 했다", "https://www.howtostudykorean.com/unit-3-intermediate-korean-grammar/unit-3-lessons-59-66/lesson-66/"],
  ["~아/어/여 버리다", "https://talktomeinkorean.com/lessons/l9l2"],
  ["~ㄴ/는다기보다는", "http://su-eop.tumblr.com/post/158779767016/adv-ii-lesson-1-%EB%8A%94%EB%8B%A4%EA%B8%B0%EB%B3%B4%EB%8B%A4%EB%8A%94-rather-than-say"],
  ["I *did* do V, but…: 기는 하다", "http://www.mykoreanramblings.com/2014/09/21/i-did-do-v-but-%EA%B8%B0%EB%8A%94-%ED%95%98%EB%8B%A4/"],
  ["~ㄹ/을 테니까", "https://www.howtostudykorean.com/upper-intermediate-korean-grammar/unit-4-lessons-92-100/lesson-100/"],
  ["GoBilly ~ㄹ/을 테니까", "https://www.youtube.com/watch?v=m0-D6fsGui8"],
  ["~ㄹ/을 텐데(요)", "https://www.howtostudykorean.com/upper-intermediate-korean-grammar/unit-4-lessons-92-100/lesson-100/"],
  ["GoBilly ~ㄹ/을 텐데(요)", "https://www.youtube.com/watch?v=m0-D6fsGui8"],
  ["~조차", "http://www.koreantopik.com/2017/05/l2g38-n-grammar-even-not-only-others.html"],
  ["Depending on (~ㅁ/음에 따라서)", "https://www.howtostudykorean.com/unit-5/lessons-101-108/lesson/"],
  ["Depending on (~느냐에 따라서)", "https://www.howtostudykorean.com/unit-5/lessons-101-108/lesson/"],
  ["Depending on (~따라서)", "https://www.howtostudykorean.com/unit-5/lessons-101-108/lesson/"],
]


+++

While studying Korean, sometimes I get a bit lazy or lose some motivation. I decided to start this weekly series as a way to track what I've been learning and to motivate myself to keep studying.

<!-- more -->

This first one will be a little bigger as I have a bunch of stuff that I've studied recently without dates.

## Things I'm struggling with

Right now the biggest issue for me is comparing and contrasting points. And as always, speaking naturally (not textbook-like) is still tough.

## Current learning methods
* Studying grammar points daily.
* Going to a language exchange where I get 1-on-1 for an hour. Right now I go about 2-3 times per week.
* Using [Anki](https://apps.ankiweb.net/) to memorize and retain words.
* Texing friends in Korean.
* Surprisingly, playing [Donut County](https://itunes.apple.com/us/app/donut-county/id1292099839?mt=8<Paste>) on iOS. It's so unexpected to see a game that actually has a Korean translation!

Forcing myself to practice with Anki has become rough once again. I set my review limit to 125 and new daily words limit to 20, now 18. So it takes me about 50-60 minutes if I don't miss a day, or about 80-90 minutes if I do. If I make myself commute 40-50 minutes I've found that I can knock it out reliably, but on the weekend I have zero motivation. Memorizing words just... sucks, even if I use my own deck instead of someone else's premade deck (which I do).

Donut County is pretty cool since I get to see some real Korean conversations among friends, but in bite-sized pieces so I don't get overwhelmed. My goal right now is to understand as much as I can without looking anything up, and then I'll play the game once more whilst studying each sentence.

Going to the language exchange has been working wonders but it's been diminishing returns. It's slowly making me more and more comfortable with speaking in Korean but I really have to sit down aftwards and analyze the mistakes I made. Otherwise they tend to come up again. Nevertheless going to this exchange at least 2 times a week has improved my Korean skills *immensely*.

## Grammar Points
### ~아/어/야 놓다
This indicates an action has been done and is still in that state. It's possible to translate it with the perfect tenses, but it doesn't map neatly to English. {{ cite(n=0) }}

* 문을 열**어 놓다**.
* 집을 정리하려고 해서 이불을 **개 놓아** 주세요.
* 엄마가 계란 볶음밥을 만들**어 놓았다**.

### ~ㄹ 뻔 하다
Used when one almost started an action–i.e. "I almost fell". The action did not start, but almost did. {{ cite(n=1) }}

* 재가 거의 넘어질 뻔 했다.
* 우리 사이가 어근나서 싸울 뻔 했다.
* 컵에 물을 가득히 따르다가\* 물이 넘칠 뻔 했다.  
Note that 따르다 here means to overflow, not to follow.

### ~다거나
~다고 하다 + ~거나. Really simple form. One could translate it as "(phrase) or something..".

* 힘들다거나 하면 저에게 얘기하세요.
* 바쁘다거나 피곤하다고 해서 일을 자꾸 미루면 안 되다.
* 소리가 컸다거나 하면 앞으로 조심하겠다.

### ~아/어/여 버리다
Expresses that something has completely finished, and/or someone is relieved or upset/surprised at the result. {{ cite(n=2) }}

* 오늘도 늦게 일어나 버렸다.
* 제가 달리는 동안 열쇠를 잃어 버렸다.
* 드디어 검퓨터를 팔아 버렸다.
* 지루한 대통령의 연설을 끝나 버렸다.

### ~(/ㄴ/는)다기보다는, (이)라기보다는
"It's not that (x) but rather (y)". `다는` here often gets contracted to `단`. {{ cite(n=3) }}

* 내가 한국인 사귀하고 싶다기보다는 그냥 한국에서 살아서 ㅇㅇ.
* 촌스러웠다기보다는 그 옷에는 안 어울리는 것 같았다.
* 그를 좋아한다기보다는 존경한다는 표현이 맞을 것이다.

### ~기는 하다
동사 + "but (x)". Sometimes it could be translated as "even though (x), (y)..". Typically gets used with ~는데 or ~지만. For 형용사s, it's ~한데. For 동사s, it's ~하는데. {{ cite(n=4) }}. `기는` here often gets abbreviated to `긴`.

* 나는 소설 책을 읽기는 했지만 기억이 안 나다.
* 나는 영국사람이기는 하지만 생선과 감자튀김을 전혀 안 먹다.

### 빨갛다 and 뻘겋다
The vowels in some words can be changed to their mirroring vowels, in order to intensify the original verb/adjective. This is prevalent with color words.

* 노랗다, 누렇다
* 파랗다, 퍼렇다
* 까맣다, 꺼멓다

### ~ㄹ/을 테니까
~테 + ~니까. Used to make an assumption about something to justify or explain some clause/reasoning. {{ cite(n=5) }} {{ cite(n=6) }}

* 많이 추**울 테니까** 조심하세요
* 내일은 공부해야 **할 테니까** 오늘 만날까요?
* 김밥 맛이 비슷**할 테니까** 굳이 그 식당 까지 안 가도 되다

### ~ㄹ/을 텐데
Like ~테니까 but with ~는데. In certain sentences, it's awkward to use with yourself as the subject, since sometimes you know something and can't assume. Example: 나는 미국 사람일 텐데– totally weird to use with yourself as the subject, since you would know if you are American or not, typically. ~인데 would work there instead unless you were making an assumption about someone else. {{ cite(n=7) }} {{ cite(n=8) }}

* 많이 추울 텐데 괜찮겠다?
* 내가 했었을 텐데...
* 키가 컸으면 그 공을 잡을 수 있었을 텐데.
* 시간이 있었다면 갔을 텐데.

### ~조차
"Not even (n)", "not so much as (n"). Used in negative sentences. {{ cite(n=9) }}

* 그 남자의 이름조차 몰라요
* 친구가 시험 준비할 생각조차 못 하는데 어떻게 합격하나요?
* 지각해서 샤워할 시간조차 없어요

### ~고 싶어하다
Same as ~고 싶다 but used when referring to other peoples' desires.

### ~ㅁ/음에 따라(서)
Similar to ~을 때, but means more like "as I (do something)". It stresses that there was some sort of process involved. {{ cite(n=10) }}

* 제가 유럽에 여행함에 따라서 유럽문화에 관깁이 생겼어요.

### ~느냐에 따라(서)
Used with a verb stem, this means "depending on (where/why/how)..." or "depending on if...". {{ cite(n=11) }}

* 우리가 내일 가느냐 안 가느냐에 따라서
* 어떻게 공부하느냐에 따라 미래가 달라질 수 있다

### ~에 따라(서)
따르다 means to follow. ~에 따라서 means "following (x)", or more idiomatically, "according to"/"in accordance with ...". {{ cite(n=12) }}

* 사람들은 그 나라의 문화에 따라 행동을 해 야 돼요
* 길 안내에 따라서 우리는 저 쪽으로 가 야 돼요

## Phrases
### 저라면 / 저였으면
Literally "If it were me", "If it was me". This one is really simple but useful to know.

### 그렇고 .. 기도 해도
"well, that and ..."

### 그렇기도 한데
"well, that but ..."

## New Vocabulary
These are words that I didn't know while conversing 1:1 at my language exchange.

| Word | Meaning |
| :---: | :---: |
| 긍정적 | positive, affirmative |
| 기름지다 | to be fatty, greasy, rich |
| 기복이 있다 | to have ups and downs |
| 나누다 | to divide/split up (sth) |
| 나뉘다/나누이다 | to be split / divided |
| 단점 | disadvantage, weakness |
| 두르다 | to put up / wrap (sth) *around* sth |
| 둘러보다 | to look around, browse |
| 미세먼지 | fine dust |
| 부정적 | negative, pessimistic |
| 수리(하다) | to accept, receive (sth) |
| 수리(하다) | to repair, fix something (formal) |
| 시차 | time(zone) difference |
| 신용(하다) | credit, credibility, to trust |
| 아깝다 | stronger than 아쉽다, to be a shame |
| 아쉽다 | for sth to be a bummer |
| 안타깝다 | to feel sorry (for smn/sth) |
| 어른 | adult, grownup, senior |
| 어린이 | child (under 12) |
| 옮기다 5 | to express sth via writing/words |
| 옳다 | proper, correct (formal of 맞다) |
| 유동적으로 | fluidly, flexibly |
| 유학 | study abroad |
| 장점 | advantage, strength |
| 죄를 짓다 | to commit a crime, sin |
| 중고 | used, secondhand item/article |
| 청소년 | teenager, youth |
| 황사 | Yellow/Asian dust |

D content/posts/korean_series_2/index.md => content/posts/korean_series_2/index.md +0 -150
@@ 1,150 0,0 @@
+++
title = "Korean Progress #2"
slug = "korean-progress-2"
date = 2019-03-03
template = "post.html"

[taxonomies]
tags = ["korean", "learning"]
categories = ["korean-progress"]

[extra]
keywords = "korean hangeul language learning methods self study progress"
summary = "My Korean learning progress #2"
citations = [
  ["When(ever) I do V: ~ㄹ/을 때마다", "http://www.mykoreanramblings.com/2014/03/22/when-i-v-%EC%9D%84-%EB%95%8C/"],
  ["How to say 'feeling' in Korean (기분 vs. 느낌)", "https://www.youtube.com/watch?v=eHDYvrXekqM"],
  ["어쩌다", "https://www.howtostudykorean.com/upper-intermediate-korean-grammar/unit-4-lessons-92-100/lesson-94"],
  ["어쩌면", "https://www.howtostudykorean.com/unit-3-intermediate-korean-grammar/unit-3-lessons-59-66/lesson-59/"],
  ["아무리", "https://www.howtostudykorean.com/unit-2-lower-intermediate-korean-grammar/unit-2-lessons-42-50/lesson-48/"],
  ["어쩔 수 없다", "https://www.howtostudykorean.com/unit-5/lessons-109-116/lesson-110/"]
]
+++

While studying Korean, sometimes I get a bit lazy or lose some motivation. I decided to start this weekly series as a way to track what I've been learning and to motivate myself to keep studying.

<!-- more -->

Welcome to week #2!

## Things I'm struggling with

This week's biggest hurdle was motivation, I think. I ended up skipping Anki several times.

## This week's learning methods
* Going to a language exchange where I get 1-on-1 for an hour. Right now I go about 2-3 times per week.
* Texing friends in Korean
* Studying grammar points daily or every other day
* Using [Anki](https://apps.ankiweb.net/) to memorize and retain words.

As I mentioned last week, Anki has become somewhat of a slog. When I miss one day I hate coming back again because the review session will take twice as long (since I'll forget most of the freshly learned words). I'm not sure what the solution here is other than limiting words to review, but that could still cause a similar issue with forgetting words.

However, I did learn that one can bulk input to Anki via a CSV file, which is pretty neat.

## New Learning Techniques
This week I started reading [뚜벅뚜벅](https://comic.naver.com/bestChallenge/detail.nhn?titleId=709889&no=1), a webtoon about a woman who has no desire to get married. I desperately needed to change things up because my studying was growing somewhat stale. My current strategy is to read a chapter or two and try to look up as few words as possible while still understanding the sentences. Then I plan to go back and thoroughly analyze the grammar and words, and then finally re-read the chapter without looking anything up.

Webtoons let me read in smaller chunks than books and I get to see a lot more slang and dialect words, as well as different peoples' perspectives in general. Naver has a [webtoon app](https://itunes.apple.com/us/app//id315795555?mt=8) which makes keeping up with them really easy! Most importantly, it's free and I don't need to physically own the book–which matters when you're living out of two 26L and 40L backpacks.

I'm also seriously thinking about starting up Glossika practice once more just to force myself to speak way, way more so I can get more familiarity with speaking.

## New Grammar Points
### ~ㄹ/을 때마다 
Pretty simple grammar point: `~ㄹ/을` + `~마다`. {{ cite(n="0") }}

* 이 영화를 볼 때마다 너무 재미있다

### ~ㄹ/을 무렵
Advanced grammar point (so thus, relatively useless for me right now). "Roughly when / around when X". Similar to `~때쯤`.

* 해 질 무렵 출발할 것이다

### 한자 명사 + 시
Another slightly advanced grammar commonly found in advertisements. Formal.

* 모든 세트 구매 시 몬스터볼 보조 배터리

## Topics
### 기분
기분 is derived from 한자 while 느낌 is pure Korean, derived from 느끼다. 기분 refers to feelings, and typically more like "good/bad". 느낌 can refer to feelings as well as sensations and has a broader range in usage. {{ cite(n=1) }}

* 기분이 좋다 <- [I'm feeling] good/happy.
* 느낌이 좋다 <- [This feels] good/nice.
* 기분이 안 좋다 <- [I'm feeling] bad.
* 느낌이 안 좋다 <- [I have a bad feeling] about this / [This feels] bad.
* 지금 그런 기분 아니다
* 지금 농담할 기분 아니다
* 기분 내키는 대로
* 기분파

### 느낌
* 아무 느낌이 없다
* 느낌이 어땠다
* 뭔가 잘못된 느낌이다
* 누가 나를 보고 있는 것 같은 느낌이 들었었다

### 어쩌다
The plain form can be used as an adverb in the beginning of `~게 되다` sentences. It's similar to `만약` in that sense. {{ cite(n=2) }}

* 어쩌다 시험을 합격하게 되었다
* 어쩌다 그녀를 버스에서 보게 되었다

### 어쩌면
It's common in sentences that are unsure or guessing, i.e. `~ㄹ/을지(도)` or `~ㄹ 수도 있다` sentences. {{ cite(n=3) }}

* 어쩌면 그녀가 돌지도 모르다.
* 어쩌면 우리가 내일 갈 수 있을지도 모르다.
* 어쩌면 그녀의 남자친구가 그녀를 위해 선물을 모르다.

### 아무리
"Regardless/even if". Can be put at the beginning of a sentence, just like `만약` or `어쩌다`. {{ cite(n=4) }}
* 네가 나를 아무리 사랑해도 우리는 헤어져야 되다
* 아무리 그 제품을 만값으로 줘도 나는 안 살 것이다

## Phrases
### 구매 시
With each/every purchase

### 어쩔 수 없다
There's nothing that can be done {{ cite(n=5) }}

### 느낌이 있다
[It] has a feel/vibe/atmosphere. Can be used with a restaurant, place, etc.

## New Vocabulary
These are words that I didn't know while conversing 1:1 at my language exchange.

| Word | Meaning |
| :---: | :---: |
| 거실 | living room |
| 경찰서 | police station |
| 관심 받다 | to receive attention(interest) |
| 금지 | ban, to prohibit |
| 김 | steam |
| 김이 서리다 | to fog up, mist over |
| 단계 | level, stage, step |
| 더럽다 | to be dirty, fithy |
| 돌아다니다 | to wander around, roam | 
| 만족(하다) | satisfaction/contentment, to be satisfied | 
| 버튼을 누르다 | to push, press, supress |
| 변하다 | to change, vary |
| 보수적 | conservative |
| 비교(하다) | comparison, to compare |
| 성우 | voice/dubbing actor |
| 연기(하다) | performance, to perform/act |
| 우아하다 | to be elegant, graceful |
| 움직이다 (몸을) | to move (physically) |
| 점수 | score, mark, grade |
| 젖다 | to get wet |
| 주목 받다 | to receive attention |
| 지저분하다 | to be dirty, messy, unclean |
| 직장인 | office worker |
| 짖다 | to bark |
| 최대 | the most, maximum |
| 최소 | the smallest, minimum |
| 추상걱 | abstract |
| 털 | fur, hair |
| 하숙 | room and board, lodge |
| 형식 | form, convention |
| 환경 | environment, circumstances |
| 활발하다 | to be lively, animated |

D content/posts/shinkansen_green_beetle_ferry/index.md => content/posts/shinkansen_green_beetle_ferry/index.md +0 -54
@@ 1,54 0,0 @@
+++
title = "Taking the Japanese Shinkansen and Beetle Ferry"
slug = "japanese-shinkansen-beetle-ferry"
date = 2019-03-30
draft = true
template = "post.html"

[taxonomies]
tags = ["japan", "korea", "trains", "ferries"]
categories = ["travel"]

[extra]
keywords = "japan korea trains ferries travel shinkansen beetle ferry experience"
summary = "I ride the Shinkansen and Beetle Ferry, then write about it."
+++

Earlier this month, I had the opportunity to travel to Japan from South Korea. I flew from Incheon Airport to Narita Airport, and returned from Fukuoka, Japan to Busan, South Korea.

## Shinkansen
### Price
Before we begin, let's discuss the elephant in the room: the price. Prior to arriving in Japan I had done just about zero research, so I was quite surprised when I saw green car tickets from Shin-Osaka–Hiroshima going for about $220. Comparatively, tickets from Seoul to Busan via KTX are about $58. However as I've done more research I've realized that trains around the world can just be.. expensive sometimes.

[This answer](https://www.quora.com/Why-is-Japans-Shinkansen-so-expensive) on Quora sheds some light as to why Shinkansen tickets are so expensive. However, it's significantly cheaper for foreign travelers since they can get the JR pass.

#### JR Pass for Foreign Travelers

Foreigner travelelrs *only* can buy a [7, 14, or 21](http://www.japanrailpass.net/en/about_jrp.html#bm_002) day pass. As of today, 3/30/2019, you may no longer be able to even buy these passes within Japan. Apparently from 2016–2019 an experiment was conducted, allowing foreigners to purchase passes at most Shinkansen station sales offices.

Currently a 7-day pass for an adult is about $260 USD for a regular seat, or $350 USD for a green car seat.

There are two cons with this pass. First, you have to reserve seats in person at a Shinkansen office, which might mean waiting in line if you go at a busy time, especially at a busy station like Shin-Osaka. You can ride without reservation in the unreserved cars (usually there are 3), but you might have to stand.

Second, you can NOT ride the Nozomi (のぞみ) or Mizuho (みずほ) trains. These run more often than the Sakura (さくら), Hikari (ひかり), or Kodama (こだま) trains.

On the upside, the JR pass gives free travel on *any* JR train line, including local trains in Tokyo, etc. Instead of buying train tickets you can just show the pass to the staff at the turnstiles.

#### Green vs Ordinary

[This article](https://www.insidekyoto.com/jr-trains-green-cars-versus-ordinary-cars) breaks down the differences, replete with pictures. Green cars have less seats and are quieter.

I chose to go with the green car because I worked while riding the Shinkansen. Less seats means less people to make noise–and because they're more expensive–hopefully less foreigners that don't respect noise levels.

Note that the Kodama (こだま) train doesn't have green cars.

### Tips

For the Tokaido–Sanyo line, use the smartEx app to look at train schedules. For other lines, they should also have apps. This way you can figure out a plan and write the connections down so reserving the tickes at the Shinkansen office goes faster.

### Verdict
I think the pass is totally worth it. I personally went with the Green car pass, but the regular seats are still nice. If I weren't working while taking the Shinkansen I would probably get the ordinary pass.

Outside of the pass, it depends on whether you want to take a plane (plus local trains to each airport) or an overnight bus. An ordinary seat on a Nozomi train every once in a while is great.

## Beetle Ferry