Sunday, June 9, 2013

Listen HitFM on Linux (Ubuntu and Fedora )

Listening HitFm from web page is not convenient as it force to open new browser window - that make inconvenience for window switching and .... .

1. Get URL for using it your Radio listen application
http://www.hitfm.ua/HitFM.m3u

Note:
if you have problem with that url , it myght be that HitFm changed it, so go to http://www.hitfm.ua/ press "Слушать радио", in newly appeared window look at links below "Слушайте Хiт FM у себя на компьютере:" copy URL from "Быстрый интернет (128 kb/s)"

2. I used default application in Ubuntu and Fedora - Rythmbox.
Add new radio by pressing "New Internet Radio Station ..." in context menu over "Radio" item in Library (left panel).

3. press "Play".

Note:
For Fedora be sure that you installed support for mp3 format, it is not installed by default - steps to install.
For Ubuntu you need to install Restricted codes(mp3,.....) " sudo apt-get install ubuntu-restricted-extras".

Wednesday, June 5, 2013

Data conversion and mining tool of any text, CSV, JSON fomats


Google tool : http://openrefine.org/

Video explain all .... this is very cool tool for data mining, and data transforming. I usually use LibreOffice Calc for this data mining, that tools rocks as it could:
- conditions for columns creation from other column
- language for data minding from columns
- recording of data translation to repeat again and again
- usage of web services to generate new column base on existing column
- embedded language to parse JSON
- .... just look at video ...

Bulk files rename in linux


Task: in folder /www/logs/jobs/ rename all files started from "rp-repgen" to "repgen", in other words change prefix of files.

Solution:
 for file in /www/logs/jobs/rp-repgen*; do dest="${file/rp-repgen/repgen}";mv $file $dest; done

Wednesday, May 1, 2013

How to split repository into two repositories


Source of wisdom.

We have infra repository that is have folder git_tool that is going to be new repository now.

State of repository "infra" before split:
jenkins_checks
svn2git
git_tools
build-release.sh              

Task: move "git_tools" to separate repository "infra_new".

Steps:
1. Create new repo for "git_tools" only
$ git clone  git@git.yourserver.com:infra
$ cd infra/
$ git filter-branch --prune-empty --index-filter 'git rm --cached --ignore-unmatch jenkins_checks/* sb-svn2git/* build-release.sh eclipse-compiler-warnings.epf ' HEAD
$ gitk --all
$ git remote add origin https://git@git.yourserver.org/infra_new.git
$ git push -u origin --all

2. Remove all history remnants from old "infra" repo:

$ git clone  git@git.yourserver.com:infra
$ cd infra/
$ git filter-branch --prune-empty --index-filter 'git rm --cached --ignore-unmatch git_tools/*' HEAD
$ gitk --all
$ git push -u origin --all --force