Words seem to fail to describe just how awesome LPeg is. Designed as a Lua implementation of the PEG concept, it is a true programming gem! Please, if you dont’t know what it is, take some time to familiarize yourself with it! It’s not the easiest thing to grasp, but you will not regret it! It is certainly one of the most worthwhile learning efforts you can make in generic
Continue readingAuthor: Valeriu Paloş
Lua2C, an updated version
I know I have been “missing in action” lately but I am working furiously, and I seem to have too little time for my blog (very sad face). But, just for a breath of fresh air, I thought I’d share something with the world. Entering lua2c.lua Lately I became quite interested in Lua (a lot actually). It has phenomenal speed, exceptional interfacing with C and some features and libraries that
Continue readingLoomiere/Stream: Revived!
UPDATE: /1165/loomiere-2-0-1-beta-finally-out/ OK folks, things have settled down and we are good to go. After some considerations the legal concerns for Loomiere/Stream are now cleared and gone. The source is now released and will be available indefinitely. Again, this streamer (minimally customized) has already been serving all the video content at http://peteava.ro for 3 full months (for those seeking a demo). Source code: loomiere-0.2.1-tar.gz Warning: Any software downloaded from this
Continue reading@font-face for a programmer’s blog?
I’m sure that many of you are well aware of the exceptional @font-face CSS3 rule, which made life much easier for many designers, I would think. A few days ago I started wondering if it would be appropriate to use such an instrument on my blog… the site you’re on! Yoopie! And, why not!? I love the idea of making my source codes more readable by using some custom font
Continue readingURI parsing using Bash built-in features
A bit of background A while ago I posted an article describing how one could parse complete URIs in Bash using the sed program. Since then, I have realized that there is a better way to do it, a much better way: via Bash built-in pattern matching! Here are some benefits of this improvement: It no longer executes external programs (i.e. sed) for pattern matching. This translates to higher speed
Continue readingFirst impressions on Loomiere/Stream performance
UPDATE: http://vpalos.com/1165/loomiere-2-0-1-beta-finally-out/ As promised, here are some of the first monitoring statistics of Loomiere/Stream in a production environment after moving away from psstream. Only one server is considered, a Quad-core Xeon with 8GB RAM (not that they are used anymore). This shows the memory usage over one week (the switch was made on the 29th as is obvious).
Continue readingLoomiere/Stream – A high performance streaming server
UPDATE: http://vpalos.com/1165/loomiere-2-0-1-beta-finally-out/ The Loomiere (0.2.1) code is now freely available under GPLv3. Please see this post for an update. Are you killing psstream? Well, yes! I am sure that many of you already know about psstream (the PHP streaming extension I made a while back). Well, many things happened since then and I came to realize I could do better; a whole lot better actually. As of now the ‘psstream’ project
Continue readingRecursive chmod distinguishing files from folders
Version 3 An even better method is: find “$target” -type f -exec chmod -c “$mode_files” {} \; \ -or -type d -exec chmod -c “$mode_dir” {} \; A true one-liner! 😀 Version 2 A better method is this: find “$target” -type f -exec chmod -c “$mode_files” {} \; find “$target” -type d -exec chmod -c “$mode_dir” {} \; This one can also be used from the command line. Version 1
Continue readingBash URI parser using SED
Warning! This version is now obsolete! Check out the new and improved version (using only Bash built-ins) here! Here is a command-line (bash) script that uses sed to split the segments of an URI into usable variables. It also validates the given URI since malformed strings produce the text “ERROR” which can be handled accordingly: # Assembling a sample URI (including an injection attack) uri_1=’http://user:pass@www.example.com:19741/dir1/dir2/file.php’ uri_2=’?param=some_value&array[0]=123¶m2=\`cat /etc/passwd\`’ uri_3=’#bottom-left’ uri=”$uri_1$uri_2$uri_3″ #
Continue reading