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.
This gem lets you easily interact with Google Fusion Tables API from your Ruby application via a plain SQL interface, or an object orientated interface.
Thanks to DerekEder's work, v0.4 supports the new Fusion Tables JSON API rather than the now defunct CSV API. This has introduced some small (but possibly breaking) changes:
See the example below and tests for more.
gem install fusion_tables
Gem Dependencies
Rubies
require 'fusion_tables'
# Connect to service
@ft = GData::Client::FusionTables.new
@ft.clientlogin(username, password)
@ft.set_api_key(api_key) # obtained from the google api console
# 1. SQL interface
# =========================
@ft.execute "SHOW TABLES"
@ft.execute "INSERT INTO #{my_table_id} (name, geo) VALUES ('tokyo', '35.6894 139.6917');"
@ft.execute "SELECT count() FROM #{my_table_id};"
# 2. ORM interface
# ========================
# Browse existing tables
@ft.show_tables
# => [table_1, table_2]
# Getting table id suitable for using with google maps (see more below)
table_1.id #=> 42342 (the table's google id)
# Count data
table_1.count #=> 1
# Select data
table_1.select
#=> data
# Select data with conditions
table_1.select "name", "WHERE x=n"
#=> data
# Select ROWIDs
row_ids = table_1.select "ROWID"
# Drop tables
@ft.drop table_1.id # table id
@ft.drop [table_1.id, table_2.id] # arrays of table ids
@ft.drop /yacht/ # regex on table name
# Creating a table
cols = [{:name => "friend name", :type => 'string' },
{:name => "age", :type => 'number' },
{:name => "meeting time", :type => 'datetime' },
{:name => "where", :type => 'location' }]
new_table = @ft.create_table "My upcoming meetings", cols
# Inserting rows (auto chunks every 500)
data = [{"friend name" => "Eric Wimp",
"age" => 25,
"meeting time" => Time.utc(2010,"aug",10,20,15,1),
"where" => "29 Acacia Road, Nuttytown"}]
new_table.insert data
# Currently FT API only supports single row UPDATE.
new_table.update 1, [{"friend name" => "Bananaman"}]
# Delete row
new_table.delete 1
# Delete all rows
new_table.truncate!
Largely based on Tom Verbeure's work for MTBGuru
FAQs
Unknown package
We found that fusion_tables demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.