
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Convert back and forth between Heroku-style ENV['DATABASE_URL']
and Rails/ActiveRecord-style config/database.yml
config hashes.
DatabaseUrl.to_active_record_hash(url = nil)
DatabaseUrl.to_active_record_url(hash)
DatabaseUrl.to_sequel_hash(url = nil)
DatabaseUrl.to_sequel_url(hash)
DATABASE_URL
from config hashYou pass it a hash (string or symbol keys, doesn't matter) and it gives you a URL:
>> c = YAML.load_file('/path/to/config/database.yml')
=> {"development"=>{"adapter"=>"mysql2", "database"=>"myapp_development", "username"=>"root", "password"=>"password", "encoding"=>"utf8"}, "test"=>{"adapter"=>"mysql2", "database"=>"myapp_test", "username"=>"root", "password"=>"password", "encoding"=>"utf8"}, "production"=>{"adapter"=>"mysql2", "database"=>"myapp", "username"=>"myapp", "password"=>"XXX", "encoding"=>"utf8"}, "cucumber"=>{"adapter"=>"mysql2", "database"=>"myapp_cucumber", "username"=>"root", "password"=>"password", "encoding"=>"utf8"}}
>> DatabaseUrl.to_active_record_url c['development']
=> "mysql2://root:password@127.0.0.1/myapp_development?encoding=utf8"
DATABASE_URL
>> DatabaseUrl.to_active_record_hash('postgres://uuu:xxx@127.0.0.1:1234/abc')
=> {:adapter=>"postgres", :host=>"127.0.0.1", :port=>1234, :database=>"abc", :user=>"uuu", :password=>"xxx"}
If you omit the argument, it will try ENV['DATABASE_URL']
encoding
pool
Copyright 2014 Seamus Abshere
FAQs
Unknown package
We found that database_url demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.