Skip to main content

Posts

Showing posts from January 13, 2017

Single Mysql Command to restore the last 5 records from one database to another.

1. Get the structure of test_table from the source database.  > use database1;  > show create table test_table; 2. Copy the Complete CREATE TABLE `test_table` query 3. Remove the "AUTO_INCREMENT=xxxxxxx" Portion from the query. 4. Insert this query to the new database;  > use database2;  > Paste the CREATE TABLE query and press enter. 5. Now the tricky part, the below command will select the last 5 records from the test_table  of database1 and insert into the test_table of database2.  > insert into database1.test_table select * from database2.test_table order by cur_date desc limit 5; Thats all Folks, Cheers.

Dirty Cow Vulnerability CVE-2016-5195

Why it is called Dirty Cow?   " A race condition was found in the way the Linux kernel's memory subsystem handled the copy-on-write (COW) breakage of private read-only memory mappings. An unprivileged local user could use this flaw to gain write access to otherwise read-only memory mappings and thus increase their privileges on the system. " Who found the Dirty COW vulnerability? Phil Oester How to mitigate this vulnerability? You need to update the kernel and make sure the kernel is patched for this vulnerability. # yum update kernel # uname -r // for getting the installed kernel. # rpm -qa | grep kernel-name // for getting the package of the installed kernel. # rpm -q --changlog | grep -i 'CVE-2016-5195'   - [mm] close FOLL MAP_PRIVATE race (Larry Woodman) [1385116 1385117] {CVE-2016-5195} If this have a result like above , that means the cow is clean now :p How to Build and use the systemtap workaround First you have to insta