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...

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...

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...

VMware Snapshot and recovery: fix active directory replication

Windows
/by
Two weeks ago I tried to install the newest updates onto one of our virtual domain controllers. Shortly explained it was not the best idea and I had to recover to the snapshot taken just before I launched the update process, lucky enough I remembered to take one. :) Yesterday morning I was told that the active directory content was different on both domain controllers. I found that hard to believe and had to take a look myself and yes, the content was different. How did that happen? I knew recovering from a snapshot may result in issues but I didn't see it in the first place. After looking around I found out I had a so called USN rollback to do because of a "dirty" rollback of the active directory. Microsoft is aware of the issue and has posted an article about it: https://support.microsoft.com/default.aspx?scid=kb;EN-US;875495 So the way would have been demoting and promoting a domain controller, and this during the day? No way... there had to be another solution. So I checked the replication status: Result was: This was odd, I checked the USN on both machines and they were identical. So the replication was not a total failure, but somehow not working as usual. Next I wanted to make sure the inbound and outbound replication were working and that the global catalog was still working: And there it was, the output revealed the problem: Inbound and outbound replication were disabled on the recovered virtual domain controller. So enabling those two parameters did the trick: After waiting...

Introducing DHCP Failover in Windows Server 2012

Windows
/by
One of the most central feature there is within a private network, not depending on size or architecture, is DHCP. Until today Windows server was not able to have a failover feature implemented, only exception was to include the feature in a Windows failover cluster. But not anymore: it became a feature in Windows server 2012. Of course it only runs on Windows server 2012 so you will have to upgrade your two servers first which will hold the two DHCP roles. After you successfully upgraded: 1. Install the DHCP role on the server1 and set up the first DHCP server according to your needs. Authorize the server and create your DHCP scopes. 2. Switch onto the server2 and install the DHCP role as well. Authorize the server. 3. Switch back onto server1 and right-click “configure failover” (IMAGE) 4. When asked for partner server enter the FQDN of server2 and click “Next” 5. Give the relationship a name, enter a shared secret for the relationship to use and click “Next” 6. Leave settings for MCLT*, change operation mode to “hot standby” and finish wizard Voilà, that’s all there is to do. You’re set up for DHCP failover, do not forget to present the IP address of the second DHCP server to all your other components. For more detailed information and all powershell commands to realize this cool new feature on server core visit the following link from the Microsoft Technet: http://blogs.technet.com/b/teamdhcp/archive/2012/06/28/ensuring-high-availability-of-dhcp-using-windows-server-2012-dhcp-failover.aspx   Picture: http://technet.microsoft.com   *Definition of MCLT (Technet): The Maximum Client Lead Time (MCLT) is additional time provided to a DHCP client...

Logon credentials issue after Windows 8 upgraded to 8.1

Windows
/by
When setting up Windows 8 I decided to create a local user, I’m not a big fan of the live ID. The live ID is mandatory for the store, but if you don’t use the store the live id is mostly useless. Microsoft really does not need to know everything, we have Google for this. Anyway, after upgrading to Windows 8.1 I was a bit surprised that I had to log on to my Windows with my live ID again. And surprisingly I was not able to change back to my locally created user. This was an absolute no go and after some search I found a work around from a member of the technet. Follow this procedure to disconnect from your windows live id to get back onto your local account: Move your mouse to the upper right corner, click on settings, then change PC settings Select accounts in the left menu Below your windows live account click disconnect This opens a box giving you the opportunity to log on to your local account again. If you don’t have upgraded yet you can avoid this from happening by unplugging your network connection. Also you have the opportunity to create a local user when setting up windows 8.1 from...

How to install fish shell in Ubuntu 13.04

Linux
/by
I used the fish shell for some time now and I'm really happy with it. The highlighting, the command completion etc. are great. Today I want to show you how to install it and use it as default shell in Ubuntu. Ok let's start by installing the fish package from the Ubuntu repository with the following command: If you want the newest version you can go to the developer website and download the newest .deb file for Ubuntu. Next we need to set fish as the default shell. Execute the following command, log out and login again and when you now open a shell it should show the fish shell. It's worth read the documentation about the fish shell because it's very powerful and has a lot of useful features you surely dreamed of. ...

How to fill a hard disk with zeros

Infrastructure
/by
This short how to shows you how you are able to fill a hard disk with zeros, such that the data can't be restored anymore. For this we use the good old dd command (https://en.wikipedia.org/wiki/Dd_(Unix)). Ok let's start by mounting the hard disk you want to erase. Then execute the following command to see which file system you want to erase: Ok after you have the desired file system (something like /dev/sdb) you need to execute the following command to fill the hard disk with zeros: This will take a while and because you don't get any output on how long it will take you can use the pv command (http://linux.die.net/man/1/pv). This tool will show a progress of the data going through the pipes you define. To use it we need to first install it: And now execute the following command to have a dd command with a progress bar: Replace the placeholder with the size of your hard disk in GB such that pv can calculate the remaining time for the process. Ok that was the short how to about zeroeing out a hard disk. Happy erasing! ...

Cisco ISA550W Review

General, Infrastructure
/by
Some month's ago my cheap Thomson WLAN VOIP router, which I got from my ISP, just stopped working and I needed something stable and secure. I searched a lot, read a lot of reviews until I found the ISA550W from Cisco. It had everything which I needed: Gigabit Ethernet 802.11b/g/n WLAN Integrated security appliance (ISA) And it didn't cost that much (around 360$) like a real business hardware firewall (1000$ +). There is also the greater brother of the ISA550W the ISA 570W, which just has better performance, more ports and throughput than the ISA550W, but for me the throughput was enough. Ok here now the specifications: Firewall Throughput 200 Mbps IPsec VPN Throughput 75 Mbps Anti-virus Throughput 50 Mbps IPS Throughput 60 Mbps UTM Throughput 45 Mbps Maximum Connections 15000 IPsec VPN Site-to-Site Tunnels 25 IPsec Remote Access Tunnels 10 SSL VPN Tunnels 10 Total Interface 7 GE WAN Interface 2 GE LAN Interface 6 GE WLAN (802.11b/g/n) yes DMZ Port Up to four The detailed specs you can get here and the full administration guide here. So I bought it right away and started configuring. First of all I must say that you can configure nearly everything you can imagine. (Especially when you are used to a silly Thomson router admin interface) I didn't had any problems yet with this router, but the only annoying thing is, that the security updates are just valid for one year, and then you need to renew the subscription to get updates for the anti-virus, IPS etc. Today I use the IPsec VPN, anti-virus, IPS and the standard network configs for WLAN, port forwarding etc. which all...

Avahi and unicast domains .local

Linux
/by
Today I want to tell you something about the .local domains when you use Avahi. At edorasware we use vSphere from VMWare to manage our virtual machines. For accessing it we need to connect first to the local network via VPN and then connect to the vShere server. Inside the vSphere application you can connect yourself to the console of each VM with a browser plugin. But this didn't work because we use the .local domains for the VM's inside the local intranet. To resolve this issue I needed to open the file /etc/nsswitch.conf and replace the following line with this one here: But there are other ways to fix that: http://avahi.org/wiki/AvahiAndUnicastDotLocal What I also saw is that when I connect to the SSH daemon via VPN it connects a lot faster. I hope this helps someone...