DanDev.com http://www.dandev.com Tidbits about software development Wed, 17 Aug 2016 01:21:41 +0000 en-US hourly 1 Build & Install ImageMagick on PHP 7 http://www.dandev.com/2016/08/build-install-imagemagick-php-7/ http://www.dandev.com/2016/08/build-install-imagemagick-php-7/#respond Tue, 16 Aug 2016 00:55:27 +0000 http://www.dandev.com/?p=497 # Install build dependencies yum install php-devel ImageMagick-devel # Get latest version from https://pecl.php.net/package/imagick cd /tmp wget https://pecl.php.net/get/imagick-3.4.1.tgz tar -zxf imagick-3.4.1.tgz cd imagick-3.4.1 phpize ./configure make install # The extension […]

The post Build & Install ImageMagick on PHP 7 appeared first on DanDev.com.

]]>
# Install build dependencies yum install php-devel ImageMagick-devel # Get latest version from https://pecl.php.net/package/imagick cd /tmp wget https://pecl.php.net/get/imagick-3.4.1.tgz tar -zxf imagick-3.4.1.tgz cd imagick-3.4.1 phpize ./configure make install # The extension file will be placed in the PHP extensions folder; it just needs to be # added to your php.ini or /etc/php.d/ file(verify path): # extension=imagick.so

The post Build & Install ImageMagick on PHP 7 appeared first on DanDev.com.

]]>
http://www.dandev.com/2016/08/build-install-imagemagick-php-7/feed/ 0
Install HandBrake CLI v0.9.9 on CentOS 6.4 http://www.dandev.com/2013/10/install-handbrake-cli-v0-9-9-centos-6-4/ http://www.dandev.com/2013/10/install-handbrake-cli-v0-9-9-centos-6-4/#comments Sat, 26 Oct 2013 00:51:11 +0000 http://www.dandev.com/?p=417 This is a quick guide to help you get HandBrakeCLI installed on CentOS 6.x. This was specifically tested with HandBrake v0.9.9 and CentOS v6.4, but it should also work for […]

The post Install HandBrake CLI v0.9.9 on CentOS 6.4 appeared first on DanDev.com.

]]>
This is a quick guide to help you get HandBrakeCLI installed on CentOS 6.x. This was specifically tested with HandBrake v0.9.9 and CentOS v6.4, but it should also work for the future versions as long as nothing major changes.

First, make sure you have the prerequisites installed:

yum groupinstall 'Development Tools' 
yum groupinstall 'Development Libraries' # Ignore for CentOS 6.5
yum install fribidi-devel gtk+ yasm webkitgtk-devel gstreamer-devel gstreamer-plugins-base-devel bzip2-devel
yum install libgudev1-devel libnotify-devel libass-devel libsamplerate-devel libogg-devel libtheora-devel libvorbis-devel


Checkout the latest version from SVN Download the latest version from their website, build it without GTK support:

cd /usr/local/src/
wget -O HandBrake-0.9.9.tar.bz2 http://handbrake.fr/rotation.php?file=HandBrake-0.9.9.tar.bz2
tar -jxvf HandBrake-0.9.9.tar.bz2
cd HandBrake-0.9.9
./configure --launch --disable-gtk
cp build/HandBrakeCLI /usr/local/bin/

The –launch argument will start HandBrake’s gmake script that will download the other libraries it needs, compile them, and then statically link them to the HandBrakeCLI executable it builds. This can take a little while, depending on your available resources, and it requires an internet connection. If you get build errors complaining about missing *.h files, make sure you have the lib*-devel installed for that missing header.

Note: The trunk will likely be updated soon-ish, so if you’re looking for 0.9.9 specifically you can get the source from SourceForge.

Edit: Looks like they removed public access to SVN.

The post Install HandBrake CLI v0.9.9 on CentOS 6.4 appeared first on DanDev.com.

]]>
http://www.dandev.com/2013/10/install-handbrake-cli-v0-9-9-centos-6-4/feed/ 4
Update Rackspace Cloud Load Balancer Timeout http://www.dandev.com/2013/10/update-rackspace-cloud-load-balancer-timeout/ http://www.dandev.com/2013/10/update-rackspace-cloud-load-balancer-timeout/#respond Fri, 25 Oct 2013 04:05:40 +0000 http://www.dandev.com/?p=396 Here is a simple script to update the Cloud Load Balancer configuration options using the Rackspace API for it. It’s been tested with Python 2.7 and Python 3.3. I made […]

The post Update Rackspace Cloud Load Balancer Timeout appeared first on DanDev.com.

]]>
Here is a simple script to update the Cloud Load Balancer configuration options using the Rackspace API for it. It’s been tested with Python 2.7 and Python 3.3.

I made this primarily to make changing the timeout a little easier(you can’t currently change it from the Cloud Panel), but you can update any of these fields too:

  • name
  • algorithm
  • protocol
  • halfClosed
  • port
  • timeout

Once you have it installed you can run it with the -h flag to get the list of arguments and an example usage:

./load_balancer_update.py -h

The post Update Rackspace Cloud Load Balancer Timeout appeared first on DanDev.com.

]]>
http://www.dandev.com/2013/10/update-rackspace-cloud-load-balancer-timeout/feed/ 0
Compiling php-python on Fedora Linux http://www.dandev.com/2012/11/compiling-php-python-on-fedora-linux/ http://www.dandev.com/2012/11/compiling-php-python-on-fedora-linux/#respond Tue, 13 Nov 2012 04:25:17 +0000 http://www.dandev.com/?p=354 So, I haven’t posted in a while, and I felt it was about time to get some fresh content up here so what follows is the result of some research […]

The post Compiling php-python on Fedora Linux appeared first on DanDev.com.

]]>
So, I haven’t posted in a while, and I felt it was about time to get some fresh content up here so what follows is the result of some research and testing I did as a result of re-visiting a question on SuperUser that I responded to over a year ago that was never fully resolved.

So, you want to run python code in PHP, eh? Why you might ask? Well, I’m not quite sure. I haven’t run in to a use case for it myself, but I can see where you might need to do some heavy-duty maths or maybe there is a python library that you require for some custom algorithm or something.

Good news! There is a PECL library you can use for this task: http://pecl.php.net/package/python
Unfortunately, it hasn’t been updated in over 4 years at the time of this writing and was in alpha at the time of the last release.
However! The maintainer appears to still be working on the package, but over a GitHub: https://github.com/jparise/php-python
Unfortunately, it still doesn’t compile on PHP 5.4 (in Fedora at least)
However! I got it to work with some minor tweaks.

Here is the process that works with the current PHP version (5.4.8 at the time of this writing) linking to python 2.7:

Install build tools and minimum deps:

yum groupinstall "Development Tools"
yum install php-common php-pear php-devel python python-devel wget

Get a copy of the latest version of php-python:

git clone https://github.com/jparise/php-python.git php-python

Apply the patch to fix C syntax errors. Note that this patch is likely to be broken and/or not necessary some time in the future when php-python is updated. But the changes are simple so you can apply them manually if they are still needed in future versions. Gist also available here: https://gist.github.com/drener/7149541

wget http://www.dandev.com/other/post_content/php-python_20121112.diff
patch -p0 < php-python_20121112.diff

Build the module

cd php-python
phpize
./configure
make
make install

After this is complete you need to edit your php.ini to enable the new module. Add a line like this:

extension=python.so

Once php.ini is updated you should be able to see the "python" module listed in the "php -m" modules list, and you should be able to use the python functions. Restart Apache if you are using mod_php to load the updated php.ini file. The examples folder on GitHub has some code you can use to see the Python features in action: https://github.com/jparise/php-python/tree/master/examples

Good luck!

The post Compiling php-python on Fedora Linux appeared first on DanDev.com.

]]>
http://www.dandev.com/2012/11/compiling-php-python-on-fedora-linux/feed/ 0
Displaying the version number in Adobe AIR http://www.dandev.com/2011/10/displaying-the-version-number-in-adobe-air/ http://www.dandev.com/2011/10/displaying-the-version-number-in-adobe-air/#respond Wed, 12 Oct 2011 04:00:55 +0000 http://www.dandev.com/?p=220 In the Adobe AIR application descriptor file there are many options you can set. One of which is the tag(or in Flex SDK v4.1 and below), which lets you differentiate […]

The post Displaying the version number in Adobe AIR appeared first on DanDev.com.

]]>
In the Adobe AIR application descriptor file there are many options you can set. One of which is the tag(or in Flex SDK v4.1 and below), which lets you differentiate your release as well as utilize the Adobe AIR updater library.

It can be useful to display your version number inside of your app to inform the user as well as help with bug reports among other reasons. In order to prevent you from having to update the version number in multiple places you can use AS3 to grab it from the application descriptor and update your text for your app on the fly, as it loads. Here is an example of how to do that:


		

Flex Builder Project

The post Displaying the version number in Adobe AIR appeared first on DanDev.com.

]]> http://www.dandev.com/2011/10/displaying-the-version-number-in-adobe-air/feed/ 0 Add a click event to a BitmapImage in Adobe Flex/AIR http://www.dandev.com/2011/10/add-a-click-event-to-a-bitmapimage-in-adobe-flexair/ http://www.dandev.com/2011/10/add-a-click-event-to-a-bitmapimage-in-adobe-flexair/#respond Wed, 05 Oct 2011 04:00:29 +0000 http://www.dandev.com/?p=215 You may have noticed MouseEvent.Click is not an event available to be set on the BitmapImage Spark primitive(in the current Flex SDK). But, there is a simple workaround for this. […]

The post Add a click event to a BitmapImage in Adobe Flex/AIR appeared first on DanDev.com.

]]>
You may have noticed MouseEvent.Click is not an event available to be set on the BitmapImage Spark primitive(in the current Flex SDK). But, there is a simple workaround for this. All you have to do is place it inside of a Graphic primitive wrapper. In MXML it would look like this:



	
	
		
	
	
		
	
	
	
		
			
		
	
	

Flex Builder Project

In AS3 it looks like this:



	
	
		
	
	
		
	
	
	
	
	

Flex Builder Project

The post Add a click event to a BitmapImage in Adobe Flex/AIR appeared first on DanDev.com.

]]>
http://www.dandev.com/2011/10/add-a-click-event-to-a-bitmapimage-in-adobe-flexair/feed/ 0
SSHD Error: buffer_get_ret: trying to get more bytes 4 than in buffer 0 http://www.dandev.com/2011/10/sshd-error-buffer_get_ret-trying-to-get-more-bytes-4-than-in-buffer-0/ http://www.dandev.com/2011/10/sshd-error-buffer_get_ret-trying-to-get-more-bytes-4-than-in-buffer-0/#comments Mon, 03 Oct 2011 01:18:44 +0000 http://www.dandev.com/?p=225 If you have run in to an error similar to this in your /var/log/secure log file: Oct 2 21:12:05 phptest sshd[31998]: error: buffer_get_ret: trying to get more bytes 4 than […]

The post SSHD Error: buffer_get_ret: trying to get more bytes 4 than in buffer 0 appeared first on DanDev.com.

]]>
If you have run in to an error similar to this in your /var/log/secure log file:

Oct  2 21:12:05 phptest sshd[31998]: error: buffer_get_ret: trying to get more bytes 4 than in buffer 0
Oct  2 21:12:05 phptest sshd[31998]: fatal: buffer_get_int: buffer error

Check your public key in ~/.ssh/authorized_keys or ~/.ssh/authorized_keys2 in a text editor and make sure each key is on one line. The prefix “ssh-rsa” followed by a space and then your key should all be on one line, and you might also have a comment after that describing the key. If your key spans multiple lines you will often get an error similar to the above message in your /var/log/secure log file.

You usually only see this when you’re trying to connect using key-based authentication. The error is caused by extra newlines in the authorized_keys list. When copying a public key out of PuttyGen(or similar key-generation software), because the key spans multiple lines, you can end up with extra newlines in the text when it gets copied to the clipboard.

The post SSHD Error: buffer_get_ret: trying to get more bytes 4 than in buffer 0 appeared first on DanDev.com.

]]>
http://www.dandev.com/2011/10/sshd-error-buffer_get_ret-trying-to-get-more-bytes-4-than-in-buffer-0/feed/ 1
VerifyError: Error #1014: Class IIMEClient could not be found. http://www.dandev.com/2010/07/verifyerror-error-1014-class-iimeclient-could-not-be-found/ http://www.dandev.com/2010/07/verifyerror-error-1014-class-iimeclient-could-not-be-found/#comments Mon, 12 Jul 2010 03:49:55 +0000 http://www.dandev.com/?p=189 If you have run across this error recently: VerifyError: Error #1014: Class IIMEClient could not be found. You may be wondering what it means, and more importantly how to fix […]

The post VerifyError: Error #1014: Class IIMEClient could not be found. appeared first on DanDev.com.

]]>
If you have run across this error recently: VerifyError: Error #1014: Class IIMEClient could not be found.

You may be wondering what it means, and more importantly how to fix it. What appears to be the sole cause of this error is your versions not matching up between your Flex/AIR SDK and the AIR application descriptor file. This can happen after you update/reinstall Flash Builder, or the SDK folder manually.

The fix is pretty easy: Just open your AIR descriptor file(generally the only XML file in the project src folder) and change the xmlns to the current version of the SDK you are using(1.5.3 => 2.0 for instance). See screenshot below for an example(warning: it’s big):

The post VerifyError: Error #1014: Class IIMEClient could not be found. appeared first on DanDev.com.

]]>
http://www.dandev.com/2010/07/verifyerror-error-1014-class-iimeclient-could-not-be-found/feed/ 13
Windows Installer has stopped working http://www.dandev.com/2010/07/windows-installer-has-stopped-working/ http://www.dandev.com/2010/07/windows-installer-has-stopped-working/#respond Tue, 06 Jul 2010 01:57:43 +0000 http://www.dandev.com/?p=184 If you have been unfortunate enough to run into this issue, here are a few things you can try to resolve it. These are for Windows 7 only – there […]

The post Windows Installer has stopped working appeared first on DanDev.com.

]]>
If you have been unfortunate enough to run into this issue, here are a few things you can try to resolve it. These are for Windows 7 only – there are already solutions available for older versions of Windows if you search. You need a physical copy of the DVD to do a manual restore of the files.

  1. (Re)start the Windows Installer service
    1. Right-click on Computer
    2. Click Manage
    3. Expand Services and Applications
    4. Select Services
    5. Scroll down to “Windows Installer”
    6. Right-click or double-click on it and make sure it is started and NOT disabled
  2. Run “sfc /scannow” from a command prompt as Administrator
    1. Should see something like: windows resource protection found some corrupt files but was unable to fix them
      1. Check the log to see if the problem is a corrupt file such as “msi.dll”
        1. Do this by searching for “cannot repair”
      2. If that is the case you can restore this file from the Windows DVD by:
        1. Insert the Windows DVD in the drive, cancel the autorun if it pops up
        2. Open 7-zip and browse to “install.wim” in the DVD:\Sources folder (open it)
        3. Inside you will find numbered folders corresponding to the windows version, open yours:

          1=Home Basic

          2=Home Premium

          3=Professional

          4=Ultimate

        4. Browse to the folder for the version you have installed, and you can copy/extract the file(s) you need. In my case I needed “msi.dll” in the #\Windows\System32 folder
        5. Note that if you are restoring a sensitive file such as this that you have to take ownership of the original file to rename/remove it before you can restore this file from the DVD, and ideally set the restored file back to the original owner and permission.
        6. Also note that the “msi.dll” file is owned by “TrustedInstaller”, so if you are getting a security error you need to take ownership of the file to replace it and then restore TrustedInstaller as the owner. If you can’t find it when you “check” the name use “NT SERVICE\TrustedInstaller”
  3. Restore an earlier restore point(not verified to work but try it..)
  4. Run the repair option from the installer DVD
  5. Reinstall Windows

Hope this helps someone. 🙂

The post Windows Installer has stopped working appeared first on DanDev.com.

]]>
http://www.dandev.com/2010/07/windows-installer-has-stopped-working/feed/ 0
Flex HDividedBox/VDividedBox divider double-click event oddity http://www.dandev.com/2009/12/hdividedbox/ http://www.dandev.com/2009/12/hdividedbox/#comments Wed, 02 Dec 2009 02:30:05 +0000 http://www.dandev.com/?p=171 I ran across an interesting case today while looking into an issue for someone else related to capturing the double-click event on the divider for a HDividedBox. It’s a little […]

The post Flex HDividedBox/VDividedBox divider double-click event oddity appeared first on DanDev.com.

]]>
I ran across an interesting case today while looking into an issue for someone else related to capturing the double-click event on the divider for a HDividedBox. It’s a little tricky to get the event to be captured by Flex. A quick search of the interwebs turned up nothing but people with the same issue. There is even an open bug in the Adobe Flex bug tracker(you have to login) that seems to be the exact issue, but there is no resolution named. Through some quick experimentation I figured out you can get it to work like so:



    
          
          		
          
          
          		
	      
     
     
          

The specific resolution was to enable liveDragging and add the event to the divider itself(most people try to set it on the doubleClick property of the DividerBox).

Hopefully this post will be helpful to some people out there with the same issue!

The post Flex HDividedBox/VDividedBox divider double-click event oddity appeared first on DanDev.com.

]]>
http://www.dandev.com/2009/12/hdividedbox/feed/ 7