Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

ASCII Art in Terminal

I wanted some sort of ASCII art to be displayed everytime I open my good ol' urxvt. What I did is open up the file ~/.bashrc and added at the end of the file this snippet:


echo ""
echo " ##### "
echo " ####### "
echo " @ ##O#O## "
echo " ###### @@# #VVVVV# "
echo " ## # ## VVV ## "
echo " ## @@@ ### #### ### ### ##### ###### # ## "
echo " ## @ @# ### ## ## ## ### ## # ## "
echo " ## @ @# ## ## ## ## ### # ### "
echo " ## @@# ## ## ## ## ### QQ# ##Q "
echo " ## # @@# ## ## ## ## ## ## QQQQQQ# #QQQQQQ "
echo " ## ## @@# # ## ## ### ### ## ## QQQQQQQ# #QQQQQQQ "
echo " ############ ### #### #### #### ### ##### ###### QQQQQ#######QQQQQ "
echo ""

Screenshot:



Found the ASCII art here.

Update: I installed cowsay and replace the snippet above with this cowsay -f tux `fortune`.

Installing Xdebug (Ubuntu)

If you're not familiar with xdebug, here's a brief intro taken from the site:

The Xdebug extension helps you debugging your script by providing a lot of valuable debug information.
Execute this command in terminal:
sudo apt-get install php-dev php-pear && sudo pecl install xdebug

Then restart your web server: sudo /etc/init.d/apache2 restart (since I'm using Apache2)

Create a php file named phpinfo.php in the "Document Root" and add this line:

<?php
phpinfo();
?>

Update: For some reason I can't get it to work with vim yet. Huhu You can find the error message here. If you happen to know the solution, hope you can share it with me.

Anyways, according to the tutorial here, you need to download the vim script found in this link. After that extract the files to /.vim/plugin/. And to test it, open the php file in vim and press F5. Then quickly go to your browser and enter the URL path to your script with the suffix ?XDEBUG_SESSION_START=1. You can do this within only 5 seconds then it will "disconnect". And that's it.

Setup LAMP and PhpMyAdmin in Ubuntu

Here are the steps to setup LAMP in Ubuntu:

  1. Execute this command in terminal: sudo apt-get install apache2 php5 php5-gd mysql-server-5.0 phpmyadmin. During this operation, you'll be prompted to enter some information needed.
  2. Test if setup was successful by opening your browser and entering "http://localhost/".
  3. Execute in terminal: sudo vim /etc/apache2/apache.conf. At this point, you'll be editing a file using vim to configure Apache2 to work with phpMyAdmin.
  4. Add this line at the bottom of the file: Include /etc/phpmyadmin/apache.conf
  5. Restart apache by executing this command in terminal: sudo /etc/init.d/apache2 restart
  6. Open your browser and go to "http://localhost/phpmyadmin/"
  7. You might notice that there is an error message when you restart apache w/c says "Apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName". To remove this, execute the command: echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn. "man tee" if you need information on the command.
  8. Then try restarting Apache2 again. If all is good, proceed to the next step.
  9. The default location where web documents are stored would be on /var/www/ though the folder requires owner permission. What I did is configured Apache2 to look for the files in /home/[user]/public_html. To do this, copy /etc/apache2/sites-available/default to /etc/apache2/sites-available/[name_you_would_like] by executing the command: sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/[name_you_would_like].
  10. Edit the newly copied file: sudo vim /etc/apache2/sites-available/mine
  11. Change the DocumentRoot and Directory to /home/[user]/public_html/
  12. Disable the default configuration file and enable the new one: sudo a2dissite default && sudo a2ensite [name_of_new_configuration_file]
  13. Reload the new configuration: sudo /etc/init.d/apache2 reload
  14. Restart Apache2: sudo etc/init.d/apache2 restart
  15. Done.
Note: I'm not sure what commands "really" require to "sudo". But, basically, those are the commands I went through. ^_^

References:
Update: I just found out after installing wordpress that you need to do:
chmod -R a+w /home/[user]/public_html/

History of Commands Executed in Terminal (Ubuntu)

Do you wish to see the commands that you've invoked in the terminal. Try this command:
cat ~/.bash_history
If you're not familiar with the cat command. Try executing the command "man cat". It'll give you the information you need about cat.

Anyways, I just wanted to share this since I just knew this. Another reason would be to update this blog.

Cheers! And Happy New Year!!