An error occurred while reading communication packets in MySQL that are hosted on Docker containers with master-slave replication

I have set up a master and 2 slave MySQL databases in mine docker-compose.yml. They start fine when started, but when I perform some operations, the error appears

Got an error reading communication packets

in all 3 (master, slave1 and slave2)

Here are the .cnf files for all 3

master.cnf

(mysqld)
 server-id = 1
 log_bin = /var/log/mysql/mysql-bin.log
 binlog_do_db = common
 bind-address = 0.0.0.0
 character_set_server = utf8
 collation_server = utf8_general_ci

slave-1.cnf

(mysqld)
server-id = 2
log_bin = /var/log/mysql/mysql-bin.log
relay-log = /var/log/mysql/mysql-relay-bin.log
binlog_do_db = warehouse_b2b_common
replicate_do_db = warehouse_b2b_common
bind-address = 0.0.0.0
character_set_server = utf8
collation_server = utf8_general_ci

slave-2.cnf

(mysqld)
server-id = 3
log_bin = /var/log/mysql/mysql-bin.log
relay-log = /var/log/mysql/mysql-relay-bin.log
binlog_do_db = warehouse_b2b_common
replicate_do_db = warehouse_b2b_common
bind-address = 0.0.0.0
character_set_server = utf8
collation_server = utf8_general_ci

What am I missing here?

linux – Get a flag from vim commands by reading the strace output [CTF]

For clarification, I am currently working on a CTF challenge, which is to run a strash for a bash script that executes vim commands with commands such as vim -c ":! Cat flag.txt" in a bash script. For the sake of clarity, this idea was heavily inspired by a CTF that I did recently. Here's a description of what she looked like and what you did if you want to see what I'm really up to (https://github.com/Dvd848) /CTFs/blob/master/2019_36C3_Junior/tracer.md). I'm not quite sure how to get the correct output of the vim commands to obscure the flag. I want every keystroke to be recognized as read and write, but I haven't found a solid approach to do it properly. Any suggestions would be greatly appreciated. Essentially, there would be a strace output where the flag could be written with vim. I am not 100% sure that this can be done correctly by bash at all, so any suggestions would be very helpful!

cron – error: wrong username; while reading / etc / crontab

I'm pretty new here.

So I want to copy files from a server to an NFS that I have deployed on the server
To do this, I configure a crontab to copy these files into the NFS. The files were copied successfully by entering the command manually. However, automating the topic with a crontab always shows "Error: Invalid user name; while reading / etc / crontab".

Here is the command I used on the crontab

* / 5 * * * * rsync -r admindp /var/log/tomcat8/sensiproscheduler-app.log / shared_ftp /

Heeeeelp plz

Reading the TIFF image stack into c

Thank you for responding to Stack Overflow!

  • Please be sure answer the question, Provide details and share your research!

But avoid

  • Ask for help, clarify, or respond to other answers.
  • Make statements based on opinions; Support them with references or personal experiences.

For more information, see our tips on writing great answers.

How to fix chunksize errors in pandas while reading SQL queries

Here are my SQL queries

sql_queryes = """
   declare @thismonth varchar(6)
declare @firstday varchar(8)
declare @pdatefrom varchar(8)
declare @pdateTo varchar(8)
declare @TotalDays int
declare @MTDdays int=(SELECT DAY(getdate())  )
print @MTDdays

if(@MTDdays=1)
	begin
		set @thismonth=convert(varchar(6),getdate()-1,112)
		set @TotalDays=(Select day(dateadd(mm,DateDiff(mm, -1, getdate()-1),0) -1))
		set @MTDdays=(SELECT DAY(getdate()-1)  )
		set @firstday=convert(varchar(6),getdate()-1,112)+'01'
	end
else
	begin
		set @thismonth=convert(varchar(6),getdate(),112)
		set @TotalDays=(Select day(dateadd(mm,DateDiff(mm, -1, getdate()),0) -1))
		set @firstday=convert(varchar(6),getdate(),112)+'01'
	end

set @pdateTo= convert(varchar(8),dateadd(Day,-1,getdate()),112)
set @pdatefrom= convert(varchar(8),dateadd(Day,-91,getdate()),112)


select 
ROW_NUMBER() OVER (PARTITION BY BRAND ORDER BY BRAND desc )   BSLNO 
,ISNULL(BRAND, 0) BRAND
,ROW_NUMBER() OVER (ORDER BY ProductBrand.Itemname)   ISLNO 
,ISNULL(ProductBrand.Itemname, 'Not Found')Itemname
,PACKSIZE as UOM
,ISNULL(CAST(Sales.AvgSalesDay AS INT), 0) AvgSalesDay
,ISNULL(CAST(ItemTarget.ST AS INT), 0) MonthlySalesTarget
,ISNULL(CAST(ItemTarget.MTDTarget AS INT), 0) MTDSalesTarget
,ISNULL(CAST(Sales.ActualSalesMTD AS INT), 0) ActualSalesMTD
,ISNULL(CAST(case when ItemTarget.ST>0 then (Sales.ActualSalesMTD/ItemTarget.MTDTarget)* 100 else 0 end AS INT), 0) as MTDSalesAcv
,ISNULL(CAST(case when ItemTarget.ST>0 then (Sales.ActualSalesMTD/ItemTarget.ST) * 100 else 0 end AS INT), 0) as MonthlySalesAcv
,ISNULL(cast(Sales.AvgSalesDay*29 AS INT), 0) as MonthlySalesTrend
,ISNULL(cast(case when ItemTarget.ST>0 then (Sales.AvgSalesDay*29 /ItemTarget.ST)*100 else 0 end as int), 0) as MonthlySalesTrendAchiv

,ISNULL(CAST((NationwideStock-Sales.ActualSalesMTD) AS INT), 0) as RemaingStock
,ISNULL(CAST(NationwideStock AS INT), 0) NationwideStock
,isnull(cast((SKF Mirpur Plant) as int), 0) as 'SKF Mirpur Plant'
,isnull(cast((SKF Tongi Plant) as int), 0) as 'SKF Tongi Plant'
,isnull(cast((SKF Rupganj Plant)as int), 0) as 'SKF Rupganj Plant',

--,ISNULL(CAST(((NationwideStock-Sales.ActualSalesMTD)/Sales.AvgSalesDay*3) AS INT), 0) as StockDays
isnull(cast(TDCLCentralWH as int), 0) as TDCLCentralWH, 
ISNULL(CAST(BOG AS INT), 0) BOG,
ISNULL(CAST(BSL AS INT), 0) BSL,
ISNULL(CAST(COM AS INT), 0) COM,
ISNULL(CAST(COX AS INT), 0) COX,
ISNULL(CAST(CTG AS INT), 0) CTG,
ISNULL(CAST(CTN AS INT), 0) CTN,
ISNULL(CAST(DNJ AS INT), 0) DNJ,
ISNULL(CAST(FEN AS INT), 0) FEN,
ISNULL(CAST(FRD AS INT), 0) FRD,
ISNULL(CAST(GZP AS INT), 0) GZP,
ISNULL(CAST(HZJ AS INT), 0) HZJ,
ISNULL(CAST(JES AS INT), 0) JES,
ISNULL(CAST(KHL AS INT), 0) KHL,
ISNULL(CAST(KRN AS INT), 0) KRN,
ISNULL(CAST(KSG AS INT), 0) KSG,
ISNULL(CAST(KUS AS INT), 0) KUS,
ISNULL(CAST(MHK AS INT), 0) MHK,
ISNULL(CAST(MIR AS INT), 0) MIR,
ISNULL(CAST(MLV AS INT), 0) MLV,
ISNULL(CAST(MOT AS INT), 0) MOT,
ISNULL(CAST(MYM AS INT), 0) MYM,
ISNULL(cast(NAJ AS INT), 0) NAJ,
ISNULL(CAST(NOK AS INT), 0) NOK,
ISNULL(CAST(PAT AS INT), 0) PAT,
ISNULL(CAST(PBN AS INT), 0) PBN,
ISNULL(CAST(RAJ AS INT), 0) RAJ,
ISNULL(CAST(RNG AS INT), 0) RNG,
ISNULL(CAST(SAV AS INT), 0) SAV,
ISNULL(CAST(SYL AS INT), 0) SYL,
ISNULL(CAST(TGL AS INT), 0) TGL,
ISNULL(CAST(VRB AS INT), 0) VRB
from 
(select ITEMNO,(ITEMNAME) as Itemname,BRAND,PACKSIZE from PRINFOSKF where ITEMNO not like '9%'
and BRAND IN (SELECT BRAND FROM GPMBRAND WHERE EMAIL='akhter@skf.transcombd.com')
) as ProductBrand
Left join
(
SELECT ITEMNO,sum(QTY) as ST,sum(qty)/@TotalDays as STDay ,(sum(qty)/@TotalDays)*@MTDdays as MTDTarget FROM ARCSECONDARY.dbo.RfieldForceProductTRG where YEARMONTH=@thismonth
group by ITEMNO) as ItemTarget
ON ProductBrand.ITEMNO=ItemTarget.ITEMNO

left join
(select ITEM
,sum(case when transdate between @firstday and @pdateTo then QTYSHIPPED else 0 end ) as ActualSalesMTD
,sum(case when transdate between @pdatefrom and @pdateTo then QTYSHIPPED else 0 end)/91  as AvgSalesDay
from OESalesDetails where TRANSDATE between @pdatefrom and @pdateTo group by ITEM) as Sales
on ProductBrand.ITEMNO=sales.ITEM
left join (
select ITEMNO,sum(QTYONHAND) as NationwideStock
,SUM(case when AUDTORG='MHKSKF' AND LOCATION = '000140' then QTYONHAND else 0 end) as TDCLCentralWH
,SUM(case when AUDTORG='BOGSKF' then QTYONHAND else 0 end) as BOG
,SUM(case when AUDTORG='BSLSKF' then QTYONHAND else 0 end) as BSL
,SUM(case when AUDTORG='COMSKF' then QTYONHAND else 0 end) as COM
,SUM(case when AUDTORG='COXSKF' then QTYONHAND else 0 end) as COX
,SUM(case when AUDTORG='CTGSKF' then QTYONHAND else 0 end) as CTG
,SUM(case when AUDTORG='CTNSKF' then QTYONHAND else 0 end) as CTN
,SUM(case when AUDTORG='DNJSKF' then QTYONHAND else 0 end) as DNJ
,SUM(case when AUDTORG='FENSKF' then QTYONHAND else 0 end) as FEN
,SUM(case when AUDTORG='FRDSKF' then QTYONHAND else 0 end) as FRD
,SUM(case when AUDTORG='GZPSKF' then QTYONHAND else 0 end) as GZP
,SUM(case when AUDTORG='HZJSKF' then QTYONHAND else 0 end) as HZJ
,SUM(case when AUDTORG='JESSKF' then QTYONHAND else 0 end) as JES
,SUM(case when AUDTORG='KHLSKF' then QTYONHAND else 0 end) as KHL
,SUM(case when AUDTORG='KRNSKF' then QTYONHAND else 0 end) as KRN
,SUM(case when AUDTORG='KSGSKF' then QTYONHAND else 0 end) as KSG
,SUM(case when AUDTORG='KUSSKF' then QTYONHAND else 0 end) as KUS
,SUM(case when AUDTORG='MHKSKF' then QTYONHAND else 0 end) as MHK
,SUM(case when AUDTORG='MIRSKF' then QTYONHAND else 0 end) as MIR
,SUM(case when AUDTORG='MLVSKF' then QTYONHAND else 0 end) as MLV
,SUM(case when AUDTORG='MOTSKF' then QTYONHAND else 0 end) as MOT
,SUM(case when AUDTORG='MYMSKF' then QTYONHAND else 0 end) as MYM
,SUM(case when AUDTORG='NAJSKF' then QTYONHAND else 0 end) as NAJ
,SUM(case when AUDTORG='NOKSKF' then QTYONHAND else 0 end) as NOK
,SUM(case when AUDTORG='PATSKF' then QTYONHAND else 0 end) as PAT
,SUM(case when AUDTORG='PBNSKF' then QTYONHAND else 0 end) as PBN
,SUM(case when AUDTORG='RAJSKF' then QTYONHAND else 0 end) as RAJ
,SUM(case when AUDTORG='RNGSKF' then QTYONHAND else 0 end) as RNG
,SUM(case when AUDTORG='SAVSKF' then QTYONHAND else 0 end) as SAV
,SUM(case when AUDTORG='SYLSKF' then QTYONHAND else 0 end) as SYL
,SUM(case when AUDTORG='TGLSKF' then QTYONHAND else 0 end) as TGL
,SUM(case when AUDTORG='VRBSKF' then QTYONHAND else 0 end) as VRB

from ICHistoricalStock where AUDTDATE=20200225 AND RIGHT(LOCATION,3) IN ('140','141')
group by ITEMNO
) as Stock
on ProductBrand.ITEMNO=Stock.ITEMNO
left join 
(select ITEMNO,sum(case when (location) = ('4001') then QTYAVAIL else 0 end) as 'SKF Mirpur Plant',
sum(case when (location) = ('4005') then QTYAVAIL else 0 end) as 'SKF Tongi Plant'
,sum(case when (location) = ('4016') then QTYAVAIL else 0 end) as 'SKF Rupganj Plant'
from ICStockStatusCurrentLOT where (location) in ('4001','4005','4016') group by ITEMNO) as currentstock
on ProductBrand.ITEMNO=currentstock.ITEMNO
      """

Here is my python code

chunksize = 10000
chunks = ()
for chunk in pd.read_sql(sql_queryes, connection, chunksize=chunksize):
    chunks.append(chunk)
    print(chunks)

full_df = pd.concat(chunks)
print(full_df.head())

And here is the output error

Traceback (most recent call last):

File "D: / Python Code / GPM / gpo_wise_stock.py", line 30, in
for chunk in pd.read_sql (sql_queryes, connection, chunksize = chunksize):
File "D: Python-Code env_files lib site-packages pandas io sql.py", line 412, in read_sql
Chunksize = Chunksize,
File "D: Python-Code env_files lib site-packages pandas io sql.py", line 1634, in read_query
Columns = (col_desc (0) for col_desc in cursor.description)
TypeError: The object & # 39; NoneType & # 39; cannot be iterated

Note: I have used the pyodbc and pandas libraries and the queries can run properly.

Linked list for reading the file in C.

I created this code to read the characters from a file, save them in a list, and then scroll through the list to see if the character code was between the range> = 32 or <= 126 of the ASCII table but does not return any results to me If I even run it in the read file, it contains characters. I don't know the mistake.

typedef struct no_lista No_Lista; 
typedef struct lista Lista;

struct no_lista{
    int numero;
    struct No_lista *proximo;
};

Lista* cria_lista(void){
    return NULL;
}

No_Lista* Insere_fim (No_Lista* l, int v){
    No_Lista* novo_no = (No_Lista*)malloc(sizeof(No_Lista));
    No_Lista* aux = l;
    novo_no->numero = v;
    if (aux == NULL){
        novo_no->proximo = l;
        //return novo_no;
    }
    else{
        while(aux->proximo != NULL){
            aux = aux->proximo;
        }
        novo_no->proximo = NULL;
        aux->proximo = novo_no;
    return l;
    }
}
int main(){
    int valor;
    No_Lista *l = (No_Lista*) malloc(sizeof(No_Lista));
    l = cria_lista();
    FILE *arquivo; 
    arquivo = fopen("arq.txt", "r");
 if (arquivo) 
       {
           do
            {
                fscanf(arquivo,"%d",&valor );                            
                l = Insere_fim(l,valor); 

                void percorre(No_Lista *l){
                    No_Lista *no;
                    no = l;
                    while(no!=NULL){                
                        if (valor >= 32 && valor <= 126){
                        printf("n O caractere: %c de codigo ASCII: %i contem na tabela de literais", valor, valor);
                        no = no->proximo;
                        }else{
                            printf("n O caractere: %c de codigo ASCII: %i nao contem na tabela de literais", valor, valor);
                            fclose(arquivo);
                        }                   
                        no = no->proximo;
                    }   
                }
            } while(!feof(arquivo)); 
        }
return(0);
}

$ – graphic designer needed! Continue reading! | Forum promotion

Hi there. Looking for some work to do. I will tell you what to expect, then PM me from here with your past work if you have any lol.

Cost / deal:
If your prices are over $ 45- $ 50- £ 1000 : pLogo / mascot profile picture

  • Related games
  • Badges & emotes
  • If you are interested, please write me a PM from here and then we can discuss it from there. :] :]

    Python – problem reading the file and turning it into a key and value dictionary

    I have the following problem when searching a text file and cannot solve it. I think the solution is easy, but I need help to get there. I have the following code:

    import re
    
    
    
    dic = {}
    
    line = "rspamd_task_write_log: id: , qid: <48H2js00X4zRj01>, ip: 209.85.208.65, from: ,
           (default: F (no action): (-2.43/15.00) (IP_SCORE(-2.93){ip: (-2.32), ipnet: 123.123.123.0/17
            (-4.14), asn: 15169(-3.28), country: US(-0.04);},SUSPICIOUS_RECIPS(1.50){},DMARC_POLICY_ALLOW(-0.50){test.com;none;},R_DKIM_ALLOW(-0.20){test.com:s=20161025;},R_SPF_ALLOW(
            -0.20){+ip4:123.123.123.0/17;},MIME_GOOD(-0.10){multipart/mixed;multipart/alternative;text/plain;},ARC_NA(0.00){},ASN(0.00){asn:15169, ipnet:123.123.123.0/17, country:US;},DKI
            M_TRACE(0.00){test.com:+;},FROM_EQ_ENVFROM(0.00){},FROM_HAS_DN(0.00){},HAS_ATTACHMENT(0.00){},MIME_TRACE(0.00){0:+;1:+;2:+;3:~;4:~;},PREVIOUSLY_DELIVERED(0.00){test@
            test.com;},RCPT_COUNT_GT_50(0.00){174;},RCVD_COUNT_TWO(0.00){2;},RCVD_TLS_ALL(0.00){},TAGGED_RCPT(0.00){},TO_DN_SOME(0.00){},TO_MATCH_ENVRCPT_SOME(0.00){})), len: 65925
            08, time: 379.997ms real, 201.985ms virtual, dns req: 23, digest: <3ea7e074fbea648462253b1522858d71>, rcpts: , mime_rcpts: "
    
    
    regexp = '() ().*()))'
    pontuacao = '((-?d*.d*/)'
    status = '(:s.s(.*):s)'
    _id = '(w{3}:s,sw{2}:)'
    
    score = re.findall(pontuacao, line)(0).strip('(').strip('/')
    action = re.findall(status, line)(0).split('(')(1).strip('): ')
    qid = re.findall(_id, line)(0).split('<')(1).split('>')(0)
    signature = re.search(regexp, line).group().split(',')
    
    
    dic(qid) = {'score': score, 'action': action, 'metrics': signature}
    
    print(dic)
    
    

    That the following issue returns to me is exactly what I need

    {'48H2js00X4zRj01': {'score': '-2.43', 'action': 'no action', 'metrics': (') (IP_SCORE(-2.93){ip: (-2.32)', ' ipnet: 123.123.123.0/17        (-4.14)', ' asn: 15169(-3.28)', ' country: US(-0.04);}', 'SUSPICIOUS_RECIPS(1.50){}', 'DMARC_POLICY_ALLOW(-0.50){test.com;none;}', 'R_DKIM_ALLOW(-0.20){test.com:s=20161025;}', 'R_SPF_ALLOW(        -0.20){+ip4:123.123.123.0/17;}', 'MIME_GOOD(-0.10){multipart/mixed;multipart/alternative;text/plain;}', 'ARC_NA(0.00){}', 'ASN(0.00){asn:15169', ' ipnet:123.123.123.0/17', ' country:US;}', 'DKI        M_TRACE(0.00){test.com:+;}', 'FROM_EQ_ENVFROM(0.00){}', 'FROM_HAS_DN(0.00){}', 'HAS_ATTACHMENT(0.00){}', 'MIME_TRACE(0.00){0:+;1:+;2:+;3:~;4:~;}', 'PREVIOUSLY_DELIVERED(0.00){test@        test.com;}', 'RCPT_COUNT_GT_50(0.00){174;}', 'RCVD_COUNT_TWO(0.00){2;}', 'RCVD_TLS_ALL(0.00){}', 'TAGGED_RCPT(0.00){}', 'TO_DN_SOME(0.00){}', 'TO_MATCH_ENVRCPT_SOME(0.00){}))')}}
    

    more of what I understand, it only works if it's a string, in the case of a multi-line file, it doesn't work because the file is a list when I use the & # 39; Readlines & # 39; use.

    Can someone help me do this work in a multi-line file and save it in a JSON format.

    Note: All lines have the same pattern as this string in the line.

    Thanks in advance!