Operating Systems – DanDev.com http://www.dandev.com Tidbits about software development Mon, 14 Jul 2014 18:03:53 +0000 en-US hourly 1 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
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
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
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