My refusal to use Windows is what makes me learn to do everything using only Linux, even though it usually requires long times in front of the computer researching and tweaking the hints google.com/linux gives me. But, at least I can say that at the end the results are satisfying, I end up learning more about Linux and how powerful a command line application can be compared to a most GUI application. I must admit that I do prefer GUI in the majority of the cases, is just that from time to time I am amazed by the power of the CLI. My latest adventure was learning how to merge a .srt (movie subtitle file) with a .avi (movie file). How I did it? Well, first we need to have mplayer installed, which on Arch Linux can be done as follows:
# pacman -Sy mplayer codecs
After that you might need to create the mplayer folder (if it isn't there already) so we can add the fonts we would like to use for the displaying of the subtitles in the movie, with that purpose we issue the following command:
$ mkdir .mplayer && cp /usr/share/fonts/TTF/LiberationSans-Regular.ttf .mplayer/subfont.ttf
Change the LiberationSans-Regular.ttf with the font you want to use. If you want to use the Liberation font, install the ttf-liberation package which is available in the community repository.
# pacman -Sy ttf-liberation
OK, we have gone a bit off the curse here with the fonts thing, but by now we should have the mencoder application installed, hopefully this makes us still on track for the merging that is about to happen. The mencoder application is part of the mplayer application we just installed, mencoder is the tool we are going to use to merge the subtitles with the movie. Now, to the better part of this tutorial, how we merge the subtitles with the movie files, the following script should do the trick:
$ mencoder -o fileiwantatend.avi -sub subtitlesfile.srt -oac copy -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell theactualmovie.avi
The first .avi we refer to in the above script is the file we want to create at the end of the merge (the resulting file), which could be named movie_subtitle.avi, now, the .srt file referred to in the script is the subtitles file which do not necessarily need to be on .srt format, it could be for example in .sub format, and the latests .avi file referred to in the command is the original movie file which you want to merge with the subtitles.
This command is very simple and has few options so it preserves the original movie file quality without much alterations, if any.
# = as root
$ = as user
pwgen - generate pronounceable passwords
Example of usage:
pwgen -A1 13
A - use small case
1 - one pass per line
13 - count of symbols in pass
1. Download the tar zipped file from dellfand's site (http://dellfand.dinglisch.net), unzip it, cd into the folder and run 'make'. This produces the executable. You have done this already.
2. As root, copy the executable to /usr/local/bin.
3. Put this line in /etc/rc.local to have it run on boot.
/usr/local/bin/dellfand 1 0.5 40 50 55
The above will run dellfand as a daemon( the parameter 1), with a sleep time of 0.5 seconds(parameter 2) with an off,low and high temperatues of 40, 50 and 55. Change the temperatures to the ones that suit you.
P.S: The BIOS in some laptops, with some BIOS versions, is more active than in others. You may get interference. It could be that reducing the polling delay (e.g. to 0.5 seconds) will reduce the annoyance caused by this. Currently I know of no other solution.
Congratulations on the new linux.com! I know it was tons of hard work.
And that's why I'm blogging this thought. How many upgrades and migrations have you done in your career? Too many, if you're like me. Seldom is there any automatic migration script that can just handle everything, esp. when big monopoly-like companies are involved. (You know who.)
The only time I've seen a good migration is when the company that wrote the new program gets some money if you switch. Then, a good migration path is a selling point.
So, back to the site. It's written in Joomla, I understand. Cool. I don't honestly care, except that I'm learning django right now. And what happens if we need to move our projects from django to Joomla, or to any other framework? Lots of rewriting. Lots of reinventing the wheel.
I propose that we do one very simple thing:
If you're programming in a language, then please embed a comment to what language it is, the version, and--most importantly--where I can find the language specification and a reference implementation of the compiler/interpreter. Better yet, provide a BNF notation and an explanation of the Abstract Syntax Tree. (What? You're using a language that's not open, or isn't well-documented? Don't make me come over there!)
If you're encoding data in XML, PLEASE, PLEASE provide a reference to the DTD or Schema definition. IHMO, that silly URL in XML that tells what namespace it's in should actually reference a valid document. Most of the time, if you try to open that URL, you get nothing. (This was just bad design on the side of the XML designers.)
What I want is this: Perfect parsers. The only way that's going to happen is for the code and data to be explicitly defined. (And, yes, you can do this with dynamic languages.) But once you have perfect parsers, voila!--you have much easier time migrating data and code. In fact, maybe it wouldn't be that hard to write migration programs. But that's another blog entry...
Linux.com est le nouveau réseau social des geeks xD
cat /dev/sda | aplay -fdat
Robust, open standards for XML document markup and a rich set of freely available tools for XML document parsing and format conversion make it easy to install and configure a complete documentation development and formatting environment on any UNIX or Linux system. This article focuses on DocBook, which is the best-known and most widely used schema for documentation markup.
Ich nutze mittlerweile unter Windows nur noch Songbird. Auch unter Linux habe ich dieses Tool bereits oft genutzt, bin aber letztendlich doch bei Exaile gelandert, da sich dieser besser in die Oberfläche von Gnome integriert. Aber es ist schon erstaunlich, wie sich der Songbird entwickelt hat. Seit der 1.0er Version absolut empfehlenswert
Scenario. Have a system with a dying raid. 2 drives (R1), In raid1, one drive has a device error, the other is listed as degraded. Rebuild halted at some 80%, won't continue due to the device error on drive 1. Can't rebuild from drive 2 because it contains a degraded raid image, and 3ware is picky about stuff like that.
We can get the data off the raid, it's working for that for now.
Now, the raid device is used in an LVM volume group, (vg00) and there's another raid (R2) on the box, using 8 drives, that has about 1TB of info on. All slots are full. What to do?
Remove one of the second raid drives, (thus putting R2 into a degraded state) put spare drive for R1 in that slot. Remove the *degraded* drive from the first array, and create a new array with the new drive, and the degraded drive.
Now, add that new raid (R3) to vg00 by creating a physical volume on that raid, and adding it to vg00. Next is the cool bit, using pvmove, we push the data off of R1 onto R3, then we remove R1 from the volume group, and can delete that raid, and remove the drive, then replace the drive we pulled out from R2 above
All data migrated, no data loss, no service interruption. I love lvm
Couple of caveats, R3 has to be able to hold all the data that was on R1, if something happens to R1 during this time, you are in trouble (but you would be anyway, since the raid is degraded) and you have deliberately degraded R2, which could bite you in the nether regions if murphy hates you. You could do this with an external USB drive, or any other datastore, a SAN, etc, but we didn't have that option in this case.
Probably other ways we could have handled this, but this worked well.
Welcome to Singularity's Blog. Here we will talk about Linux and related matters. All in a new critical point of view. In this blog you will see more about ethics, philosophy, development, industry behavior, economics, political, coding, Linux and FOSS communities, taboos (and fake-taboos), and all know topics related.
We will also discuss more about applications and tendencies behaviors, and many problem-solution environments in the market, government and educational targets - in many countries.