Blog

I've been wanting to write for a while now about how business has been going for me, mainly because I see occasional articles on Hacker News about software earnings from independent developers (for example, Patrick McKenzie) but I don't really see the same type of writing over in the Joomlasphere from commercial extension developers (essentially, it's a bit of a mystery how much those companies actually make, though in some cases one can kind of estimate from their userbase and average product/subscription cost).

Background

Before I started selling any software commercially, I had quite a few entrepreneurial tests under my belt:

It's official! Joomlatools announced DOCman 2.0 Alpha 1's public release today!

While not quite ready for use on production sites just yet, it's available to start playing around with, and perhaps even more importantly, developing (so I can start working on a DOCman List for DOCman 2.0 pretty soon).

Here's a screenshot and link to the announcement:

joomlatools docman 2.0 alpha1 announcement

I've already spent a bit of time playing with the Alpha 1 this morning and just wanted to share a few impressions.

Read on to see how my first impressions of DOCman 2.0 went!

I know there are a lot of places where you can probably find the code below, but instead of having to look it up again the next time I have to use it, I thought it'd be handy to just add it here as a how-to item.

The code uses the primary admin account which comes default with Plesk, and uses a snippet to pull in the password automatically, then the database name is specified along with a filename for the exported database.

On newer Plesk versions it seems the phpMyAdmin importing is a lot more robust (larger file sizes and execution times) you can then take the exported file and import it using phpMyAdmin into a new Plesk server (if you're migrating from an older Plesk version as I was).

/usr/bin/mysqldump --user=admin --password=`/bin/cat /etc/psa/.psa.shadow` mydatabasename > myexportfile.sql

Well, I was a little surprised today when I learned that Joomla 2.5 does not allow for users to change their own usernames (I'm sure there's a valid reason for it, but at the same time I have a valid need to allow it). 

Since I've allowed my support system to automatically create accounts it does so in a way that adds a lot of random numbers to the end of the username it creates for a user. Now if I were in my user's shoes and I saw that, I'd most likely want to go in and edit my username right away to something I could actually remember (even though I've already added the option of users to be able to use their emails instead using Michael Richey's useful authentication plugin).

So, here's what you do if you want to enable your users to be able to change their username in Joomla 2.5:

  1. First, open up components/com_users/models/forms/profile.xml go to line 28 and change where it says:
    readonly="true"
    So that it says:
    readonly="false"
  2. Second, open up components/com_users/models/profile.php go to line 230 and comment out this line:
    unset($data['username']); 
    By adding two forward slashes to the beginning of that line:
    //unset($data['username']); 

Here are a few screenshots demonstrating the corrected files:

01 allow username changes in joomla
Step 1 - Change username readonly attribute to false

02 allow username changes in joomla
Step 2 - Comment out line which disables username changes

I was having some trouble the other day exporting a database that was about 40MB from Plesk's phpMyAdmin area and was getting a page could not be found error (though it appeared to work when only trying to export one table). This gave me the sense that it might be a memory issue for Plesk's PHP installation, and on searching I found a really good Parallels forum thread with exact instructions on what to modify. I found these instructions here: http://forum.parallels.com/showthread.php?t=81020

Open your plesk php.ini (my plesk php.ini located: /usr/local/psa/admin/conf/php.ini) 
Find memory_limit change to example: memory_limit = 256M 
Stop and start psa services: 
/etc/init.d/psa stopall
/etc/init.d/psa start

Adding the "-a" option to the ifconfig command will show all of the ethernet devices installed on the computer:

ifconfig -a

The ifconfig command allows you to a whole lot more to configure your network interfaces, for additional options you can always check the Linux manual from the command line or you can visit the ComputerHope article on the command.

I haven't had to use this one much since most of the time there is a GUI representation of this available, but it does help to find out how much hard drive space you are currently using.

df -k

Very simple usage of the "cp" command:

# copy and preserve modification date of a file:
cp -p filename /copy/to/directory

tar options (and their meanings):

# (extract archive contents)
-x
--extract

# (list archive contents)
-t
--list

# (make new tar archive)
-c
--create

# (specify name of archive file)
-f
--file

# (show the files being worked on as the tar is being performed)
-v
--verbose

find options:

# (for greater than n)
+n
# (for less than n)
-n
# (for exactly n)
n
# (last modified n minutes ago)
-mmin n
# (last modified n*24 hours ago)
-mtime n
# (pattern represents a filename string to look for, may also contain special regular expression characters)
-name pattern
# (replace c with a d, for directory or f, for a regular file)
-type c
# (allows you to execute commands on every file found by the find command, very useful. You can use the special token {} which represents the current filename)
-exec
# (tells the find command how many folder levels to recurse through, use a 1 to only pick up files from the current directory)
-maxdepth n

Examples of using the find command

# returns all files matching the pattern created in the last 14 days
find -name 'var1*' -mtime -14

# returns all files over 14 days old
find -name 'var1*' -mtime +14

# finds all files matching the pattern and then executes the rm -R command on the file
# the final \ is necessary when using the -exec option because it signifies the end of the command you are trying to execute
find -name '_vti_cnf' -type d -exec rm -R {} \;

How to gzip a tar file:

gzip filename.tar

How to decompress a gzip file back to a tar file:

gunzip filename.tar.gz

How to create a .tgz file from a set of folders:

tar -czvf filename.tgz /folder/to/backup

How to decompress a .tgz file:

tar -xzvf archive.tgz

How to extract files from a compressed tarball:

# extract to same directory
tar -xzf archive.tar.gz

# extract to a specific directory
tar -xzf archive.tar.gz -C /location/to/extract/to

How to list files in tar or compressed tar file

tar -tf archive.tar
tar -tzf archive.tar.gz

How to tell which versions of tar and gzip are installed on your machine:

tar --version

gzip -v