How Do You Rename a Table in HBase?

To rename a table in HBase, apparently you have to use snapshots. So, you take a snapshot of the table and then clone it as a different name. In the HBase shell: disable ‘tableName’ snapshot ‘tableName’, ‘tableSnapshot’ clone_snapshot ‘tableSnapshot’, ‘newTableName’ delete_snapshot ‘tableSnapshot’ drop ‘tableName’ SOURCE http://hbase.apache.org/book.html#table.rename

Include header in the ‘grep’ result

The following means you only need type the command once (rather than using && and typing it twice), it’s also quite simple to understand. some-command | { head -1; grep some-stuff; } e.g. ps -ef | { head -1; grep python; } UPDATE: This only seems to work for ps, sorry, but I guess this … Read more

Shortening my prompt in Zsh

Old question, I know, but as an alternative solution I just discovered powerlevel9k, an extension of agnoster (they appear practically identical bar a fair few tweaks), which has this functionality built in. Just set it as your zsh theme, then in .zshrc set POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 which ensures that only two directories are listed. Alternate options are … Read more

Set Default Shell in Cygwin

Try editing /etc/nsswitch.conf instead of /etc/passwd Instead of creating a passwd file, which Cygwin recommends against1, you could edit /etc/nsswitch.conf. Add or edit the following line: db_shell: /usr/bin/fish The down/up side of this method is that, if you have multiple users, this change affects all of them. The up/up side is that it’s dead simple. … Read more

How can I check the version of sed in OS X?

This probably isn’t the answer you’re looking for, but you can’t. Mac OS X sed has no option to show the version number. There is not even a version number in the binary: $ strings $(which sed) $FreeBSD: src/usr.bin/sed/compile.c,v 1.28 2005/08/04 10:05:11 dds Exp $ $FreeBSD: src/usr.bin/sed/main.c,v 1.36 2005/05/10 13:40:50 glebius Exp $ $FreeBSD: src/usr.bin/sed/misc.c,v … Read more

Kill a Docker Container

You will be able to see currently running docker containers using below command. docker ps Then copy the CONTAINER ID of the running container and execute the following command docker stop <container_id> Please replace with a real value.

rsync exclude a directory but include a subdirectory

Sometime it’s just a detail. Just change your include pattern adding a trailing / at the end of include pattern and it’ll work: rsync -avz –delete –include=specs/install/project1/ \ –exclude=specs/* /srv/http/projects/project/ \ [email protected]:~/projects/project Or, in alternative, prepare a filter file like this: $ cat << EOF >pattern.txt > + specs/install/project1/ > – specs/* > EOF Then … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)