Loads environment variables from .env for nodejs projects. - motdotla/dotenv
h/t Nitish Dayal

seen from Singapore
seen from Germany
seen from China

seen from United States

seen from Italy
seen from United States
seen from China
seen from Germany
seen from China

seen from Italy
seen from United States
seen from United States

seen from United States
seen from China

seen from Canada
seen from Norway
seen from Norway

seen from Canada
seen from Canada

seen from T1
Loads environment variables from .env for nodejs projects. - motdotla/dotenv
h/t Nitish Dayal
By: Siraj Ahmad, Nasrullah Khana The regeneration status of Dodonaea viscosa communities was investigated in Malakand division. It lies in Hindukash 71.43° South to 73.85° North and 36.07° West to 36.40° East. Seedling and sapling data was collected using quadrat method. Various physical and chemica…
The regeneration status of Dodonaea viscosa communities was investigated in Malakand division. It lies in Hindukash 71.43° South to 73.85° North and 36.07° West to 36.40° East. Seedling and sapling data was collected using quadrat method. Various physical and chemical factors were measured.
How to live healthy and disease free life - III
How to live healthy and disease free life – III
How to live healthy and disease free life – III
Hi, friends,
Welcome to my concluding part of How to live healthy and disease free life 2017 series.
As I have told and discussed in my previous articles that I have taken health checkup of 70000 INR in last 2 and half years to know what is going inside my body?
Why do you need to get Health Checkups?
You cannot know what is your health status…
View On WordPress
New Post has been published on Varinder Sandhu 's Blog
New Post has been published on http://www.varindersandhu.in/2013/05/16/toad-sqlnet-editor-and-tns-names-editor-disabled/
Toad - SQLNET Editor and TNS Names Editor Disabled
While trying to connect to a Database using Toad with TNS, Even the TNS entry is created in tnsnames.ora file under Oracle Home\NETWORK\ADMIN
Issue 1: SQLNET Editor and TNS Names Editor Disabled as shown in below snapshot
<!-- google_ad_client = "pub-2404605494811633"; google_alternate_color = "FFFFFF"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "FFFFFF"; google_color_link = "0000FF"; google_color_bg = "FFFFFF"; google_color_text = "000000"; google_color_url = "008000"; google_ui_features = "rc:6"; //-->
Issue 2: Not able to find the TNS Name in the dropdown as shown in below snapshot
Cause: TNS entry missing in the environmental variables
Resolution: Go to environmental variables and create a new variable Name as “TNS_ADMIN” and set the value as Oracle Home\NETWORK\ADMIN (as shown in below screen shot )
That’s all, now you will able to connect to a Database using Toad with TNS.
How to Run RSpec and other commands when using ENV Variables
When I set up a new rails app, I usually store my secure variables in .ENV file which I run using Foreman (See blog post). I need to remember that when I want to run my RSpec tests, I can't run the command:
bundle exec rspec
This will generate an error such as:
1) WelcomeController GET 'index' returns http success Failure/Error: Unable to find matching line from backtrace RuntimeError: You must set config.secret_key_base in your app's config.
This error is caused because rspec is unaware of the secret variables in the .ENV file.
Instead I need to run rspec:
foreman run bundle exec rspec
Note that this same process applies whenever the environmental variables are required such migrating a database when using devise(assuming you secured the devise secret key or are using devise 3.2.3 or greater). If you try to run:
rake db:migrate
You might get the following error:
rake aborted! Devise.secret_key was not set. Please add the following to your Devise initializer:
To get this to successfully access your secret key, run:
foreman run rake db:migrate
New Post has been published on Varinder Sandhu 's Blog
New Post has been published on http://www.varindersandhu.in/2013/05/16/toad-sqlnet-editor-and-tns-names-editor-disabled/
Toad - SQLNET Editor and TNS Names Editor Disabled
While trying to connect to a Database using Toad with TNS, Even the TNS entry is created in tnsnames.ora file under Oracle Home\NETWORK\ADMIN
<!-- google_ad_client = "pub-2404605494811633"; google_alternate_color = "FFFFFF"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "FFFFFF"; google_color_link = "0000FF"; google_color_bg = "FFFFFF"; google_color_text = "000000"; google_color_url = "008000"; google_ui_features = "rc:6"; //-->
Issue 1: SQLNET Editor and TNS Names Editor Disabled as shown in below snapshot
Issue 2: Not able to find the TNS Name in the dropdown as shown in below snapshot
Cause: TNS entry missing in the environmental variables
Resolution: Go to environmental variables and create a new variable Name as “TNS_ADMIN” and set the value as Oracle Home\NETWORK\ADMIN (as shown in below screen shot )
That’s all, now you will able to connect to a Database using Toad with TNS.
How to Set up Local Environmental Variables
On a recent rails project I set up action mailer to use my gmail account to send emails for things such as a password reminder email. The problem is that the code needs your user name and password and if you hard code your passwords etc. they will be publically available on sites such as github. The solution is to set local variables on both your local host as well as your production site such as heroku.
Step 1 - Create a new file in your project's root directory called .env . This is the file that will hold the variables you don't want to share with the world or if creating open source code that other developers will need to modify. In my code I set up three environmental variables that housed my gmail domain, user name and password.
config.action_mailer.smtp_settings = { address: "smtp.gmail.com", port: 587, domain: ENV["GMAIL_DOMAIN"], authentication: "plain", enable_starttls_auto: true, user_name: ENV["GMAIL_USERNAME"], password: ENV["GMAIL_PASSWORD"] }
Now in your .env file you will need to the add environmental variables for the fields in the above code.
GMAIL_DOMAIN=yoururl.com [email protected] GMAIL_PASSWORD=password12345
The .env file can also hold your other confidential variables that are needed for the current project such as your S3_Key and S3_SECRET for your Amazon S3 account.
Step 2 - Next you will need a solution that will access the local variables prior to starting the application. Since I plan on hosting my site on Heroku, I found that they recommended using a gem called foreman, click to see the article from the heroku blog. You will need to next add the foreman gem to your gem file and then run bundle install. Since foreman will not be used in production because I will be using Heroku to host this site, I specified that the foreman gem would only be used in dev and test
group :development, :test do gem 'foreman' end
Step 3 - Add a file to your root directory called Procfile. This file tells the application which processes need to be run. Add the following code to your Procfile:
web: bundle exec rails s
Step 4 - Update your .gitignore file so that the .env file isn't updated to your git and github accounts. If you skip this step, you potentially will end up sharing your passwords and other secret information with the world. The Procfile should also be to the gitginore if you are hosting on Heroku as it could cause an R11 - Bad Bind error. Add the following code to your .gitignore file.
.env Procfile
Step 5 - Now that you have installed foreman, you will need to begin replacing the rails s command to start up your rails server with the foreman start command. Your application should now successfully work in your local environment and be utilizing the secure information in your local .env file. Enter the following to start your rails server.
foreman start
Step 6 - If you use heroku for your web hosting, setting up your local production environment variables is really easy. Click to see heroku's instructions. The process is super simple. Make sure your terminal is in your projects root directory, then enter the following command. Just add a space between each variable you want to add.
heroku config:add GMAIL_PASSWORD=password12345 [email protected] GMAIL_DOMAIN=yoururl.com
That's it. Your production and development environments should both be accessing the secure variables.