재택 근무 5년차의 고민

2007년부터 주욱 재택 근무를 해 오고 있다.

많은 재택 근무 관련 기사들이 일과 가정을 분리할 필요가 있음을 강조한다. 그러나 아이러니하게도 철저한 분리는 재택 근무가 갖는 장점을 퇴색시키면서 가족에 대한 양심의 가책까지 만들어낸다. (바로 옆 방에 있으면서 자녀와 놀아주지도 않고 가족들이 떠들거나 TV를 보게 놔둘 수도 없다! 아내가 요리하고 있으면 아이를 돌보지 않으면 아이가 심심해할 텐데..)

그렇다 보니 이도 저도 아닌 근무 환경이 쉽게 조성된다. 업무의 특성상 장시간 몰두하지 않으면 진도가 빠지지 않는다. 끊임없이 외부 자극에 노출이 되다 보니 일이 안된다. 일이 안되니 놀면서도 일 생각이 나고, 놀 때 제대로 못 노니 일하면서도 자꾸 가족이 신경쓰인다. (내 커리어는 여기서 끝장나는가?) 균형있는 분리? 그것은 철저한 분리의 다른 이름이 아닐까 싶을 정도다.

그래. 이제부터는 방문을 꼭꼭 닫아 놓고 음악을 충분히 높여 틀고 일하는거야. 가끔씩 울리는 초인종 소리에도 뛰쳐나가지 않는거야. 그리고 흐름을 탔거나 꼭 해 두고 싶은 업무가 있다면 야근을 할 수도 있겠지. 그렇게 나는 주 40시간을 꽉꽉 채울거야.

이걸 못 해내거나 해냈음에도 일이 잘 되지 않는다면 아마도 미국에 있는 사무실에 출퇴근을 하는 게 맞겠지..

How to Rip Audio CD as FLAC with Embedded Cue Sheet in Ubuntu Linux

I wrote a pretty simple shell script that rips an audio CD as a single FLAC file with embedded cuesheet for Linux. It ensures secure rip by ripping a disc three times with cdparanoia and comparing their checksums. It has been tested on Ubuntu 12.04 Precise, but it should work for any Linux system such as Fedora.

Usage

Just run the script in your shell prompt, it will retrieve the ID of the disc and generate a <DISCID>.flac

Required packages

Install the following packages first:

apt-get install cd-discid cdrdao cuetools flac cdparanoia

Install the ripper script

Put the following script into your path (e.g. /usr/local/bin). You might want to change the DEVICE variable (e.g. /dev/cdrom). If you want even more secure rip, you can set the COPIES variable to a greater value (e.g. 5).

#!/bin/bash
# /usr/local/bin/rip-audio-cd
DEVICE="/dev/sr0"
COPIES="3"
DISCID="`cd-discid $DEVICE 2>&1 | egrep -o '^[0-9a-z]{8}'`"
if [ "$?" != "0" ]; then
  echo "Failed to retrieve disc ID."
  exit 1
fi
echo -e "33[1;32mDisc ID: $DISCID33[0;0m"
rm -f "$DISCID".*
echo -e "33[1;32mExtracting a cue sheet:33[0;0m"
cdrdao read-toc --device "$DEVICE" --datafile "$DISCID.wav" "$DISCID.toc" || exit 2
cueconvert -i toc -o cue "$DISCID.toc" | grep -vP '^ISRC "' > "$DISCID.cue" || exit 2
CHECKSUM=''
I=0
for ((I=0; I < $COPIES; I++)); do
  echo
  echo -e "33[1;32mPass $((I+1)) of $COPIES33[0;0m:"
  if [[ $I -eq 0 ]]; then
    OUT="$DISCID.wav"
  else
    OUT="$DISCID.new.wav"
  fi
  rm -f "$OUT"
    cdparanoia -zX '1-' "$OUT"
  if [ "$?" != "0" ]; then
    rm -f "$DISCID".*
    echo "Failed to rip a disc."
    exit 3
  fi
    C="`sha1sum "$OUT" | cut -f1 -d' '`"
  if [[ "x$CHECKSUM" = 'x' ]]; then
    echo "Checksum: $C"
    CHECKSUM=$C
  else
    rm -f "$OUT"
    if [[ "$CHECKSUM" != "$C" ]]; then
      echo "Mismatching checksum: $C"
      exit 4
    else
      echo "Matching checksum: $C"
    fi
  fi
done
eject "$DEVICE" &
echo
echo -en "33[1;32mCompressing...33[0;0m"
flac -f -V --replay-gain --best --cuesheet="$DISCID.cue" "$DISCID.wav"
if [ "$?" != "0" ]; then
  echo "Failed to encode the ripped tracks."
  exit 5
fi

rm -f "$DISCID.wav" "$DISCID.cue" "$DISCID.toc"

echo
echo -e "33[1;32mAll done: $DISCID.flac33[0;0m"

Fill metadata

Unfortunately, the script does not fill the metadata such as track information and cover art. I usually rip a bunch of discs first using this script and then fill their metadata in Windows. Here’s the steps I take:

  1. Load the FLAC file into foobar2000
  2. Fill the track information.
    • Select all tracks, right-click them, and choose ‘Tagging -> Get tags from freedb’.
    • If not found from freedb, you can always fill manually by choosing ‘Properties’.
  3. Update ReplayGain information.
    • Select all tracks, right-click them, and choose ‘ReplayGain -> Scan selection as a single album’.
  4. Download album arts (front cover, back cover, disc) using Album Art Downloader XUI
  5. Attach the downloaded album arts into the FLAC file using foobar2000.
    • Select all tracks, right-click then, and then choose ‘Tagging -> Attach pictures’.

How to build OpenJDK 7 on Ubuntu 11.10 and 12.04

This article will guide you to build OpenJDK in your 64-bit Ubuntu Linux (11.10 Oneiric Ocelot or 12.04 Precise Pangolin) without many trials and errors. It is based on the official OpenJDK build README, but the README file is out-of-date, and that’s why I wrote this guide.

Assumptions

  • You run 64-bit Ubuntu.
  • Your Sun/Oracle JDK 6 is installed at $HOME/.local/opt/jdk/1.6.
    • You can use your preferred installation location but you will have to adjust the scripts appear in this article.
  • You installed Apache Ant and the ant command is in your PATH variable.
  • You keep your development stuff at $HOME/Workspace.
    • This guide keeps OpenJDK source code at ~/Workspace/openjdk and HgForest at ~/Workspace/hgforest. However, you can keep them in different locations and adjust the scripts appear in this article.

Install required packages

apt-get install mercurial gawk g++ libcups2-dev libasound2-dev libfreetype6-dev libx11-dev libxt-dev libxext-dev libxrender-dev libxtst-dev libfontconfig1-dev

Install HgForest

hg clone https://bitbucket.org/pmezard/hgforest-crew/overview/ "$HOME/Workspace/hgforest"

Edit your $HOME/.hgrc to add these lines:

[extensions]
forest=~/Workspace/hgforest/forest.py

Clone the OpenJDK 7 repository

hg fclone http://hg.openjdk.java.net/jdk7u/jdk7u "$HOME/Workspace/openjdk"

Apply some patches

If you need to apply some patches, do it now, and then continue to build.

Build the OpenJDK 7

cd "$HOME/Workspace/openjdk"
unset JAVA_HOME
export LANG=C
export ALT_BOOTDIR="$HOME/.local/opt/jdk/1.6"
export ALLOW_DOWNLOADS=true
export EXTRA_LIBS=/usr/lib/x86_64-linux-gnu/libasound.so
source jdk/make/jdk_generic_profile.sh
make sanity && make && echo 'Images at: build/linux-amd64/j2sdk-image'

I usually write a build script that automatically sets the environment variables and calls make.

Once the build process is successful, you will find your OpenJDK image at build/linux-amd64/j2sdk-image.