How to list the total size of a directory with ls or du in LINUX CENTOS 5

tom on February 11th, 2009

simply issue du -sh

or ls -lah | grep “filename”

Post a comment | Comments Off

How to list the contents or files from a tar.gz file in LINUX CENTOS 5.2

tom on February 11th, 2009

I keep forgetting how to do this… so here goes:

tar -tvzf tarfile.tar.gz

non gzip file:

tar -tfv tarfile.tar

Post a comment | Comments Off

php 5.2.x with curl, GD as fastcgi

tom on February 7th, 2009

./configure –enable-fastcgi –enable-discard-path –enable-force-redirect –with-gd –with-jpeg-dir=/usr/local/lib –with-png-dir=/usr/local/lib –with-curl=/usr

for media server on php 5 under lighty

use yum install curl*

and further:

yum update lvm2 pcre yum libxml2 python pcre-devel rhnlib xorg libxml2-devel libxml2-python

just to be safe

then make
make install

Post a comment | Comments Off

Error 7 Handles clause requires a WithEvents variable defined in the containing type or one of its base types.

tom on January 24th, 2009

Visual basic . NET!

This occurs with some code as follows:

[code]
Private Sub button7_Click_1(ByVal sender As Object, ByVal e As EventArgs) Handles button7.Click
' do some stuff
End Sub
[/code]

instead you need to add a line above it, so completed it shall read as :

[code]
Public WithEvents button7 As Button
Private Sub button7_Click_1(ByVal sender As Object, ByVal e As EventArgs) Handles button7.Click
'do some stuff
End Sub
[/code]

Now remember if the end of the private sub says Handles cboStuff.SelectedIndexChange or some stuff, you need to declare the withevents as

Public WithEvents cboStuff as ComboBox

Hope it helps.

Post a comment | Comments Off

Installing PHP 5.2.x on FRESH HD.

tom on August 7th, 2008

When installing PHP 5.2 on a new server all you really need is libxml.

do this by issuing:

yum install libxml*

THen you’re ALL SET>

Post a comment | Comments Off

INstalling lighttpd 1.4.19 on FRESH BARE server

tom on June 15th, 2008

Iinstalling a fresh copy of lighttpd 1.4.19 (or latest) on a new freaking server (media server)> do the following to get it going:

wget http://www.lua.org/ftp/lua-5.1.3.tar.gz (install lua)
tar -zxvf lua*
cd lua*
yum install pcre-devel zlib-headers zlib-devel bzip2*

and some othe rshit but im too damn lazy….

Post a comment | Comments Off

Cannot find -lncurses

tom on June 15th, 2008

This error usually occurs when libncurses5-dev isn’t installed.

I installed it with

yum install ncurses*

which installed ncurses-devel from YUM

this was for LUA 5.1.3 for lighttpd and memcache…..

Weeeeeeeee

Post a comment | Comments Off

How to kill user’s SSH session

tom on August 17th, 2007

# ps aux | grep ssh

Will print something like:
root 1450 0.0 0.0 5432 620 pts/0 S+ 02:46 0:00 grep ssh
root 26528 0.0 0.0 5068 1016 Ss Jul28 0:00 /usr/sbin/sshd

With this you can execute the command

# kill -15 26528

This was the user session for root that I never closed because it timed out.. So this is what I did.

Post a comment | Comments Off

Tip On Installing GD library for PHP with YUM

tom on July 9th, 2007

This may seem extremely trivial for many people out there.. but all it takes is a forgetful server admin.

I had an old box that needed reloading, so I had to reinstall the GD library for php using YUM.

# yum install php-gd

Is all it takes to install gd for php. I’ve forgotten the php- part so I’ve tried installing gd-devel, gd-progs and other crap I didn’t need… it’s so simple sometimes.

Post a comment | Comments Off

mail loops back to me (MX problem?) Local configuration error

tom on July 3rd, 2007

Although this is a frequently asked question which has many answers, I thought it should be addressed.

If you are not receiving mail from your server, grep through all the log files in your /var/spool/mail mailboxes.

# grep “MX” root

for example will output if you have had any of these errors reported back to root. (This only applies if root is receiving the mail. replace root with another username).

The solution to this problem is configuring sendmail properly.

For (Sendmail version 8.11 and up):

1. Add the line server.yourdomain.com to /etc/mail/local-host-names
2. Send the Sendmail daemon SIGHUP termination signal:

#kill -HUP `head -1 /var/run/sendmail.pid`

If you use sendmail 8.11 or before you should upgrade, but here is the fix:
1. Add the line server.yourdomain.com to /etc/mail/sendmail.cw
2. Send the Sendmail daemon SIGHUP termination signal as before:

#kill -HUP `head -1 /var/run/sendmail.pid`

If this doesn’t work then make sure the use_cw_file option is on in your config.

Post a comment | Comments Off