Posts Tagged ‘linux’

Running Tomcat as a service on Linux

Running Tomcat as a service is as easy as getting jsvc to run and it’s all documented in … hmmm well anyways this is how I do it… Compiling JSVC [root ~]# cd $TOMCAT_HOME/bin && tar -zxf jsvc.tar.gz [root ~]# cd jsvc-src && chmod +x configure [root ~]# ./configure [root ~]# make Now there whould [...]

Continue reading »

where does the php.ini file go?

The Problem I needed to add more memory to php but by default php installed from source (configure && make && make install) does NOT install the php.ini file. So where is waldo? The Fix Here is a code snip that shows what configuration file IS loaded when php is executed: [root@mybox php-5.2.10]# php -r [...]

Continue reading »

mysql gem and mysql NOT from RPM

Have you ever seen this: >> require ‘mysql’LoadError: libmysqlclient.so.15: cannot open shared object file: No such file or directory – /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.so from /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.so from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require’ from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’ from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in’ from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’ from (irb):2 I found this happens when your environment for mysql is not setup correctly. The fix is easy. All [...]

Continue reading »

Using awk to sum all entries in one column

Had to search this one for a while… here is the source file: 360109368 15004557 java.lang.String 310090432 7692644 char[] 179389488 7474562 java.util.HashMap$Entry 71350968 70689 java.util.HashMap$Entry[] 14298360 109019 * ConstMethodKlass 7853616 109019 * MethodKlass 7409816 119136 java.lang.Object[] 7302080 17556 int[] 7094864 11288 byte[] I wanted the sum of all the numbers in the first column and [...]

Continue reading »

Mysql driver for rails

When installing the mysql gem you might get this: Building native extensions.  This could take a while… ERROR:  Error installing mysql: ERROR: Failed to build gem native extension. the fix is easy but you are going to need the mysql-devel package if you are on redhat then do this: yum install mysql-devel Now you can [...]

Continue reading »

Working with Linux LVM

Growing your lvm partition. Find free space: lvm vgs (VFree is amount of free space) Find the the logical volum: lvdisplay (LV Name is what you want) Extend the drive (Add 50GB to current size) :  lvextend –size +50G /dev/drive unmount the drive (If drive is busy use lsof | grep /mountpoint to find the [...]

Continue reading »

Deploying with capistrano to servers behind a firewall

First lets install the rsync_with_remote_cache gem: Check-out from source svn co http://svn.extendviget.com/lab/trunk/gems/capistrano_rsync_with_remote_cache Add patch so we will deploy to all roles not just the :app role(this will ensure that migration will work) vi lib/capistrano/recipes/deploy/strategy/rsync_with_remote_cache.rb change this: # Step 2: Update the remote cache. logger.trace “copying local cache to remote” find_servers(:roles => :app, :except => { [...]

Continue reading »

How to change the timestamp of a file

I ran in to this problem when moving log files around that the timestamp on some of the files changed. And just for consistence I wanted to change the timestamp of these files.. I found that you can specify the data using the touch command, like this: [heimdull@hostname ~]# touch -t 200709280930 httpd.conf [heimdull@hostname ~]# [...]

Continue reading »

Follow

Get every new post delivered to your Inbox.