Skip to main content

Posts

Showing posts from March, 2012

Access a remote service localy via ssh

This will be just a short reminder for myself not to forget how to forward a remote service's port to a local one through ssh. Here is the schema: ssh -i .ssh/ssh_keys/root -L 55432:localhost:5432 root@thinks.iamallama.com With -i we use a private key to the remote host's user named root at the end. Next we say we want to access a local port -55432- and send the data through that one to the remote port -5432-. We want to use our localhost to address the service which is hosted on the thinks.iamallama.com machine. This wraps it up. ^_^

How to cut FLAC with CUE files

I have read the best and simplest procedure for Windows on this forum thread:  http://www.head-fi.org/t/547712/cut-a-flac-ape-file-with-the-cue Here is the recipe: Get Flac , you just need flac.exe, put it in some directory; Open the .cue file in Foobar; Select all the tracks, right-click, choose 'convert', choose '...'; Click 'output format', choose FLAC, click 'edit' and set it to 8; Click 'destination' and choose your options; Click 'processing' and make sure 'enable decode...' is off, and 'active dsps' is empty; Click convert, foobar will ask you were you put flac.exe, navigate to it and voila. You can use the "bit compare" plugin to make sure the new converted tracks are bit identical to the original ones.

Directory tree in Bash

I was recently searching for a bash script that could be used to create the skeleton of a yaml file containing directory structure. The best material I found is here: http://systembash.com/content/one-line-linux-command-to-print-out-directory-tree-listing/ With the modification of this line: find ./ -type d | sed -e 's/[^-][^\/]*\//--/g;s/--/ |-/' I managed to produce the best skeleton: find ./ | sed -e 's/[^\/]*\// /g' Since I still have to shape this file up with more data I am not bothering with finding a method to put the ':' at the end of each directory as I can do it myself with little effort. I use Vim's visual mode to get rid of the extra leading spaces at each line.