Log MySQL requests/queries

edit /etc/mysql
$ sudo nano /etc/mysql/my.cnf

uncomment on line 72-73 general_log_file and general_log:

# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
general_log_file = /var/log/mysql/mysql.log
general_log = 1

restart mysql:
$ sudo /etc/init.d/mysql restart

view the log:
$ tail -f /var/log/mysql/mysql.log

Multiple Remote Virtual host and sub domains

Just by doing whats below the server will automatically recognize if its requesting baligena.com or felipe.baligena.com and navigate to the correct page. No additional configuration is necessary, everything to make subdomains and virtual host work is here.


$ sudo nano /etc/apache2/sites-available/baligena.com

    # domain: baligena.com
    # public: /var/www/mulsite/

    <virtualhost *:80>

      # Admin email, Server Name (domain name) and any aliases
      ServerAdmin webmaster@baligena.com
      ServerName  baligena.com
      ServerAlias www.baligena.com


      # Index file and Document Root (where the public files are located)
      DocumentRoot /var/www/mulsite/
    </virtualhost>

$ sudo a2ensite baligena.com
$ sudo service apache2 reload

Resource:
https://www.linode.com/wiki/index.php/Configure_apache_to_use_virtual_hosts_on_ubuntu_server


For subdomain:
configure you dns provider godaddy or namecheap.com
https://community.namecheap.com/forums/viewtopic.php?f=6&t=193

$ sudo nano /etc/apache2/sites-available/baligena.com

    # domain: felipe.baligena.com
    # public: /var/www/mulsite/

    <virtualhost *:80>

      # Admin email, Server Name (domain name) and any aliases
      ServerAdmin webmaster@baligena.com
      ServerName felipe.baligena.com
      ServerAlias www.felipe.baligena.com


      # Index file and Document Root (where the public files are located)
      DocumentRoot /var/www/mulsite
    </virtualhost>

$ sudo a2ensite baligena.com
$ sudo service apache2 reload


the default page should be /var/www/

tags:
sub domains

Sublime Text Plugin Creation

http://www.sublimetext.com/docs/2/
http://www.sublimetext.com/docs/2/api_reference.html
http://www.sublimetext.com/docs/plugin-basics
http://www.sublimetext.com/docs/api-reference
http://www.sublimetext.com/docs/api-reference#sublimeplugin.Plugin
http://www.sublimetext.com/docs/key-bindings

Laravel blade not compiling or showing in browser.

I was having an issue that when I saved a file using winscp to laravel4 the view in the browser would not change. I figured out that laravel view blades caches to app/storage/view and the way it knows whether to recompile it is by the dates the view blade file was changed and the cache file was created. In winscp the cache file was off by an hour ahead.

The way I fixed this was by changing winscp login environment settings to “Preserve Remote Timestamp”

and also adjusting my server time to match the actual time on my other computer.

The server time has to be an earlier time than your computer

Also this was a fix to the issue with sublimetext sftp package sync funcitonality.

Resources:
http://forums.laravel.io/viewtopic.php?id=2550

Change default editor Ubuntu

Changing the default editor from gedit to sublime text

1. Download Sublime Text

2. Make a symbolic link of the executable file
$ ln -s “/home/bigbang/Desktop/Sublime Text 2/sublime_text” /usr/bin/sublime_text

3. Make an executable file desktop file
$ sublime_text /usr/share/applications/sublime.desktop
Inside sublime.desktop:

[Desktop Entry]
Version=2.0.1
Name=Sublime Text 2
Encoding=UTF-8
Comment=Advanced Code and Text Editor
Exec=sublime_text %F
Icon=/home/bigbang/Desktop/Sublime Text 2/Icon/256×256/sublime_text.png
Terminal=false
Type=Application
Categories=Developer;

** you should have an executable file in the dash **

4.replace all occurrences of gedit.desktop with sublime.desktop.
$ sudo sublime_text /usr/share/applications/defaults.list

Resources:
http://sajan.io/618/setting-sublime-text-2-as-default-editor-in-ubuntu/
http://sajan.io/599/install-sublime-text-2-on-ubuntu-video/

Sublime Text 2 as Default Editor in Ubuntu 12.04


http://askubuntu.com/questions/162612/how-can-i-add-an-application-to-the-list-of-open-with-applications#answer-162656