Wary of data breaches and a mounting challenge for businesses to protect their digital assets, Gov. John Kasich signed into law on Friday a bill that aims to prod businesses to beef up security. Senate Bill 220 creates a legal incentive for companies to voluntarily invest in better cybersecurity to protect customer information. The law, introduced in the fall by Sen. Bob Hackett, R-London, and State Sen. Kevin Bacon, R-Minerva Park, provides a legal "safe harbor" for companies that take steps…
The world of application and its related services are migrating more towards cloud, because of availability, Elasticity, Manageability etc. While moving the entire stack we need to be very cautious while migrating the database part.
Migration of DB servers is not a simple lift and shift operation, Rather it would require a proper planning and more cautious in maintaining data consistency with existing DB server and cloud server by means of native replication or by using any third party tools.
The best way to migrate the existing MySQL database to RDS, in my opinion, is by using “logical backup“. Some of the logical backup tools as below,
In this blog, we will see about a simple workaround and best practices to migrate DB objects such as procedures, triggers, etc from a existing database server on premises to Amazon RDS (MySQL), which is a fully managed relational database service provided by AWS.
In order to provide managed services, RDS restricts certain privileges at the user level. Below are the list of restricted privileges in RDS.
- SUPER – Enable use of other administrative operations such as CHANGE MASTER TO, KILL (any connection), PURGE BINARY LOGS, SET GLOBAL, and mysqladmin debug command. Level: Global.
- SHUTDOWN – Enable use of mysqladmin shutdown. Level: Global.
- FILE – Enable the user to cause the server to read or write files. Level: Global.
- CREATE TABLESPACE – Enable tablespaces and log file groups to be created, altered, or dropped. Level: Global.
All stored programs (procedures, functions, triggers, and events) and views can have a DEFINER attribute that names a MySQL account. As shown below.
DELIMITER ;; CREATE DEFINER=`xxxxx`@`localhost` PROCEDURE `prc_hcsct_try`(IN `contactId` INT, IN `section` VARCHAR(255)) BEGIN IF NOT EXISTS (SELECT 1 FROM contacts_details WHERE contact_id = contactId) THEN INSERT INTO contacts_details (contact_id, last_touch_source, last_touch_time) VALUES (contactId, section, NOW()); ELSE UPDATE contacts_details SET last_touch_source = section, last_touch_time = NOW() WHERE contact_id = contactId; END IF; END ;; DELIMITER ;
While restoring same on to the RDS server, since the RDS doesn’t provide a SUPER privilege to its user, The restoration fails with the below error, since it fails
ERROR 1227 (42000) at line 15316: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
This will be very annoying since the restore fails at the end,
To overcome this below is the simple one-liner piped with the mysqldump command, which replaces the “DEFINER=`xxxxx`@`localhost`”, So when you are restoring the dump file, the definer will be a user which is used to restore
mysqldump -u user -p -h 'testdb.xcvadshkgfd..us-east-1.rds.amazonaws.com' --single-transaction --quick --triggers --routines --no-data --events testdb | perl -pe 's/\sDEFINER=`[^`]+`@`[^`]+`//' > test_dump.sql
Below is the content from the dump file after ignoring the default “DEFINER”, the same can also be done vis AWK and SED commands too.
DELIMITER ;; CREATE PROCEDURE `prc_contact_touch`(IN `contactId` INT, IN `section` VARCHAR(255)) BEGIN IF NOT EXISTS (SELECT 1 FROM contacts_details WHERE contact_id = contactId) THEN INSERT INTO contacts_details (contact_id, last_touch_source, last_touch_time) VALUES (contactId, section, NOW()); ELSE UPDATE contacts_details SET last_touch_source = section, last_touch_time = NOW() WHERE contact_id = contactId; END IF; END ;; DELIMITER ;
As you can see from the above the DEFINER section is completely removed.
Best practices for RDS migration,
1, Restore dump files from EC2 within the same VPC and RDS to have minimal network latency
2, Increase max_allowed_packet to 1G(max), to accommodate bigger packets
3, Dump data in parallel ,based on the instance capacity.
4, Bigger redo-log files can enhance the write performance
5, Make innodb_flush_log_at_trx_commit=2 for faster write with a little compromise to durability.
Here at io9, we love any excuse to foster our inner children. For Gizmodo video producer Tom Caswell, that opportunity came with Lego’s new Classic Voltron Set. It’s 2,300 pieces of 1980s Lego perfection that we put together over the course of eight glorious hours. Of course, we know not everyone has the time for that—so check out our timelapse video construction of the almighty Voltron, which just went on sale today.
Lego is calling this Voltron set “the biggest buildable Lego mech ever.” It consists of 2,321 pieces that are used to create buildable and posable lions whicih you can play with individually or combine together to make Voltron—along with the giant sword and shield, of course. The finished Voltron is over 15 inches high and its look is inspired by the original 1980s animated Voltron TV show, though I’m sure you could also act out missions from DreamWorks’ Voltron: Legendary Defender series, currently on Netflix.
We’ll have a full review of the Lego Voltron soon, but in the meantime, you can see how this stackable sausage gets made with our time-lapse build. And if you did get your hands on a Lego Voltron of your own, comment with a photo of your build!
U.S. District Judge Robert Lasnik,in Washington state, issued a temporary injunction against Texas-based DefDist barring them from releasing hobbyist computer code files. Somehow, the ruling by one district judge is allegedly binding on the entire country.
The Internet, thanks to Code Is Free Speech, struck back.
Firearm-Related Speech, Machining Instructions, Codes Published by Civil Rights Organizations, Activists at New CodeIsFreeSpeech.com Website
SACRAMENTO, CA (July 31, 2018) — Tonight, the organizations and individuals behind CodeIsFreeSpeech.com, a new Web site for the publication and sharing of firearm-related speech, including machine code, have issued the following statement:
Our Constitution’s First Amendment secures the right of all people to engage in truthful speech, including by sharing information contained in books, paintings, and files. Indeed, freedom of speech is a bedrock principle of our United States and a cornerstone of our democratic Republic. Through CodeIsFreeSpeech.com, we intend to encourage people to consider new and different aspects of our nation’s marketplace of ideas – even if some government officials disagree with our views or dislike our content – because information is code, code is free speech, and free speech is freedom.
Should any tyrants wish to chill or infringe the rights of the People, we would welcome the opportunity to defend freedom whenever, wherever, and however necessary. Hand-waving and hyperbole are not compelling government interests and censorship is not proper tailoring under the law.
The plaintively-whining pisswit plaintiffs allege no standing. They can present no case of a crime committed with a 3D-printed hobbyist experiment. They don’t explain why lawfully printing a gun is worse than lawfully assembling a zipgun from Lowes-supplied pipe. They do — falsely — claim that such a home-built firearm is “undetectable;” the law has been clear on that for decades: firearms must incorporate a minimum mass of metal to render them detectable by by X-ray and metal detectors. It doesn’t matter if the firearm is machined by a big corporation, screwed together from pipes by a gangbanger, or printed by a law-abiding home hobbyist.
People have been hand-making firearms for nearly a millennium (commercial mass-production of firearms is a relatively new phenomenon), from materials far more appropriate to the pressures and stresses of a firearm than plastic.
Automated additive and subtractive manufacturing has been around for decades.
Plastic has been a structural element of firearms for decades.
Only now, has it become a “problem.” Because now individual have access to the technology. Not just the licensed, regulated, tracked, inspected, harassed commercial builders.
Very few — apparently none — street thugs are going to spend hundreds of dollars on a 3D printer, more on filament, download CAD files, download more software to convert .SLDPRT files to .STL, run the conversion, and spend hours or days printing a large, bulky, poorly concealable .380 with which to rob his drug dealer. Stealing a gun or buying a gun on the black market is faster, cheaper, and gets them more effective tools of crime. That’s not what has the authoritarian goons worried.
They are afraid of the law-abiding people, who are getting a little tired of laws with no discernible relation to the constitution; honest folks who want protection the cops can’t or won’t provide; good people who might bypass the State’s attempt to render them helpless crime targets (as the criminals already do).
The goons fear arms in the hands of citizens who are tired of their shit. They are so afraid of the people that they are trying to preemptively shut down a new technology before it’s even ready to produce effective arms.
That’s OK. I still have pipe, nails, and wood in the garage.
And the country still has the Firearms Policy Coalition, Firearms Policy Foundation, The Calguns Foundation, California Association of Federal Firearms Licensees, Cody Wilson, and hundreds or thousands of people generating and sharing printer files.
Take the 3D AR Challenge!
3D-print a fully-functional, plastic AR-15, and successfully demonstrate it. The first person to do so will win 10 rounds of equally functional, 100% plastic 3D-printed .223 Remington ammunition.
Carl is an unpaid TZP volunteer. If you found this post useful, please consider dropping something in his tip jar. He could use the money, what with truck repairs and recurring bills. Click here to donate via PayPal.