Saturday, November 24, 2018

[OSX] command line 'join' failed with DOS line end 0d0a


Ever frustrated how join command did not work on some file?

To get rid of the 0x0d from DOS .CSV file, i.e. make unix 0a ending, do

# note that ^M below is entered by CTRL-V CTRL-M 
$ sed 's/^M//' in.csv > out.csv

Labels: , , , , , ,

Tuesday, May 15, 2018

playing Docker on ubuntu 18.04 LTS

# update package list:
$ sudo apt update

# installation:
$ sudo apt install docker

# by now, docker is sudo only.  if want to skip that 'sudo'
$ sudo groupadd docker
$ sudo useradd -aG docker $USER
doc said logout and re-login... i found it requires restarting.

# test environment, run helloworld
$ docker run hello-world
# will pull first if image not yet existed.



##  examples


# try node.js
$ docker pull node   # see online slim version
...
$ docker run node   # run and end and return
$ docker run -td node  # run in a new (t)ty, and (d)etached, end and return
$ docker run -it node   # run in a new (t)ty, (i)nteractively - prompt node's '>', ctrl-d to exit

# list downloaded images
$ docker images

# docker --help


Labels: , , , , , , ,

Saturday, October 25, 2014

svn cookbook


# ** BRANCH ** #

# partial checkout
svn co -depth files https://server/path/trunk .
svn up --set-depth immediates

# switch from trunk to branch
svn switch https://svn/myproject/trunk/dev .

# same repository, can use shorthand:
svn switch ^/myproject/branches/r01_05 .


# ** CONFLICTS ** #

# list conflict
svn st | grep ^C

# resolve conflict
svn resolve --accept mine-full


# ** OTHERS.. **  #

#add recursively
svn update --force


# revert recursively
svn revert -R

# side-by-side diff
svn --diff-cmd diff --extensions -y diff

Labels: , , , ,