Friday, September 16, 2011
Twig syntax highlighting plugin for Netbeans 7
PHP Twig (that you can download from here) have some little bugs with the validator (like showing 'unexpected block endings', but still works really well.
Besides that this is the first time i had to install an extra plugin for netbeans and i should say it is not intuitive at all. After downloading the *.nbm file i had to google to find out how to install it and the only way to do it is to open the Plugins window --> then Drag the file over it.
I know, there's probably be a better way... i just couldn't find it, so if you know how to do it let me know :)
Thursday, August 25, 2011
Install Ruby on Rails 3 on Debian 6 (Squeeze) using RVM
Also, because Debian version is (of course) outdated and besides that i ran into a lot of problems while i was trying to install it using the packages... Yeah, gotta love Debian <stable>. Errors like:
- File not found: lib.
- Execjs: Could not find a JavaScript runtime
- And so on...
apt-get install curl git-core
apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
And this one if you plan to use Mysql on your project:
apt-get install libmysqlclient-dev
bash < <(curl -sk https://rvm.beginrescueend.com/install/rvm)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
// Checks if rvm is installed correctly (it MUST return 'rvm is a function')At this point if everything went OK you are good to go, still I recommend ya to run a simple app to make sure:
$> type rvm | head -1
// Install Ruby and make sure it works
$> rvm install 1.9.2
$> rvm use 1.9.2
$> ruby -v
// Create a new gemset and install Rails
$> rvm gemset create rails305
$> gem install rails -v 3.0.5
// SQlite database extension
$> gem install sqlite3
// MySQl database extension
$> gem install mysql2
rails new HelloWorld
cd HelloWorld
rails server
Friday, August 12, 2011
Install MongoDB PHP driver on Debian 6 Squeeze
Install the server
apt-get install mongodb-server
Before install the PHP driver a couple of packages you'll need:
apt-get install php5-dev build-essential php-pear
Now time to compile/install the driver:
pecl install mongo
Once it finishes it will display the location of the new extension. Something like:
/usr/lib/php5/20090626/mongo.so
Finally add this to your php.ini (/etc/php5/cgi/php.ini):
extension=/usr/lib/php5/20090626/mongo.so
Now restart your web server and that's should be it!
Saturday, August 6, 2011
Symfony2's "Upgrade your APC extension (3.0.17+)" problem
Somehow Symfony2 Standard (2.0.0) have a bug on the installer that produces an error while it checks APC version. (even if you don't have it installed it, APC is NOT a requirement for SF2)
Here is the patch to fix it:
http://pastebin.com/raw.php?i=dwaM0uCC
Btw, This patch has already been commited to SF git, (not yet released).
Tuesday, August 2, 2011
Run Zend Framework (1.11) on lighttpd
Make sure this two mods are enabled on yer lighttpd.conf:
mod_rewrite
mod_setenv
And add this to your host config:
$HTTP["host"] == "localhost" {
url.rewrite-if-not-file = (
".*\?(.*)$" => "/index.php?$1",
"" => "/index.php"
)
# Not necessary, but most of Zend applications use it
setenv.add-environment = (
"APPLICATION_ENV" => "development"
)
}
Wednesday, April 13, 2011
Limit APT download rates/speed
First: OMG-THIS-IS-AN-ENGLISH-POST
Second: Yeah, as i said in my previous post (doh!) im re-installing Debian on my notebook and one thing i found myself wanting to do was to lower the download rate to some number that i can keep using my connection on a different (or not) pc while downloading big collections of packages.
Here is how i made it:
Create a file called: /etc/apt/apt.conf.d/75downloadspeed
Acquire
{
Queue-mode "access";
http
{
Dl-Limit "25";
};
};
This also can be done on the fly:
sudo apt-get -o Acquire::http::Dl-Limit=25 upgrade
That's it!, enjoy my l33tness
Friday, February 25, 2011
Moving to lighttpd..
I always loved apache since the beginning of times.... still do, but let's say that lighttpd is my b1tch now.
Why i moved?
- Really easy to install and config
- Not many dependencies
- Ease PHP/CGI setup
- REALLY easy to setup a multi virtual Host (great for your work environment)
- Runs smooth on my 64mb ram server... Yes, I'm not lying.!
Give it a try, your home server will love it too: http://www.lighttpd.net/.