Software Development in Linux/Unix

If you are interested in writing software for Linux, you will benefit from taking a look at the following URLs that I have hand-selected from the internet.  Like you,  I was not really satisfied to just running

/.configure
make
make install

I wanted to be one the guys writing my own software and RPMs and deploy them on a Linux Environment. So obviously there is a reason why came to this page so i just have to wish you  good luck and  happy programming.

Understanding make and make install
http://www.codecoffee.com/tipsforlinux/articles/27.html

Build your First RPM
http://www.ibm.com/developerworks/library/l-rpm1/

Software Development in the Unix Environment
http://users.ece.utexas.edu/~bevans/talks/software_development/

Cygwin (Tool that allows you to run shell like commands on windows)
http://www.cygwin.com/

Information About C++
http://www2.research.att.com/~bs/C++.html


Differences between printf, print, echo, sprintf,vprintf, vfprintf, vsprintf in PHP

WTF!!! Look  make no mistake about it,  I do like PHP but why do we have so many different ways to output strings. It is confusing especially nowadays when  a programmer is expecting to know more than one language.  As I move from one language to another i keep forgetting the nuances between all of them.

I wish they could just create just one construct and then we could just use flags to access specific functionalities.

So what are the differences between printf, print, echo, sprintf,vprintf, vfprintf and  vsprintf  in PHP?

According to php.net here are the  differences. At least they are all on one page for quick reference.

print :

  • Output a string onto the screen – Also “print” is not a real function so you are welcome to remove the parentheses.
  • Because this is a language construct and not a function, it cannot be called using variable functions
  • Always returns a 1

echo :

  • Output one or more strings
  • Also not a real function but a language construct
  • Does not returns anything so its cannot behave as a function.

printf :

  • Output a formatted string
  • Returns the length of the outputted string

sprintf:

  • Returns a formatted string
  • Returns a string produced according to the formatting string format

vprintf:

  • Returns a formatted string
  • Operates as printf() but accepts an array of arguments, rather than a variable number of arguments.
  • Display array values as a formatted string according to format

vsprintf:

  • Display array values as a formatted string according to format
  • Operates as sprintf() but accepts an array of arguments, rather than a variable number of argument

vfprintf :

  • Write a formatted string to a stream
  • Write a string produced according to format to the stream resource specified by handle
  • Returns the length of the outputted string

Reference: http://www.php.net/manual/en/ref.strings.php

Avoid SSH Timing Out

This one is really simple but it seems that i have to search for it every time. Note that keeping the connection alive is not really safe. Add these lines to your ssh_config

KeepAlive yes
ClientAliveInterval 120

Once you done you can comment the line out

#KeepAlive yes
#ClientAliveInterval 120

Installing phpMyAdmin securely on Centos, RedHat or Fedora

1. Make sure that you can access your server securely

https://yourserver.com

If you cannot access your server securely, let’s go and setup SSL on your server.

Again, I assume you are using a REDHAT based distribution.

  • Find if OpenSSL is running: “openssl version”
  • If OpenSSL is not running just install it with Yum : “yum install openssl”

Install a certificate by following the instructions in the following website:

(I wanted to write an article about SSL but this websites does a good job)

http://www.akadia.com/services/ssh_test_certificate.html

Your website should now be secure then it is time to install phpMyAdmin.


2. Unzip your phpMyAdmin to your virtual directory

Then browse to the virtual directory.

http://yourserver.com/phpmyadmin or wherever you put it.

Use the setup script to help you set up the config file;

http://yourserver.com/phpmyadmin/setup

Personally I do not like the setup script; I like to edit the config file manually.

When you done with the setup script, make sure you delete the “SETUP” folder.


3. We might also want to create a .htaccess file to force the db administrators to always access

phpMyAdmin securely.

Here is the content of the .htaccess files:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

4. Voila.


References:

http://www.phpmyadmin.net/documentation/Documentation.html#setup_script

http://www.akadia.com/services/ssh_test_certificate.html

http://www.cyberciti.biz/tips/howto-apache-force-https-secure-connections.html