Archive for category Troubleshooting

Improve Netbeans IDE Memory Usage

Netbeans is my IDE of choice but the resources it commands sometimes cause my machine to choke like the Cleveland Browns on any given Sunday.

Here is what I’ve done to improve the situation a bit:

Nutshell: edit the netbeans conf file to increase the amount of memory allocated and permitted

You’ll be editing the netbeans conf file which, on my Mac and under version 6.7, is located in /Applications/NetBeans/NetBeans\ 6.7.app/Contents/Resources/NetBeans/etc/netbeans.conf The way I handled this was to open the file, copy the chunk that handles configuration (so I have a backup of the original settings), comment the old settings out and then make my changes.

The original settings (notice the pound sign at the start indicating this is commented out):#netbeans_default_options="-J-Dcom.sun.mysql.startcommand=/usr/local/mysql/support-files/mysql-admin.server -J-Dcom.sun.mysql.stopcommand=/usr/local/mysql/support-files/mysql-admin.server -J-Dcom.sun.mysql.startargs=start -J-Dcom.sun.mysql.stopargs=stop -J-Dcom.sun.mysql.port=3306 -J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true"

My new settings:netbeans_default_options="-J-Dcom.sun.mysql.startcommand=/usr/local/mysql/support-files/mysql-admin.server -J-Dcom.sun.mysql.stopcommand=/usr/local/mysql/support-files/mysql-admin.server -J-Dcom.sun.mysql.startargs=start -J-Dcom.sun.mysql.stopargs=stop -J-Dcom.sun.mysql.port=3306 -J-client -J-Xss2m -J-Xms256m -J-Xmx512m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true"

Changes include:

Old New
not set -J-Xmx512m
-J-Xms32m -J-Xms256m

Some definitions… the -J-Xms setting defines the initial memory size, -J-Xmx defines the maximum.

You could set these numbers higher if you have more RAM but going too high can cause instability. One way to determine how much memory Netbeans is using is to turn on View->Toolbars->Memory. This will give you some feeback on how much you are actually using.

          

No Comments

Magento, MAMP and {{base_url}} Issues

A local install of Magento may give you a warning to change {{base_url}} for security purposes. I believe this only applies to production environments but it is annoying nonetheless. To solve this, within your Magento admin section, go to System-> Configurations and select the ‘Web’ tab (it’s over on the left under the configuration sidebar). Open the “Unsecure” and “Secure” sections and where you see {{base_url}} (this will be in the Base URL fields of each section… ignore any that say {{unsecure_base_url}} and the like, they don’t matter here) put in your actual base url.

In MAMP you may have something like: http://localhost:8888/magento/ (don’t forget that last slash). This will solve the issue.

          

1 Comment

Using Vault from the command line on OS X

These are directions for using SourceGear’s Vault version control from the command line on a Mac (OS X 10.5). You will need the Vault client installed (the client, not the server… you’ll be connecting to the server) as well as mono. I recommend using a package manager like MacPorts to handle mono (and any other unixy linuxy command line stuff you need to install). Oh, here is a useful link to the SourceGear support forums (well, kind of useful, Mac users are not exactly a priority as this app is really meant to be used with a Windows GUI client… oh, and don’t bother asking for a Mac GUI client. It ain’t happening).

The basic set of commands to use Vault from terminal on a Mac involve enough typing to wear your fingers out quick (note that I am using a very old version of the client software. This is because the server I am connecting to is old and won’t work with the latest versions of the client). Thus we will create aliases for everything. So the basic command to get into Vault is:
mono /usr/local/bin/VaultClientAPI_3_1_9/vault.exe -repository "My Repository"
Let’s alias that in .bash_login:
alias vault='mono /usr/local/bin/VaultClientAPI_3_1_9/vault.exe -repository "My Repository"'

Now we only have to type “vault”! In these following commands note the need to type backslash, dollar sign, forward slash ( \$/ ) before your repository project path. Weird but you gotta do it (I think that Vault expects $/ and that initial backslash is simply there to escape the dollar sign).

Get a project’s files:
vault get \$/projectname/
Checkout:
vault checkout \$/projectname/assets/css/main.css
Checkin:
vault checkin \$/projectname/assets/css/main.css
Checkin but no changes:
vault checkin -unchanged undocheckout \$/projectname/assets/css/main.css
Add a file and commit the add (all in one):
vault add -commit \$/projectname/assets/images/speakers/ /local/path/to/files/projectname/assets/images/speakers/schmitt.jpg
Rename and commit a file (all in one):
vault rename -commit \$/projectname/about/index.php index_2.php

Help! Vault is all $#^@%& up!

Sometimes errors will crop up. You may have commits that didn’t take or adds or other changes that did not go through for some reason. This will clutter your changeset (give it a look if you’ve been using Vault for a while… you may be surprised). You can view the changeset with:
vault listchangeset

To delete the changeset or to reset things when something goes wrong you can delete certain files. For example:
CacheMember_ChangeSetItems
CacheMember_CheckOutList

These are located on a path named something like:
/Users/yourusername/.config/SourceGear/Vault_1/Client/F8FB077F-8F3B-44B1-80B3-8BDC93CBC0F1/admin/

Great but it’s still too much typing, homes.

For further ease you can alias some of these commands. For example:
alias vci='vault checkin'
or
alias vciun='vault checkin -unchanged undocheckout'

So that the entire series of commands to checkin an file goes from:
mono /usr/local/bin/VaultClientAPI_3_1_9/vault.exe -repository "My Repository" checkin \$/projectname/index.php
to
vci \$/projectname/index.php
and for an unchanged checkin:
mono /usr/local/bin/VaultClientAPI_3_1_9/vault.exe -repository "My Repository" checkin -unchanged undocheckout \$/projectname/index.php
to
vciun \$/projectname/index.php

          

, ,

No Comments

Sample Configuration for mod_deflate

These conf settings will avoid compressing images (generally a bad thing) but will compress various text, xml, css and javascript files. This is better than minifying javascript because minified js must be decompressed by the client js and this is not as efficient as doing it with Apache’s mod_deflate. This goes in httpd.conf.
#
# Deflate conf
#
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no=gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

          

, ,

No Comments

Mail Box Full But Quota Not Met! Why?

Problem:

A client received the following message when trying to send email:

“ERROR:
ERROR: Could not append message to INBOX.Sent.
Server responded: [ALERT] You exceeded your mail quota.
Solution: Remove unnecessary messages from your folders. Start with your
Trash folder.”

and mailings to him resulted in:

—– The following addresses had permanent fatal errors —–
<sample@sample.com>

(reason: 550 Mailbox quota exceeded)

This person had a 20MB queue and only a handful of small messages with no attachments in their mailbox so obviously it wasn’t that their quota was exceeded. The problem was a file called maildirsize that was, for whatever reason, reporting the wrong quota.

Solution:

Delete the maildirsize file for that account.

  1. Login to your server via FTP
  2. Navigate to the following path /mail/yourdomain.com/userid
  3. Substitute yourdomain.com/userid with the correct email domain/user. (ex. /mail/widgets.com/bobforehead)
  4. From this directory, delete the file named maildirsize

Boo followed by Yah… problem solved!

          

, , , ,

No Comments