Tampilkan postingan dengan label Linux Command. Tampilkan semua postingan
Tampilkan postingan dengan label Linux Command. Tampilkan semua postingan

Find files/dirs recursively and do something

The following will find all files in the current directory and all of current subdirectories matching .git* and delete them:

sudo find ./ -type f -name '.git*' -exec rm  {} \;

The following will find all directories named .git in the current dir and subdirs and delete them:

sudo find ./ -type f -name .git -exec rm  {} \;

Notice how you escape the asterisk by including it within a pair of single quotes.

Manually install oSIP and eXosip as library on Mac OS X Mountain Lion

No problem with oSIP. Just do the usual configure && make && make install (the last one as root).

It is best to have the autotool from GNU, and not from Apple, of which autoconf and make are part. To install GNU autotool, please ryou need to install XCode (and the Command Line Tools: XCode -> Preferences -> Download -> Component -> Command Line Tools) and mac ports first (www.macports.org) and then:


Once xcode and macports are installed, open a terminal and install the required build-time tools with:

$ sudo port install coreutils automake autoconf libtool intltool wget pkgconfig cmake gmake yasm grep doxygen ImageMagick optipng


Install gas-preprosessor.pl (http://github.com/yuvi/gas-preprocessor/ ) to be copied into /opt/local/bin :

$ wget --no-check-certificate https://raw.github.com/yuvi/gas-preprocessor/master/gas-preprocessor.pl
$ sudo mv gas-preprocessor.pl /opt/local/bin/.
$ sudo chmod +x /opt/local/bin/gas-preprocessor.pl

Link macport libtoolize to glibtoolize

$ sudo ln -s /opt/local/bin/glibtoolize /opt/local/bin/libtoolize

Link host's strings to simulator SDK

For Xcode prior to 4.3:
$ sudo ln -s /usr/bin/strings /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/strings
For newer XCode:
$ sudo ln -s /usr/bin/strings /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/strings


The above lines are from the README of the linphone. Basically you want to install the autotools, but I don't actually know which part of those packages comprise autotools. Some of them are obviously not related to autotools, like the ImageMagick. But just to be safe.... :-))

So, after you install the autotool, the next thing to do is.... trying to configure. It went well for oSIP but not so well for eXosip. configure script for eXosip gave me this:


Undefined symbols for architecture x86_64:
  "_CFRelease", referenced from:
      __tls_add_certificates in eXtl_tls.o
  "_Gestalt", referenced from:
      __tls_add_certificates in eXtl_tls.o
  "_SecKeychainItemCopyAttributesAndData", referenced from:
      __tls_add_certificates in eXtl_tls.o
  "_SecKeychainItemFreeAttributesAndData", referenced from:
      __tls_add_certificates in eXtl_tls.o
  "_SecKeychainOpen", referenced from:
      __tls_add_certificates in eXtl_tls.o
  "_SecKeychainSearchCopyNext", referenced from:
      __tls_add_certificates in eXtl_tls.o
  "_SecKeychainSearchCreateFromAttributes", referenced from:
      __tls_add_certificates in eXtl_tls.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [libeXosip2.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

After some searching, I found out that I needed to link against frameworks on Mac OS. So instead of simply calling configure, I needed to call this:

LDFLAGS="-framework CoreFoundation -framework CoreServices -framework Security" ./configure

And then make, and sudo make install. And done!

CoreFoundation is for _CFRelease, CoreServices is for _Gestalt and Security for the others (keychain access).

Converting CHM file to html and pdf

From http://www.ubuntugeek.com/how-to-convert-chm-files-to-html-or-pdf-files.html


Microsoft Compiled HTML Help is a proprietary format for online help files, developed by Microsoft and first released in 1997 as a successor to the Microsoft WinHelp format. It was first introduced with the release of Windows 98, and is still supported and distributed through Windows XP platforms.
HTML Help files are made with help authoring tools. Microsoft ships the HTML Help Workshop with supported versions of Microsoft Windows and makes the tool available for free download. There are also a lot of third-party help authoring tools available.
CHM files, known as Microsoft Compressed HTML Help files, are a common format for eBooks and online documentation. They are basically a collection of HTML files stored in a compressed archive with the added benefit of an index.
Under Linux, you can view a CHM file with the xchm viewer. But sometimes that’s not enough. Suppose you want to edit, republish, or convert the CHM file into another format such as the Plucker eBook format for viewing on your Palm. To do so, you first need to extract the original HTML files from the CHM archive.
This can be done with the CHMLIB (CHM library) and its included helper application extract_chmLib.
Install Chmlib in Ubuntu
sudo apt-get install libchm-bin
Convert .chm files in to HTML files
If you want to convert .chm files in to HTML files use the following command
extract_chmLib book.chm outdir
where book.chm is the path to your CHM file and outdir is a new directory that will be created to contain the HTML extracted from the CHM file.
Convert .chm files in to PDF files
First you need to install htmldoc. HTML processor that generates indexed HTML, PS, and PDF.HTMLDOC is a program for writing documentation in HTML and producing indexed HTML, PostScript, or PDF output (with tables of contents). It supports most HTML 3.2 and some HTML 4.0 syntax, as well as GIF, JPEG, and PNG images.
sudo apt-get install htmldoc
If you want to use htmldoc type the following command in terminal
htmldoc

Enabling webDAV in Apache running on Ubuntu

I found the following tutorial on: http://www.howtoforge.com/how-to-set-up-webdav-with-apache2-on-ubuntu-8.10

How To Set Up WebDAV With Apache2 On Ubuntu 8.10
Version 1.0
Author: Falko Timme
Last edited 01/20/2009

This guide explains how to set up WebDAV with Apache2 on an Ubuntu 8.10 server. WebDAV stands for Web-based Distributed Authoring and Versioning and is a set of extensions to the HTTP protocol that allow users to directly edit files on the Apache server so that they do not need to be downloaded/uploaded via FTP. Of course, WebDAV can also be used to upload and download files.

I do not issue any guarantee that this will work for you!



1 Preliminary Note
I'm using an Ubuntu 8.10 server with the IP address 192.168.0.100 here.

Because we must run all the steps from this tutorial with root privileges, we can either prepend all commands in this tutorial with the string sudo, or we become root right now by typing

sudo su



2 Installing WebDAV
If Apache is not already installed, install it as follows:

apt-get install apache2

Afterwards, enable the WebDAV modules:

a2enmod dav_fs
a2enmod dav

Restart Apache:

/etc/init.d/apache2 restart



3 Creating A Virtual Host
I will now create a default Apache vhost in the directory /var/www/web1/web. For this purpose, I will modify the default Apache vhost configuration in /etc/apache2/sites-available/default. If you already have a vhost for which you'd like to enable WebDAV, you must adjust this tutorial to your situation.

First, we create the directory /var/www/web1/web and make the Apache user (www-data) the owner of that directory:

mkdir -p /var/www/web1/web
chown www-data /var/www/web1/web

Then we back up the default Apache vhost configuration (/etc/apache2/sites-available/default) and create our own one:

mv /etc/apache2/sites-available/default /etc/apache2/sites-available/default_orig
vi /etc/apache2/sites-available/default

NameVirtualHost *

ServerAdmin webmaster@localhost

DocumentRoot /var/www/web1/web/

Options Indexes MultiViews
AllowOverride None
Order allow,deny
allow from all



Then reload Apache:

/etc/init.d/apache2 reload



4 Configure The Virtual Host For WebDAV
Now we create the WebDAV password file /var/www/web1/passwd.dav with the user test (the -c switch creates the file if it does not exist):




htpasswd -c /var/www/web1/passwd.dav test

You will be asked to type in a password for the user test.

(Please don't use the -c switch if /var/www/web1/passwd.dav is already existing because this will recreate the file from scratch, meaning you lose all users in that file!)

Now we change the permissions of the /var/www/web1/passwd.dav file so that only root and the members of the www-data group can access it:

chown root:www-data /var/www/web1/passwd.dav
chmod 640 /var/www/web1/passwd.dav

Now we modify our vhost in /etc/apache2/sites-available/default and add the following lines to it:

vi /etc/apache2/sites-available/default

[...]
Alias /webdav /var/www/web1/web


DAV On
AuthType Basic
AuthName "webdav"
AuthUserFile /var/www/web1/passwd.dav
Require valid-user

[...]
The Alias directive makes (together with ) that when you call /webdav, WebDAV is invoked, but you can still access the whole document root of the vhost. All other URLs of that vhost are still "normal" HTTP.

The final vhost should look like this:

NameVirtualHost *

ServerAdmin webmaster@localhost

DocumentRoot /var/www/web1/web/

Options Indexes MultiViews
AllowOverride None
Order allow,deny
allow from all


Alias /webdav /var/www/web1/web


DAV On
AuthType Basic
AuthName "webdav"
AuthUserFile /var/www/web1/passwd.dav
Require valid-user


Reload Apache afterwards:

/etc/init.d/apache2 reload



5 Testing WebDAV
We will now install cadaver, a command-line WebDAV client:

apt-get install cadaver

To test if WebDAV works, type:

cadaver http://localhost/webdav/

You should be prompted for a user name. Type in test and then the password for the user test. If all goes well, you should be granted access which means WebDAV is working ok. Type quit to leave the WebDAV shell:

root@server1:~# cadaver http://localhost/webdav/
Authentication required for webdav on server `localhost':
Username: test
Password:
dav:/webdav/> quit
Connection to `localhost' closed.
root@server1:~#

Disabling annoying popup notification on Gnome Ubuntu

So I'm on Ubuntu and I use Pidgin and Tweetdeck. Everytime someone sends a chat message to me, or someone I follow tweets, a black notification message pops up on upper right corner of my screen, showing what who they are and what they say. And because I follow almost 500 people on Twitter, this notification pops up very frequently and becomes annoying distraction. I needed to rid them.

This is what I did, which worked for me:
sudo apt-get -y remove notification-daemon
sudo apt-get -y remove notify-osd pidgin-libnotify

Source: http://www.uluga.ubuntuforums.org/showthread.php?t=1360080

Turning rpm package into deb package.

So recently I had to install Libre Office on my Ubuntu machine but it came only in rpm package. The "dpkg -i *.deb" only works for deb packages, not rpm. So I needed a way to convert these rpm packages into deb. The utility to do that is called "alien".

Run the following to install alien and the necessary packages:
sudo apt-get install alien dpkg-dev debhelper build-essential

To convert a package from rpm to debian format, use this command syntax. The sudo may not be necessary, but we’ll include it just in case.
sudo alien packagename.rpm

To install the package, you’ll use the dpkg utility, which is the internal package management tool behind debian and Ubuntu.
sudo dpkg -i packagename.deb

Enabling SSL on Ubuntu and the problem thereafter.

Recently I had to test our product on secured site, so I tried to install SSL on localhost. The config file for SSL site has been installed in /etc/apache2/sites-available. So I simply had to enable it and modify it. I first issued this to enable the SSL module:

sudo a2enmod ssl

And then I enabled the SSL config by:

sudo a2ensite default-ssl

After the above command is issued, a symlink to /etc/apache2/sites-available/default-ssl will be created and called /etc/apache2/sites-enabled/default-ssl. I edited it and uncommented the following lines:

SSLEngine on

SSLCertificateFile /home/ISA.REALOBJECTS/firman/Documents/ssl/linuxdev8.nc.crt
SSLCertificateKeyFile /home/ISA.REALOBJECTS/firman/Documents/ssl/linuxdev8.nc.key

The certificate (.crt file) and the key (.key file)  are snakeoil, so to say, I created them using OpenSSL. The commands I used to create them are the following:

openssl genrsa -des3 -out linuxdev8.nc.key 1024
openssl req -new -key linuxdev8.nc.key -x509 -out linuxdev8.nc.crt

After that, I restarted Apache, at which point I was asked to input the key phrase:

sudo /etc/init.d/apache2 restart

And lo and behold, I can now connect to http://127.0.0.1 and https://127.0.0.1

The problem happens after Ubuntu is restarted. Apache refuses to start, and throws up the following error message instead:

Starting httpd: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs!

I googled for 3 days and tried all of the solutions I found, but my problem persisted. I have no clue what went wrong! I'm not a wizard when it comes to Apache directives but I guess there's something wrong somewhere in the config file. What I found to be a pseudo-solution was this:

Before restarting Ubuntu, disable the SSL site first by issuing this:

sudo a2dissite default-ssl

And then proceed to restarting Ubuntu. After computer is restarted, re-enable the SSL site and restart Apache:

sudo a2ensite default-ssl
sudo /etc/init.d/apache2 restart

That's it :)

BTW in case you wanna know my config files, the following are my /etc/apache2/ports.conf, /etc/apache2/sites-available/default, and /etc/apache2/sites-available/default-ssl, in that order:


NameVirtualHost *:80
Listen 80


    # SSL name based virtual hosts are not yet supported, therefore no
    # NameVirtualHost statement here
    Listen 443




ServerAdmin webmaster@localhost

DocumentRoot /var/www

Options FollowSymLinks
AllowOverride None


Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all


ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all


ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
  






ServerAdmin webmaster@localhost

DocumentRoot /var/www

Options FollowSymLinks
AllowOverride None


Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all


ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all


ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/ssl_access.log combined

Alias /doc/ "/usr/share/doc/"

Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128


#   SSL Engine Switch:
#   Enable/Disable SSL for this virtual host.
SSLEngine on

#   A self-signed (snakeoil) certificate can be created by installing
#   the ssl-cert package. See
#   /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
#   If both key and certificate are stored in the same file, only the
#   SSLCertificateFile directive is needed.
SSLCertificateFile    /home/ISA.REALOBJECTS/firman/Documents/ssl/linuxdev8.isa.nc.crt
SSLCertificateKeyFile /home/ISA.REALOBJECTS/firman/Documents/ssl/linuxdev8.isa.nc.key

#   Server Certificate Chain:
#   Point SSLCertificateChainFile at a file containing the
#   concatenation of PEM encoded CA certificates which form the
#   certificate chain for the server certificate. Alternatively
#   the referenced file can be the same as SSLCertificateFile
#   when the CA certificates are directly appended to the server
#   certificate for convinience.
#SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt

#   Certificate Authority (CA):
#   Set the CA certificate verification path where to find CA
#   certificates for client authentication or alternatively one
#   huge file containing all of them (file must be PEM encoded)
#   Note: Inside SSLCACertificatePath you need hash symlinks
#         to point to the certificate files. Use the provided
#         Makefile to update the hash symlinks after changes.
#SSLCACertificatePath /etc/ssl/certs/
#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt

#   Certificate Revocation Lists (CRL):
#   Set the CA revocation path where to find CA CRLs for client
#   authentication or alternatively one huge file containing all
#   of them (file must be PEM encoded)
#   Note: Inside SSLCARevocationPath you need hash symlinks
#         to point to the certificate files. Use the provided
#         Makefile to update the hash symlinks after changes.
#SSLCARevocationPath /etc/apache2/ssl.crl/
#SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl

#   Client Authentication (Type):
#   Client certificate verification type and depth.  Types are
#   none, optional, require and optional_no_ca.  Depth is a
#   number which specifies how deeply to verify the certificate
#   issuer chain before deciding the certificate is not valid.
#SSLVerifyClient require
#SSLVerifyDepth  10

#   Access Control:
#   With SSLRequire you can do per-directory access control based
#   on arbitrary complex boolean expressions containing server
#   variable checks and other lookup directives.  The syntax is a
#   mixture between C and Perl.  See the mod_ssl documentation
#   for more details.
#
#SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
#            and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
#            and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
#            and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
#            and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20       ) \
#           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
#

#   SSL Engine Options:
#   Set various options for the SSL engine.
#   o FakeBasicAuth:
#     Translate the client X.509 into a Basic Authorisation.  This means that
#     the standard Auth/DBMAuth methods can be used for access control.  The
#     user name is the `one line' version of the client's X.509 certificate.
#     Note that no password is obtained from the user. Every entry in the user
#     file needs this password: `xxj31ZMTZzkVA'.
#   o ExportCertData:
#     This exports two additional environment variables: SSL_CLIENT_CERT and
#     SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
#     server (always existing) and the client (only existing when client
#     authentication is used). This can be used to import the certificates
#     into CGI scripts.
#   o StdEnvVars:
#     This exports the standard SSL/TLS related `SSL_*' environment variables.
#     Per default this exportation is switched off for performance reasons,
#     because the extraction step is an expensive operation and is usually
#     useless for serving static content. So one usually enables the
#     exportation for CGI and SSI requests only.
#   o StrictRequire:
#     This denies access when "SSLRequireSSL" or "SSLRequire" applied even
#     under a "Satisfy any" situation, i.e. when it applies access is denied
#     and no other module can change it.
#   o OptRenegotiate:
#     This enables optimized SSL connection renegotiation handling when SSL
#     directives are used in per-directory context.
#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire

SSLOptions +StdEnvVars


SSLOptions +StdEnvVars


#   SSL Protocol Adjustments:
#   The safe and default but still SSL/TLS standard compliant shutdown
#   approach is that mod_ssl sends the close notify alert but doesn't wait for
#   the close notify alert from client. When you need a different shutdown
#   approach you can use one of the following variables:
#   o ssl-unclean-shutdown:
#     This forces an unclean shutdown when the connection is closed, i.e. no
#     SSL close notify alert is send or allowed to received.  This violates
#     the SSL/TLS standard but is needed for some brain-dead browsers. Use
#     this when you receive I/O errors because of the standard approach where
#     mod_ssl sends the close notify alert.
#   o ssl-accurate-shutdown:
#     This forces an accurate shutdown when the connection is closed, i.e. a
#     SSL close notify alert is send and mod_ssl waits for the close notify
#     alert of the client. This is 100% SSL/TLS standard compliant, but in
#     practice often causes hanging connections with brain-dead browsers. Use
#     this only for browsers where you know that their SSL implementation
#     works correctly.
#   Notice: Most problems of broken clients are also related to the HTTP
#   keep-alive facility, so you usually additionally want to disable
#   keep-alive for those clients, too. Use variable "nokeepalive" for this.
#   Similarly, one has to force some clients to use HTTP/1.0 to workaround
#   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
#   "force-response-1.0" for this.
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0

Ubuntu stucks at "Starting Winbind daemon"

My Ubuntu hanged. I restarted it. But it got stuck at  "Starting Winbind daemon" point. I restarted it again. It stuck there again. I randomly pressed keys, and what got it moving was the classics Ctrl+Alt+Del. It did not restart Ubuntu. On the contrary, it helped Ubuntu pass the "Starting Winbind daemon" point and proceed normally into the login prompt. By the way, I'm using the Jaunty Jackalope.

Installing LAMP afresh, Enabling mod_rewrite, .htaccess

Somehow I screwed my PHP installation in Ubuntu so when I ran code to access mysql database through PHP, it spewed trash back to me. I then decided to start from a clean slate so I did this.

sudo apt-get --purge remove apache2 apache2-mpm-prefork apache2-utils apache2.2-common libapache2-mod-php5 libapr1 libaprutil1 libdbd-mysql-perl libdbi-perl libmysqlclient15off libnet-daemon-perl libplrpc-perl libpq5 mysql-client-5.0 mysql-common mysql-server mysql-server-5.0 php5-common php5-mysql

That will remove the whole LAMP stack. The keyword here is purge. There is a big difference between simply apt-get remove and apt-get --purge remove. The first will not delete any config file, so the next time you install the same package, the old config file will be used. The latter deletes everything. Just watch closely the console when you issue that command because sometimes it will give warning that says that it can not delete certain directories because they are not empty. In that case, you need to manually delete those directories.

After that, you need to reinstall apache php and mysql by issuing the following commands, in the given order:

sudo apt-get update

This updates your Ubuntu with current package information so when we type the next commands, it gets the most recent data.

sudo apt-get install php5 apache2 libapache2-mod-php5 mysql-server


sudo apt-get install php5-mysql

sudo apt-get install phpmyadmin

I did all that. And then I start my apache, I went into directory in which I have my CI installation. At this point, my DocumentRoot is pointing to /var/www while my CI installation is in /var/www/ci.

All went fine so far. Apache worked well. I then entered a dir in which I had PHP files. PHP files were downloaded by my Chrome browser, instead of being translated by Apache. So enable it:

sudo a2enmod php5

Try opening the PHP file again. Still fail! Then I opened Firefox and tried it again, and it worked. It seemes that Chrome cached this somehow.

All went fine. And then, I copied  a .htaccess file into the /var/www/ci directory. Bust, apache returned 500 internal server error! The fix: enabling mod rewrite by issuing this in command line:

a2enmod rewrite

And then see that you have mod_rewrite enabled when you run phpinfo(). But then, after I enabled the mod_rewrite, the server spat another error. This time it was 404 not found. I got it fixed by setting the DocumentRoot to /var/www/ci.

This is my .htaccess file:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

I wondered what was going on so I went online and talked with a guy in #linux at dal.net. Here's the conversation:

(06:33:56 PM) arekmalang: Hi all
(06:34:31 PM) arekmalang: I have enabled the rewrite module in apache, but why does it fail when I have .htaccess file in a directory?
(06:35:44 PM) boredboy: ubuntu82: what happens? a 500 error returned, incorrect rules followed, etc etc. Need more info to help you out
(06:36:22 PM) arekmalang: 500 internal server error returned
(06:36:37 PM) arekmalang: oh wait
(06:36:52 PM) arekmalang: that was before i enabled the mod rewrite
(06:37:22 PM) arekmalang: after i enabled it, it returned 404 not found
(06:37:54 PM) arekmalang: if i remove the .htaccess file, then everything goes back to normal
(06:38:05 PM) boredboy: pastebin your .htaccess file
(06:38:11 PM) arekmalang: ok
(06:39:14 PM) arekmalang: here it is: http://linux.pastey.net/137178
(06:39:56 PM) arekmalang: It's a short .htaccess file in Code Igniter tutorial...
(06:41:06 PM) boredboy: so you're getting a 404?
(06:41:09 PM) arekmalang: yes
(06:41:25 PM) boredboy: I assume you have an index.php file?
(06:41:46 PM) arekmalang: yes
(06:41:50 PM) arekmalang: i do
(06:42:03 PM) arekmalang: It says it can't find the index.php
(06:42:32 PM) Tdot__ [~chatzilla@dsl-209-183-27-78.static.tor.primus.ca] entered the room.
(06:43:01 PM) arekmalang: Ha!
(06:43:03 PM) arekmalang: Solved!
(06:43:42 PM) ***boredboy goes back to sleep
(06:43:43 PM) arekmalang: The document root in apache config file needs to be set to the directory where the index.php resides...
(06:43:52 PM) arekmalang: But why so?
(06:44:05 PM) arekmalang: boredboy...
(06:44:10 PM) arekmalang: wake up :)
(06:44:14 PM) arekmalang: enlighten me
(06:46:08 PM) boredboy: huh? which bit don't you get? Your rewrite rule says that if it doesn't start with index.php, images or robots.txt rewrite everything to /index.php/$i
(06:46:24 PM) boredboy: er, $1 not $i
(06:46:40 PM) arekmalang: What I don't get is why I need to set the DocumentRoot to /var/www/ci to make it to work
(06:46:50 PM) arekmalang: Previously DocumentRoot was /var/www
(06:47:07 PM) arekmalang: the .htaccess and index.php are in /var/www/ci
(06:47:47 PM) boredboy: so to hit index.php you had to do http://mysite.com/ci/index.php ?
(06:48:18 PM) arekmalang: that is when docroot set to /var/www and without .htaccess
(06:48:35 PM) boredboy: you can try either one of these
(06:48:48 PM) arekmalang: now, to get to index php i have to go to http://localhost/ only
(06:49:10 PM) boredboy: change your rewrite to RewriteRule ^(.*)$ /ci/index.php/$1 [L]
(06:49:27 PM) boredboy: or RewriteRule ^(.*)$ index.php/$1 [L]
(06:49:38 PM) Tdot_ left the room (quit: Read error: Operation timed out).
(06:49:49 PM) boredboy: if you have the preceeding / you will always try get the index.php in your doc root
(06:50:03 PM) _null is now known as null
(06:50:33 PM) arekmalang: Ahhhh that's it
(06:50:40 PM) arekmalang: Thanks a lot, master!
(06:51:17 PM) boredboy: no problem....., back to sleep

So.... the problem lies in my .htaccess file :) Thanks, boredboy. Well, yeah, that's my adventure for the day :))

Find file with certain title, make bash re-read the .bashrc

Make bash re-read the config file .bashrc, type the following:

. .bashrc


Note the space between the dots.

Find file with certain title:

find / -name "filename" -print

Uploading files from local linux machine to remote linux server.

So recently I become serious with learning web development. PHP and MySQL. I bought a shared hosting plan. Tinkered with it a bit. Got myself familiar with how it worked. Then I came across one problem. I needed a way to upload files from my Ubuntu machine to my hosting server which ran linux too. The GUI provided by the hosting company only acommodates 2 files to be transfered simultaneously. It would be too cumbersome to upload many files that way.
So I googled around and I found this website. It turned out that the command to do that is scp. I copy the command below:
scp file-to-send user@host:/path/to/place/file
Very easy. I also learnt something about ssh. To connect to my shared hosting using ssh, I would do the following:
ssh user@mydomain.com
And then I will be prompted for my password. Well, that's something new for me :D

Enabling Ant, Searching for file containing certain text in Linux, Eclipse fails to run after crashing

I was importing project into Eclipse when I saw that there was no ant icon on .xml file. When I right click the build.xml, there was no option to run it as ant build. The solution is simple: just install Java EE Developer Tools Component.

I often need to search for files containing certain text in Linux. The following command does the magic:
grep -lir 'the text to be found' ./
I installed Eclipse PDT (Eclipse for PHP projects) and I tried to open a file with embedded applet. Eclipse crashed right away. After the crash, there was no way for me to start Eclipse again. After some searches, I stumbled upon this blog. I deleted the content of the .settings directory as explained in the blog, but Eclipse still failed to start. Then  Jason told me to remove user properties files. They could be found on the directory .metadata. This directory itself was located in the workspace directory. After I did that, Eclipse started, but I lost all of my workbench configurations and I had to redo all of the config. But it was better than not having Eclipse start at all. At least I learnt something new.