guy labs guy labs

Extract subtitles from mkv files and convert to the srt format

General, Mac OSX
/by
In the todays blog post I will show you how to extract subtitles from a MKV file and how to convert the .sub/.idx files to .srt files. I have this requirement as I use the Twonky mediaserver which only accepts .srt files with my Samsung TV. The whole guide is using brew and therefore is only for Mac users. There are surely similar or the same tools available for any other linux or maybe also Windows. If you find these please tell me such that I can update this blog post. So lets start by installing the needed tools for extracting the subtitles from the .mkv files: Next we want to see all tracks of the .mkv file: This will give you a similar output: So we see that this .mkv has one video, two audio (english and german) and two VobSub subtitles tracks (english and german). We are interested in the two last tracks and with these commands you can extract them: Currently I only extracted VobSub subtitles and this guide deals with the .sub/.idx files and convert them to the .srt format. It could also be that there are already .srt files in the .mkv files, then you do not need to convert anything and just check the language of the subtitles by opening them in any text editor and check the language. This will result in four files named sub3.idx/sub3.sub and sub4.idx/sub4.sub in the same directory. Currently we do not see what language the subtitles are so we need to convert them to...

IntelliJ IDEA keymap for Atom editor project

Development
/by
Hi, after a long break here a new package for the Atom editor. It includes the keymap of some basic commands from IntelliJ IDEA (my favorite IDE). This way you can always use the same key commands in both applications. Check it out here: https://atom.io/packages/intellij-idea-keymap or the Github project here: https://github.com/guylabs/intellij-idea-keymap Feedback or contributions are welcome!  :-) Enjoy and have a nice...

Get latest master changes of a Bower dependency

Development
/by
On my side project ion-autocomplete I sometimes tell the people which have reported an issue to use the lastest changes such that they are able to test the issue before I do a release. This way they can test it beforehand instead of doing a release and if it didn't work do another release. So now to the code: To get the latest changes of a Bower dependency you can use the following notation: In this example we get the latest  changes of the specified GIT repository. For each dependency you always need to know its GIT repository to use this notation. Do not forget the quotes around the URL, as these are needed. You can also get a specific commit in the repository like this: Here you can add the commit SHA after the hash sign. You can also add another branch. For this just add the branch name after the hash sign. I hope this post is useful for some of you. Thanks for reading and have a nice...

Ionic autocomplete project

Development
/by
Today I want to present you my second open source project: Ionic autocomplete. This Angular directive makes it possible to show an autocomplete component based on the Ionic framework. It uses the given UI elements from Ionic to build up the search input and the list of found items. Please read more in the projects section or have a look at the source code on GitHub. If you have any questions feel free to add a comment to the projects page or create an issue on...

Get rid of .DS_Store files on Mac OS X 10.10

Mac OSX
/by
After a long pause I have a new blog post about the annoying   files which are generated by the built in Finder application in Mac OS X. First of all we need to close all Finder windows and then we execute the following commands inside a terminal: This command disables the creation of the   files on the following network drive types: SMB/CIFS, AFP, NFS, and WebDAV. Next we need to install Asepsis. This tool redirects the creation of the   files to another folder such that the built in Finder is still able to save its meta data, and we do not have the   files in each folder anymore. To install this application just download it from here and then execute the installer and then you need to restart the machine. The next step is for the people which do not need the specific folder views for each folder etc. from the built in Finder, because with the following command we remove all the   files from the hard drive. After you have executed the command, the built in Finder has the default view on all folders. After this step you will never find any   file again in any of your folders. I hope you find this post useful as it is a complete guide on how to "disable" the   files. Cheers, Guy PS: For the ones asking themselves why I now write about Mac OS X topics: I recently needed to switch to Mac because there are some applications which we use at our company which just didn't work...

Angular Spring Data REST project

Development
/by
Today I want to present you my first open source project: Angular Spring Data REST. This Angular module wraps the Spring Data REST response and provides an easy way to navigate between the resources. Please read more in the projects section or have a look at the source code on GitHub. If you have any questions feel free to add a comment to the projects page or create an issue on GitHub. Have a nice...

PostgreSQL – CET FATAL: could not create shared memory segment

Infrastructure, Linux
/by
Lately I updated to the latest PostgreSQL from the Ubuntu repositories and then I got the error "CET FATAL: could not create shared memory segment". As the following error message states, the  value of the kernel is too less or the shared memory propery of PostgreSQL is too high. The complete error message looked like this: My solution was to increase the  kernel parameter as I have a lot of memory left on my server. To see the current value of your  parameter execute the following command : And to check the size of the shared memory of your PostgreSQL instance open up the file   and search for the parameter  . To increase the  parameter of your system you need to edit the   file and add the following at the end of the file: That would increase the  value to 100 mega bytes (104857600 bytes). Next you need to reload the sysctl file with the following command: After that you should be able to restart the PostgreSQL server without any problems. Cheers and have a nice...

Autowiring Spring beans in Hibernate/JPA entity listeners

Development
/by
After a long time without a post I will write something about Spring dependency injection in Hibernate/JPA entity listeners. The problem here is that you are not able to just autowire a Spring bean in a Hibernate/JPA entity listener, because Hibernate for instance instantiates the entity listener before Spring can autowire the beans and therefore all the autowired beans are null. I found some some other ways to autowire the beans which specify which listeners should be registered in a Hibernate configuration class, but the way I will show you in this post is the simplest one in my opinion. Other opinions are also welcome :wink: I found the idea here at Stackoverflow. In the following example I want to show you how to add a JPA listener which always sets a creation date and a modification date when a entity is created/modified. Ok lets start by a simple abstract JPA entity: Here there is nothing special except the : And here you already see that we have an autowired Spring bean which returns the current date. This entity listener listens for the pre-update and the pre-persist events and sets the according dates. There is also the static call to the autowire method of the . That's the core of the dependency injection in the Hibernate entity listeners: This  implements the  interface from Spring with which the helper is able to get a reference of the application context. The autowire method takes the class instance which needs to be autowired and the beans which need to be autowired. (This...

Confluence 5 and JIRA 6 talk

General
/by
Hi yesterday I had a talk at mimacom about Confluence 5 and JIRA 6. I talked about the new features and the connection between these two applications. If you are interested, please have a look at the presentation here: https://presentations.edorasware.com/confluence-5-and-jira-6 Feedback is welcome ...

edoras one – a practical example

General, Personal
/by
Hi it's been a long time since my last post, but in the last month I had too much to do at work and at home. Sorry for that  :wink: . But in this post I want to show you a practical example of our product edoras one from edorasware. (The company I work at) Just watch the video (english and german) and then you'll see on what we are working so hard at the moment  :lol: If you have any questions please contact me or visit...