Resetare InSP Astra G

Mod de resetare contor “InSP”:
1. Se intrerupe contactul motorului, cheia va fi pe pozitia “O”
2. Se apasa butonul de resetare si se tine apasat (este butonul de la reset – aducere la zero – km realizati zilnic)
3. Se stabileste contactul motor, tinandu-se totodata cateva secunde si butonul reset km apasat
4. Dupa stabilirea contactului motor “InSP” va clipi la un moment dat cateva secunde, apoi va aparea afisat “—-” pana cand se va elibera butonul
5 In final va aparea kilometrajul zilnic.

How to install Rails 3.0 and Ruby 1.9.2 on Ubuntu

Install RVM 1.0.1

First be sure to do a quick update before you get started.

sudo apt-get update

Next install curl and git so we can pull down ruby via rvm

sudo apt-get install curl git-core

Now that you’re all set up, install RVM itself. This is done via a shell script which you can download and run directly with a single command.

$ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

After this is complete you need to edit your .bashrc file. First cd ~ and then Type "gedit .bashrc". Put the following at the bottom of the file.

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

after you complete the above and save your changes, close gedit. Next close your terminal window and re-open it. Now if you type "rvm -v" you should see a valid version 1.x

Install Ruby 1.8.7

First you need to pull down a few development packages

sudo apt-get install libruby1.8 zlib1g-dev libssl-dev 
libreadline5-dev build-essential

Next you need to install ruby 1.8.7 through rvm

rvm install ruby-1.8.7

After this is complete you need to set ruby 1.8.7 as the default for rvm

rvm use ruby-1.8.7 --default

Install rubygems and other dev essentials

first you need to add the ubuntu-on-rails ppa repository, sometimes they have newer versions of some Ruby components.

sudo add-apt-repository ppa:ubuntu-on-rails

After you add this be sure to do another update

sudo apt-get update

Next install the essential ruby packages

sudo apt-get install ruby rubygems irb ri rdoc rake

And a few more packages, odds are you will need them anyway

sudo apt-get install build-essential ruby1.8-dev libopenssl-ruby

After all the packages above are installed, add the gem path to your global PATH, so that executables new gems can be easily called from the command line.

export PATH=/var/lib/gems/1.8/bin:$PATH

After you run the above command, close the terminal window and re-open it.

Install MySql

Install the myslq development packages

sudo apt-get install mysql-server mysql-client
sudo apt-get install libmysql-ruby libmysqlclient-dev

Install the mysql gem

gem install mysql

Install Ruby 1.9.2

Next you need to install ruby 1.9.2 through rvm

rvm install ruby-1.9.2

After this is complete you need to set ruby 1.9.2 as the default for rvm.

rvm use ruby-1.9.2 --default

Install Rails 3.0.3

Now install rails but be sure you DON’T use sudo

gem install rails --version 3.0.3

After you have both rails 3 and ruby 1.9.2 up and running, install the mysql gem again.

gem install mysql

Now you should have a fully functional rails 3 + ruby 1.9.2 development environment! You can verify this by doing a simple "ruby -v" and "rails -v" from the command line.

http://toranbillups.com/blog/archive/2010/09/01/How-to-install-Rails-3.0-and-Ruby-1.9.2-on-Ubuntu

http://wiki.rubyonrails.org/getting-started/installation/linux

Export to Excel in Rails: to_xls Plugin

This gem transform an Array into a excel file using the spreadsheet gem.

Usage

  
@users = User.all

@users.to_xls
@users.to_xls(:headers => false)
@users.to_xls(:columns => [:name, :role])
@users.to_xls(:columns => [:name, {:company => [:name, :address]}])
@users.to_xls(:columns => [:name, {:company => [:name, :address]}],
      :headers => [:name, :company, :address])

In order to send a file from the controller, you can save it on your server first:

  
@users.to_xls.write '/path/to/file/users.xls'
send_file '/path/to/file/users.xls'

Alternatively you can use the method to_xls_data and send_data

  
send_data @users.to_xls_data, :filename => 'users.xls'

The method to_xls_data accepts the same parameters as to_xls.

Requirements

In config/initializers/mime_types.rb register the custom mime type.

  
Mime::Type.register "application/vnd.ms-excel", :xls

How to use

In the controller where you want to export to excel, add the format.xls line.

  
class UserController < ApplicationController
    def index
      @users = User.all

      respond_to do |format|
        format.html
        format.xml { render :xml => @users }
        format.xls { send_data @users.to_xls_data, 
           :filename => 'users.xls' }
      end
    end
end

Dependencies

  
spreadsheet gem

Install

  
Include next gems in your environment.rb config file:
config.gem 'to_xls'

Download plugin: to_xls-10d3e16

WordPress Post-Install Setup on Dreamhost

  1. Once you’ve completed your installation of WordPress, login to the admin panel and from the Settings-> General tab, you’ll need to set your WordPress address to the folder you installed WordPress (without the trailing slash) and set the Blog address to your blog’s root address (without the trailing slash).
  2. In a text or HTML editor, open the index.php file and change the location of your wp-blog-header.php to the new location.  Example: if your WordPress installation folder is ‘admin’, <?php require('./wp-blog-header.php'); ?> becomes <?php require('./admin/wp-blog-header.php'); ?>
  3. Upload the edited index.php to your blog’s root directory and delete the index.php file from your WordPress directory. If you’re using permalinks or other rewrite rules, the .htaccess file needs to be in the same location as the index.php file.