Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
The pgreset gem makes it possible to run rails db:reset against a postgres database with active connections. It should eliminate "database in use" errors from rails.
Credit for the original solution goes to Manuel Meurer.
Special thanks to Emil Kampp, Michael Yin, and Kate Donaldson for adding Rails 6.1 support.
Add this line to your application's Gemfile:
gem 'pgreset'
And then execute:
$ bundle
Or install it yourself as:
$ gem install pgreset
Now you can run rails db:reset as normal, and rails will kill active connections to the database being reset:
$ rails db:reset
After checking out the repo, run bin/setup
to install dependencies. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.
There's a script called pgreset-test.sh that can test a local copy of pgreset against various versions of ruby and rails. The script assumes postgres is listening on a socket at /tmp/.s.PGSQL.5432 and accepts connections for a user with no password, and that rvm is installed. You should at least test against these versions, since there were breaking changes to pgreset in them (replace PG_USER with your postgres username):
cd /path/to/your/pgreset/clone
./pgreset-test.sh 3.0.4 6.0.4 PG_USER
./pgreset-test.sh 3.1.2 7.0.8 PG_USER
./pgreset-test.sh 3.1.2 7.1.1 PG_USER
To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/dafalcon/pgreset.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that pgreset 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.