
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Stores the GeoIP databases in Redis and gives it a simple way to lookup IPs and map them to countries/country codes.
Get your GeoIP country CSVs from http://www.maxmind.com/app/geolite.
Trifle supports both the IPV4 and IPV6 databases.
Loading the GeoIP databases from disk is slow, and doing that for every request is a pain. Trifle keeps your GeoIP database in memory and makes it easy to query.
Install the gem
gem install trifle
or add it to your Gemfile and bundle
gem "trifle"
# Initialize
trifle = Trifle.new(Redis.new)
# Load data from file
trifle.load filename: "file.csv"
# or files
trifle.load filenames: ["file1.csv", "file2.csv"]
# or directly as an array
trifle.load data: preloaded_array
Additionally you can specify your own Redis key to store the Trifle in:
trifle = Trifle.new(Redis.new, key: "foobar")
You can also load the Trifle from the command line:
trifle redis://127.0.0.1:6379/0 file1.csv file2.csv
# Initialize
trifle = Trifle.new(Redis.new)
# Lookup for existing data
trifle.find "223.255.128.0"
# => ["HK", "Hong Kong"]
# Lookup for missing data
trifle.find "192.168.1.1"
# => nil
See LICENSE
FAQs
Unknown package
We found that trifle 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.
Security News
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.