Posts tagged Linux
PHP Process Viewer for Unix
Oct 4th
While working on a project lately, i needed a script that would allow me to find certain processes with PHP and inspect their running times, etc. After struggling for a little bit, i came up with the following script that can output a plain view, JSON or XML of the running processes whose names match a regular expression passed to the script. The script can also kill all processes that match the search term.
This script is by no means complete, but i thought i’d share it with my readers ![]()
Save it as process_viewer and run it from the command line.
Please keep in mind that this script is still in a very rough form and should not be used on enterprise products; it’s merely a bit of buggering around for fun
Click here to download the script.
Usage:
process_viewer [search_regex] [mode] -o [format]
- search_regex – search term to find running processes (defaults to .+)
- mode – script mode (defaults to view)
- view | kill
- -o – flag to indicate that the script must output in a specified format
- format – output format (defaults to plain)
- plain | json | xml
Sample usage:
./process_viewer bash view -o xml
Union Platform – Part I (Installation)
Jul 8th
We’ve all heard about Colin Moock at some point in our Flash/Flex development career. Colin has authored a great many ActionScript books throughout the years and as a consequence has helped thousands – including myself – to learn ActionScript. Now Colin has hit the community with something incredible… the Union Platform.
Here is the official definition of the Union Platform from http://www.unionplatform.com: “Union is a development platform for creating multiuser applications. It includes the Union Server, a multiuser communications server, and Reactor, a framework for creating Adobe Flash client applications.”
Essentially what this means is… you can now build realtime chat applications, MMORPG games, and anything else that could use a little realtime flavour
Installation
In this part of the series on the Union Platform i will be showing you how to install the Union server on your *nix machines and Window$ machines. Let’s leave the hideous beast (Window$) for last, and begin with a real operating system that is actually a pleasure to work with, and doesn’t make you praise whichever god you worship that your legs can’t bend backwards at the knees to kick yourself in the balls for ever getting roped into that shitty OS.
I’ll be Linux Mint for my *nix installation explanation, and this will work on Macs too in much the same way.
The Union Platform Server is a Java application that will run on your server and listen on port 9100 and 9101 for traffic. Be sure to check that your firewall doesn’t block this port before you begin…
First things first, head over to the downloads page on the Union site and download the GZipped tarball to your desktop.
Next, unzip the tarball’s contents (tar -xf union_1.0.0_alpha2.tar.gz). This will create a folder called union on your desktop. Now, move either the folder in its entireity or the contents to a folder somewhere on your machine.
Perfect. So now we have all the files we need. Make sure that you have Java installed and working correctly on your machine or otherwise this will not work. You will need to make sure that this folder had execute permissions, so issue the command chmod 775 * to give all the files the necessary permissions.
Usage
Once this is done, we’re done! To start the Union Platform Server issue this command: ./startserver.sh from inside the folder you unzipped. You will now see your terminal bombarded with debug messages notifying you of Union‘s successful start.
Window$ users please note: the instructions above are pretty much the same for Window$; merely extract the files to your machine and run the batch file startserver.bat.
Administration Panel
Colin Moock and crew have been generous enough to provide us with a Flex administration panel for the server, and you can find it here. Download the SWF, and open it in your browser. You will be met with a login screen like this:
NOTE: If you look in the union.xml configuration file, you will find the password that is used by the server. By default it is password. Also note that the administration panel runs on port 9110.
Once you have logged in, you will see a screen like this:
Pretty bloody cool if you ask me!
Join me in the next part of this series when i will be demonstrating how to build a simple realtime chat application!
Flex Builder 3 for Linux has been canned! Show your support!
Apr 28th
I was recently shocked and appalled to see that Adobe has put the development on Flex Builder 3 for Linux on hold. I, for one, would really love to be able to develop Flex applications on Linux (I use Linux Mint) and – in addition – would like to see a Creative Suite release for Linux soon, too.
Personally i can’t think why developing a version of Flex Builder for Linux would be so difficult. Flex Builder is built on top of (and as a plugin for) Eclipse, which is Java-based and therefore cross-platform. I’d imagine that it does have something to do with the Flash Player as Tom of rachaelandtom.info says. Can anyone shed some light on the situation?
The reason for Adobe’s suspension of development is:
“The project is currently on hold. There is not enough requisition for the product to continue its development” – Ben Forta (Adobe Senior Technical Evangelist)
Please show your support and vote for the continuation of this amazing project! Go to http://bugs.adobe.com/jira/browse/FB-19053 and vote!!
Which Linux distro best suits you?
Mar 13th
I stumbled upon a very interesting test today that asks you a series of questions and then offers you advice as to which linux distros would suit you, and why.
Go to http://www.zegeniestudios.net/ldc/index.php to take the test.
Here are my results:
Using SWFTools on Linux
Jan 27th
SWFTools is a fantastic library of SWF manipulation utilities. It contains the following packages:
- PDF2SWF A PDF to SWF Converter. Generates one frame per page. Enables you to have fully formatted text, including tables, formulas etc. inside your Flash Movie. It’s based on the xpdf PDF parser from Derek B. Noonburg.
- SWFCombine A tool for inserting SWFs into Wrapper SWFs. (Templates) E.g. for including the pdf2swf SWFs in some sort of Browsing-SWF.
- SWFStrings Scans SWFs for text data.
- SWFDump Prints out various informations about SWFs.
- JPEG2SWF Takes one or more JPEG pictures and generates a SWF slideshow.
- PNG2SWF Like JPEG2SWF, only for PNGs.
- GIF2SWF Converts GIFs to SWF. Also able to handle animated gifs.
- WAV2SWF Converts WAV audio files to SWFs, using the L.A.M.E. MP3 encoder library.
- AVI2SWF Converts AVI animation files to SWF. It supports Flash MX H.263 compression. Some examples can be found at examples.html.
- Font2SWF Converts font files (TTF, Type1) to SWF.
- SWFBBox Allows to readjust SWF bounding boxes.
- SWFC A tool for creating SWF files from simple script files.
- SWFExtract Allows to extract Movieclips, Sounds, Images etc. from SWF files.
- RFXSWF Library A fully featured library which can be used for standalone SWF generation. Includes support for Bitmaps, Buttons, Shapes, Text, Fonts, Sound etc. It also has support for ActionScript using the Ming ActionCompiler.
You can download the tarball from their site (http://www.swftools.org) or using the Synaptic Package Manager on your Linux distro. The installation is fairly straightforward, so i’ll just skip to using the package.
All the exercise files i will be using in this post are available here.
The tools i will be highlighting are:
- PDF2SWF
- SWFDump
PDF2SWF
This is probably the most useful tool in the entire package. As the name implies, it will convert the inputted PDF and convert it into a SWF. Refer to the PDF2SWF.pdf and PDF2SWF.swf files in the exercise files.
You can find the manual for PDF2SWF here.
Usage: pdf2swf [options] input-file.pdf -o output-file.swf
Useful arguments:
- -P – Decrypt the SWF with a password
- -p – Pages to convert
- -T – Set the Flash Player version
SWFDump
This is a very neat tool! It can tell you a whole lot about your SWF, such as the width, height, fonts, and it can even generate (X)HTML code for you for embedding your SWF.
The documentation for this tool can be found here.
This is a very interesting package for all of the experimenting Flash/Flex developers working on or with Linux. The package is available for a plethora of operating systems though, but it’s always cooler on Linux
Linux Mint & Flex
Jan 24th
I recently moved over to Linux Mint. Their catch-phrase is “from freedom came elegance” and it rings so true.
Linux Mint is one of the surprise packages of the past year. Originally launched as a variant of Ubuntu with integrated media codecs, it has now developed into one of the most user-friendly distributions on the market – complete with a custom desktop and menus, several unique configuration tools, a web-based package installation interface, and a number of different editions. Perhaps most importantly, this is one project where the developers and users are in constant interaction, resulting in dramatic, user-driven improvements with every new release.
The truth be told – i’m a bit of a n00b when it comes to Linux, but wow… What an OS. You can download the OS here, then simply write it to disk and restart your PC and boot from the installer disk. Mint can be run from the disk, which is quite a cool feature (available on a few other Linux distros i’m told – such as Ubuntu)
My main line of work – and my passion – is developing Flex applications, and as a consequence, i need to be able to develop Flex apps from Linux. The incredible folks over at Adobe have released the fourth public alpha release of Flex Builder for Linux. Being an alpha version, it does not have all the features we’re accustomed to in the Windows or Mac incarnations, and you’ll need to install Eclipse Europa 3.3.2 for it to work (Flex Builder only comes as a plugin at this point). The main missing features are:
- Design view
- States view
- Refactoring
- Data Wizards
- Cold Fusion – Data Services Wizard
- Web Services introspection
- Profiler
However, the features that are present are more than enough to develop Flex/AIR applications, and if you can’t build Flex apps without design view, you suck
.
Please note: The Flex Builder plugin will NOT work with Eclipse Ganymede (3.4.x). The plugin will install just fine, but the MXML editor will not work. There has been much discussion about it on the bugs.adobe.com site, but no solution has been found as of yet.
The installation of Flex Builder for Linux is quite simple. Follow these instructions:
- Download Eclipse Europa 3.3.2 to your desktop. Open the terminal and extract the archive to wherever you like.
- Download the Flex Builder for Linux plugin to your desktop. Open the terminal, direct the terminal to your desktop and enter the following:
sudo sh flexbuilder_linux_install_a4_081408.bin
- Follow the installer’s instructions and install the plugin. Please be sure that the directory you’re installing the plugin to is the correct Eclipse directory.
- The plugin will now be installed to your Eclipse install. Go to your eclipse folder and run the main application. Click on the Window menu and select Open Perspective. Click Other and search for Flex. From here you can open your Flex Development perspective and start developing Flex applications
!
Great! So now you have installed the Flex Builder for Linux plugin. Unlike the Windows/Mac versions, you will have 311 days or something like that to test the application. If you are a student, you can apply for a free Flex license here. I’ve used my student license on both my Windows and Linux versions and it works fine.
Fuck Vista!!!!
Nov 10th
I’ve had it. I’m in a rage. I’m completely sick of Vista, Windows, Microsoft; the whole megalomaniacal troupe. I’m moving over to Linux, i’ve decided. I’m too broke to afford a Mac, so Linux it must be.
After doing a little research, i found a great blog post here. I hope this helps any other malcontents that are sick of being raped by Microsoft.





