Here is the regular expression I use to remove them:
str.gsub!(/[\x80-\xff]/, '')
I'm sure this won't work in many cases but with my text it does the job just fine.
A collection of computer systems and programming tips that you may find useful.
Brought to you by Craic Computing LLC, a bioinformatics consulting company.
str.gsub!(/[\x80-\xff]/, '')
$ sudo sh -c 'echo "/Users/jones/Documents/mypath/mongodb/bin" > /etc/paths.d/mongodb'#!/usr/bin/ruby
puts "\033[1mForeground Colors...\033[0m\n"
puts " \033[30mBlack (30)\033[0m\n"
puts " \033[31mRed (31)\033[0m\n"
puts " \033[32mGreen (32)\033[0m\n"
puts " \033[33mYellow (33)\033[0m\n"
puts " \033[34mBlue (34)\033[0m\n"
puts " \033[35mMagenta (35)\033[0m\n"
puts " \033[36mCyan (36)\033[0m\n"
puts " \033[37mWhite (37)\033[0m\n"
puts ''
puts "\033[1mBackground Colors...\033[0m\n"
puts " \033[40m\033[37mBlack (40), White Text\033[0m\n"
puts " \033[41mRed (41)\033[0m\n"
puts " \033[42mGreen (42)\033[0m\n"
puts " \033[43mYellow (43)\033[0m\n"
puts " \033[44mBlue (44)\033[0m\n"
puts " \033[45mMagenta (45)\033[0m\n"
puts " \033[46mCyan (46)\033[0m\n"
puts " \033[47mWhite (47)\033[0m\n"
puts ''
puts "\033[1mModifiers...\033[0m\n"
puts " Reset (0)"
puts " \033[1mBold (1)\033[0m\n"
puts " \033[4mUnderlined (4)\033[0m\n"
Note that the exact colors will vary between different terminals. So try it and see.# openssl genrsa 1024 > example.com.key
Generating RSA private key, 1024 bit long modulus
.................................++++++
.........++++++
e is 65537 (0x10001)If you want to protect the key with a passphrase then add the -des3 option to the command. If you do then you need to enter the passphrase whenever your server starts up. if you do NOT then set the permissions on your files correctly (see below).# openssl req -new -key ./example.com.key > example.com.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:Washington
Locality Name (eg, city) []:Seattle
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Craic Computing LLC
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:*.example.com
Email Address []:youraddress@example.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:# openssl x509 -text -in example.com.crt You will see all sorts of information.# chmod 400 example.com.key
# chmod a-w example.com.crt<VirtualHost *:443>
ServerName www.example.com
ServerAlias *.example.com
DocumentRoot "/path/to/my/site"
SSLEngine on
SSLOptions +StrictRequire
SSLCertificateFile /mnt/ssl_certs/example.com.crt
SSLCertificateKeyFile /mnt/ssl_certs/example.com.key
</VirtualHost>You can put the certificate and key in any files you want, you just need to tell Apache where they. Your Apache configuration might be different from this.ActiveSupport::Inflector.inflections do |inflect|
inflect.uncountable %w( species )
end
2: Create your model, controller, table etc in the normal way using 'species' as the model name.ActionController::Routing::Routes.draw do |map|
map.resources :species, :singular => :species_instance
link_to "Show", species
to
link_to "Show", species_instance_path(species)
In doing so you make it explicit that you want the singular form."Edit", edit_species_path(species)
becomes
"Edit", edit_species_instance_path(species)
link_to "Destroy", species ...
becomes
link_to "Destroy", species_instance_path(species) ...
and finally
link_to "New Species", new_species_path
becomes
link_to "New Species", new_species_instance_path