How did installing this RPM create a file?

Running yum install https://extras.getpagespeed.com/redhat/7/noarch/RPMS/getpagespeed-extras-release-7-1.el7.gps.noarch.rpm creates /etc/cron.d/sysstat2 but RPM disavows the file:

# rpm -ql getpagespeed-extras-release /etc/pki/rpm-gpg/RPM-GPG-KEY-GETPAGESPEED /etc/yum.repos.d/getpagespeed-extras.repo # rpm -qf /etc/cron.d/sysstat2 file /etc/cron.d/sysstat2 is not owned by any package 

How did the RPM create the file and how do I see what else it did?

Script allowed to launch without sudo password works in console, but not in .desktop file

I have set in /etc/sudoers.d a script to be launched without sudo password. It works from bash, but it does not work if invoked from a .desktop file. Why?

Furthermore, this works with sudo, not with pkexec. It seems pkexec does not honor the sudoers rules. Is this a know bug or is intentional?

How to use profile to authenticate and apply terraform file

I want to be able deploy some script files to aws lambda using a terraform file.

Here is a my file:

terraform {   required_version = "0.11.7" }  variable "region" {}   provider "aws" {   region = "$  {var.region}"   version = "2.00" }    // Zip the scripts folder (thus creating a package) before supplying it to the lambda function. data "archive_file" "package_zip" {   type = "zip"   source_dir = "$  {path.root}/scripts/"  # Path from top level module.   output_path = "./sources.zip" }  resource "aws_lambda_function" "anthony_test_lambda" {   filename      = "lambda_function_payload.zip"   function_name = "anthony_test_lambda"   role          = "new-role"   handler       = "lambda_function.lambda_handler"    source_code_hash = "$  {data.archive_file.package_zip.output_base64sha256}"    runtime = "python3.7"   } 

I want to keep the script as flexible as possible because I may not the only one who will work on the script in the future.

I want to be able to drive the process by using AWS profile. Here is what I tried:

 export AWS_PROFILE=a_team  tf apply 

I got this error:

* provider.aws: No valid credential sources found for AWS Provider.     Please see https://terraform.io/docs/providers/aws/index.html for more information on     providing credentials for the AWS Provider 

I cannot use AWS access key id and secret.

How can I fix this issue?

May I send MsgBox message for all users who has the same .xlsm file open from sharepoint?

We are using .xlsm files stored on sharepoint which need to be updated regularly. I would like to inform all users about macro starts/ends running who has the file open. Would be great to simply add a MsgBox to the VBA code but as I tested it is visible only for that user who starts the macro. Is there any solution to inform other users?

Many Thanks, marci

SP Flash Tool does not recognize the firmware scatter file

I have a neffos X1 Lite and it seems that it boots only in the twrp recovery console.

Anyway I am trying to restore my official recovery console (i have no backup) using the official firmware http://www.neffos.com/en/support/download/X1-Lite

Inside this zipped file, there is a file scatter.txt that contains the following content.

preloader 0x0 pgpt 0x0 recovery 0x8000 para 0x1008000 expdb 0x1088000 frp 0x1a88000 ppl 0x1b88000 nvdata 0x1bc8000 metadata 0x3bc8000 protect1 0x5bc8000 protect2 0x63c8000 seccfg 0x7000000 proinfo 0x7040000 oemkeystore 0x7800000 md1img 0x8000000 md1dsp 0x9800000 md1arm7 0x9c00000 md3img 0x9f00000 nvram 0xa400000 lk 0xa900000 lk2 0xaa00000 boot 0xab00000 logo 0xbb00000 tee1 0xc300000 tee2 0xc800000 secro 0xcd00000 keystore 0xd300000 system 0xe000000 cache 0xeb800000 userdata 0x106800000 flashinfo 0xFFFF0080 sgpt 0xFFFF0000 

Now, using SP_Flash_Tool-5.1916_Win to load this scatter file I get an error “Invalid format”. So, how am I supposed to un-brick my phone? I still have access to ADB, Fastboot and no matter what I can not boot to OS.

enter image description here

SP Flash Tool does not recognize the firmware scatter file

I have a neffos X1 Lite and it seems that it boots only in the twrp recovery console.

Anyway I am trying to restore my official recovery console (i have no backup) using the official firmware http://www.neffos.com/en/support/download/X1-Lite

Inside this zipped file, there is a file scatter.txt that contains the following content.

preloader 0x0 pgpt 0x0 recovery 0x8000 para 0x1008000 expdb 0x1088000 frp 0x1a88000 ppl 0x1b88000 nvdata 0x1bc8000 metadata 0x3bc8000 protect1 0x5bc8000 protect2 0x63c8000 seccfg 0x7000000 proinfo 0x7040000 oemkeystore 0x7800000 md1img 0x8000000 md1dsp 0x9800000 md1arm7 0x9c00000 md3img 0x9f00000 nvram 0xa400000 lk 0xa900000 lk2 0xaa00000 boot 0xab00000 logo 0xbb00000 tee1 0xc300000 tee2 0xc800000 secro 0xcd00000 keystore 0xd300000 system 0xe000000 cache 0xeb800000 userdata 0x106800000 flashinfo 0xFFFF0080 sgpt 0xFFFF0000 

Now, using SP_Flash_Tool-5.1916_Win to load this scatter file I get an error “Invalid format”. So, how am I supposed to un-brick my phone? I still have access to ADB, Fastboot and no matter what I can not boot to OS.

enter image description here

How can I make this SQL log file parse become faster

I have a read log file function to get select operation from database log file like this:

def getSelectMySql(log):      with open(log,'r', encoding='utf-8', errors='ignore') as data:         lines   = []         for baris in data:             bariss      = baris.rstrip()             newBaris    = re.sub(r'\t|\n|\r|\s{2,}',' ', bariss)             lines.append(newBaris)             result      = []             buffer      = []             success     = False             for line in lines:                 befSelect   = re.compile(r'^.+?(?=SELECT)')                 date        = re.search(r"\b(\d{6})(?=\s\d{1,}:\d{2}:\d{2})\b", line)# (\d{1,}:\d{2}:\d{2})                 select      = re.search(r'\b(SELECT)\b',line)                 parentheses = re.compile('[(){}]')                 if date:                     dat = datetime.datetime.strptime(date.group(), '%y%m%d').strftime('%Y-%m-%d')                     if buffer:                         result.append(tuple(buffer))                         buffer.clear()                     buffer.append(dat)                 if line.endswith("important") or line.endswith("'%general_log%'") or line.endswith("puro"):                     success = True if line.endswith("important") else False                 else:                     if success:                         if select and not line.endswith("SELECT"):                             line = re.sub(befSelect,'',line)                             line = re.sub(parentheses,'',line)                             buffer.append(line)             result.append(tuple(buffer))         print('Done\n')         return(result) 

from the data, this function will one save select line after important word. the example of file, like this:

190413  7:55:31 32168376 Query  SHOW variables like '%general_log%'         32168491 Connect    puro@17#.##.#.## on puro         32168491 Query  SELECT * FROM `file` WHERE `identifier` = 'ca28a3b30f893899556749679f8d3066' LIMIT 1         32168491 Quit            32168492 Connect    important@172.2#.#.# on important         32168492 Query  SET NAMES 'utf8'         32168492 Query  SHOW FULL COLUMNS FROM `sys_user`         32168492 Query  SELECT     kcu.constraint_name,     kcu.column_name,     kcu.referenced_table_name,     kcu.referenced_column_name FROM information_schema.referential_constraints AS rc JOIN information_schema.key_column_usage AS kcu ON     (         kcu.constraint_catalog = rc.constraint_catalog OR         (kcu.constraint_catalog IS NULL AND rc.constraint_catalog IS NULL)     ) AND     kcu.constraint_schema = rc.constraint_schema AND     kcu.constraint_name = rc.constraint_name WHERE rc.constraint_schema = database() AND kcu.table_schema = database() AND rc.table_name = 'sys_user' AND kcu.table_name = 'sysx_user'         32168492 Query  SELECT * FROM `lecturer_syllabus` WHERE ((`lec_id`='588') AND (`ta`='2016') AND (`sem_ta`='2')) AND (deleted !=1)         32168492 Query  SHOW FULL COLUMNS FROM `lect_year_syllabus` 

The output will be like:

[['190413', '7:55:31', SELECT * FROM `lecturer_syllabus` WHERE ((`lec_id`='588') AND (`ta`='2016') AND (`sem_ta`='2')) AND (deleted !=1)]] 

But as this my first try, I need opinion about what I’ve tried. because my code run slow with larger file.

How to move (rename) a file with the URL using JavaScript

I am using SharePoint Office 365. I have tried to extrapolate how to do this from many other sources but I am stuck. I have the URL of a file (happens to be a OneNote Notebook) and I want to move the file to a new name.

This is my last iteration of my code. We already have the context in code above this segment

var onenote_file = target_person_folder + '/RenameMe';     var File = context.get_web().getFileByServerRelativeUrl(onenote_file);                     context.load(File);                     console.log(File);                     var onenote_file_target_name = target_person_folder + '/' + first_name + ' ' + last_name;                     console.log(onenote_file_target_name);                     SP.File.moveTo(context, onenote_file,onenote_file_target_name, 1);                     context.executeQueryAsync(                         function (sender, args) {                             console('We renamed the file. YAY! ')                         },                         function (sender, args) {                             console('BOO!, We did not move the file. .')                         }); 

I think I am close but I would appreciate the help getting the rest of the way there.

Thanks!