webrtc candidate error after first connection - webrtc

Its really weird but our problem we cannot enter room after quitting room. But if we close that tab and open new tab , we can establish connection
System arc -> Backend: Java(has signal handler and stun server)
Frontend: React, Webrtc, Websocket
The thing that we found is only candidates changing after quit
our quit function :
stop local tracks
stop remote tracks
remove tracks from html objects
set null to rtcpeerconnection
navigate to enter room page refresh the page
also we are not allowing cookies
SDP's small part but can give ideas are in below
Successful SDP:
v=0
o=- 1890417799508134905 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1 2 3 4
a=extmap-allow-mixed
a=msid-semantic: WMS b5d241ed-d049-4dce-bdc1-ea8373179c9a deeef51e-5ba8-490f-9af4-f03507f5364e
m=audio 57254 UDP/TLS/RTP/SAVPF 111 63 103 9 0 8 105 13 110 113 126
c=IN IP4 192.168.1.163
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:776999446 1 udp 2122260223 192.168.1.163 57254 typ host generation 0 network-id 1 network-cost 10
a=candidate:1624501990 1 tcp 1518280447 192.168.1.163 9 typ host tcptype active generation 0 network-id 1 network-cost 10
a=ice-ufrag:axSk
a=ice-pwd:U/AgARCTwuCqJoRUCHEiXxte
a=ice-options:trickle
a=fingerprint:sha-256 52:98:76:5A:4E:DF:7C:52:F6:5F:DC:AB:80:88:CB:87:23:F1:C6:22:EB:00:00:32:13:F0:C6:B5:87:AE:DF:C1
a=setup:actpass
RTP timeout SDP:
v=0
o=- 6448792371209605139 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1 2 3 4
a=extmap-allow-mixed
a=msid-semantic: WMS 3df50eb7-1e5b-4be1-9980-cf4cf9d8fe44 cad786fb-8ed0-4303-9f53-ac0cde825aa1
m=audio 49198 UDP/TLS/RTP/SAVPF 111 63 103 9 0 8 105 13 110 113 126
c=IN IP4 192.168.1.163
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:776999446 1 udp 2122260223 192.168.1.163 49198 typ host generation 0 network-id 1 network-cost 10
a=candidate:776999446 1 udp 2122260223 192.168.1.163 63926 typ host generation 0 network-id 1 network-cost 10
a=candidate:776999446 1 udp 2122260223 192.168.1.163 61855 typ host generation 0 network-id 1 network-cost 10
a=candidate:776999446 1 udp 2122260223 192.168.1.163 49931 typ host generation 0 network-id 1 network-cost 10
a=candidate:776999446 1 udp 2122260223 192.168.1.163 64609 typ host generation 0 network-id 1 network-cost 10
a=candidate:1624501990 1 tcp 1518280447 192.168.1.163 9 typ host tcptype active generation 0 network-id 1 network-cost 10
a=ice-ufrag:gRfD
a=ice-pwd:R1tZ6a08ZL0bAXZfe0LYAGia
a=ice-options:trickle
a=fingerprint:sha-256 91:8C:8E:76:36:FA:50:A8:99:53:92:9E:7B:48:B0:1B:8A:55:75:5E:4D:40:54:10:94:C5:30:48:74:52:00:C6
a=setup:actpass
a=mid:0

Related

lfd High 5 minute load average alert - 6.43

I hope I'm in the right place
I'm having a notification from my VPS server about a High load with apachestatus.html file containing some info as below
Srv PID Acc M CPU SS Req Dur Conn Child Slot Client Protocol VHost Request
0-5 30706 4/420/7207 K 74.78 2 276 6462984 19.8 8.93 330.71 162.158.134.120 http/1.1 site1.example.com:443 GET /auth/signin HTTP/1.1
0-5 30706 0/417/7174 W 74.58 0 0 6900859 0.0 12.54 333.76 172.68.118.172 http/1.1 site1.example.com:443 POST /auth/signin HTTP/1.1
0-5 30706 4/408/7155 K 74.77 2 327 6759891 19.4 8.37 253.45 172.70.131.21 http/1.1 site1.example.com:443 POST /auth/signin HTTP/1.1
0-5 30706 0/503/7197 _ 74.66 5 426 6972175 0.0 10.28 374.51 141.101.68.26 http/1.1 site1.example.com:443 POST /auth/signin HTTP/1.1
0-5 30706 1/399/7251 K 74.77 2 266 6528061 8.1 14.55 291.27 172.69.69.41 http/1.1 site1.example.com:443 POST /auth/signin HTTP/1.1
0-5 30706 0/476/7234 _ 74.64 5 523 6451687 0.0 10.01 262.18 172.68.118.76 http/1.1 site1.example.com:443 GET /auth/signin HTTP/1.1
0-5 30706 2/434/7173 K 74.76 3 265 6972079 12.3 11.78 306.76 108.162.242.9 http/1.1 site1.example.com:443 POST /auth/signin HTTP/1.1
0-5 30706 1/425/7154 K 74.76 3 476 6313351 7.6 9.34 342.79 162.158.118.180 http/1.1 site1.example.com:443 GET /auth/signin HTTP/1.1
0-5 30706 1/414/7221 K 74.81 0 720 6698788 8.1 9.59 273.30 162.158.62.32 http/1.1 site1.example.com:443 POST /auth/signin HTTP/1.1
0-5 30706 0/468/7240 _ 74.60 8 586 7918329 0.0 10.25 293.01 172.69.69.199 http/1.1 site1.example.com:443 POST /auth/signin HTTP/1.1
0-5 30706 0/425/7207 _ 74.61 7 248 6691162 0.0 10.99 414.17 172.70.222.194 http/1.1 site1.example.com:443 GET /auth/signin HTTP/1.1
0-5 30706 6/411/7239 K 74.82 0 955 6807718 27.3 10.01 357.15 172.69.69.185 http/1.1 site1.example.com:443 GET /auth/signin HTTP/1.1
0-5 30706 1/452/7217 K 74.81 0 1123 6568176 8.1 10.20 293.10 172.70.110.180 http/1.1 site1.example.com:443 POST /auth/signin HTTP/1.1
0-5 30706 2/414/7224 K 74.80 1 369 7153413 11.4 11.21 331.23 172.70.82.54 http/1.1 site1.example.com:443 GET /auth/signin HTTP/1.1
0-5 30706 1/402/7203 K 74.74 4 566 6535237 8.1 7.79 263.32 172.70.114.138 http/1.1 site1.example.com:443 POST /auth/signin HTTP/1.1
0-5 30706 2/428/7259 K 74.76 4 717 6779567 11.9 11.26 392.65 172.70.178.78 http/1.1 site1.example.com:443 GET /auth/signin HTTP/1.1
0-5 30706 2/416/7125 K 74.76 3 527 6258884 12.3 9.67 251.22 162.158.134.142 http/1.1 site1.example.com:443 POST /auth/signin HTTP/1.1
0-5 30706 0/422/7143 _ 74.69 2 849 6620206 0.0 25.50 448.90 141.101.69.169 http/1.1 site1.example.com:443 GET /yf3q920TPF? HTTP/1.1
0-5 30706 0/395/7124 _ 74.64 6 494 6426369 0.0 132.05 358.19 172.70.54.252 http/1.1 site1.example.com:443 GET /auth/signin HTTP/1.1
0-5 30706 0/417/7151 _ 74.67 4 1589 6614715 0.0 10.91 286.53 108.162.216.190 http/1.1 site1.example.com:443 POST /auth/signin HTTP/1.1
0-5 30706 0/399/7163 _ 74.67 3 1056 6955007 0.0 7.52 291.21 172.70.54.2 http/1.1 site1.example.com:443 POST /auth/signin HTTP/1.1
0-5 30706 0/409/7272 W 74.55 2 0 6460489 0.0 26.08 257.75 172.70.54.16 http/1.1 site1.example.com:443 POST / HTTP/1.1
0-5 30706 2/438/7279 K 74.82 0 927 6925756 11.4 15.17 278.39 172.70.127.11 http/1.1 site1.example.com:443 GET /auth/signin HTTP/1.1
0-5 30706 0/399/7107 _ 74.61 8 683 6887484 0.0 9.19 385.11 172.70.130.56 http/1.1 site1.example.com:443 POST /auth/signin HTTP/1.1
0-5 30706 0/427/7302 W 74.60 0 0 7626256 0.0 10.43 305.48 127.0.0.1 http/1.1 server.example.com:80 GET /whm-server-status HTTP/1.1
1-5 30734 0/391/7145 _ 72.13 2 869 6507383 0.0 8.44 312.92 172.70.54.2 http/1.1 site1.example.com:443 POST /auth/signin HTTP/1.1
1-5 30734 1/406/7146 K 72.16 4 2000 7151012 87.6 9.10 435.53 172.71.114.58 http/1.1 site2.example.com:443 POST / HTTP/1.1
It looks like an attack but its source is "Cloudflare IPs"
(I'm using CloudFlare service to protect my websites)
How can I prevent this from happening again?

get last week date from last group for each group by pandas?

hy_code date week_date last_week_date
340 880301 2006/10/31 2006/11/5 NaT
341 880301 2006/11/1 2006/11/5 NaT
342 880301 2006/11/2 2006/11/5 NaT
343 880301 2006/11/3 2006/11/5 NaT
355 880301 2006/11/21 2006/11/26 2006/11/5
482916 880969 2021/12/24 2021/12/26 NaT
482918 880969 2021/12/28 2022/1/2 2021/12/26
482919 880969 2021/12/29 2022/1/2 2021/12/26
482920 880969 2021/12/30 2022/1/2 2021/12/26
482921 880969 2021/12/31 2022/1/2 2021/12/26
Goal
I want to get last week date for each group week date.The expected result is above.
Try
df['new_week_date']=tmp_df.groupby(['hy_code','week_date'])['week_date'].shift(1), but failed.
hy_code date week_date last_week_date
340 880301 2006-10-31 2006-11-05 NaT
341 880301 2006-11-01 2006-11-05 2006-11-05
342 880301 2006-11-02 2006-11-05 2006-11-05
343 880301 2006-11-03 2006-11-05 2006-11-05
355 880301 2006-11-21 2006-11-26 NaT
482916 880969 2021-12-24 2021-12-26 NaT
482918 880969 2021-12-28 2022-01-02 2021-12-26
482919 880969 2021-12-29 2022-01-02 2022-01-02
482920 880969 2021-12-30 2022-01-02 2022-01-02
482921 880969 2021-12-31 2022-01-02 2022-01-02
You can first compute the shifted week as a series with a double groupby:
s = (df
.groupby(['hy_code','week_date'],sort=False)['week_date'].first()
.groupby('hy_code').shift()
.rename('last_week_date')
)
hy_code week_date
880301 2006/11/5 NaN
2006/11/26 2006/11/5
880969 2021/12/26 NaN
2022/1/2 2021/12/26
Name: last_week_date, dtype: object
Then merge it to the original data:
# ensure last_week_date is not pre-existing
# df = df.drop(columns='last_week_date')
# merge
df.merge(s, left_on=['hy_code','week_date'], right_index=True)
Output:
hy_code date week_date last_week_date
340 880301 2006/10/31 2006/11/5 NaN
341 880301 2006/11/1 2006/11/5 NaN
342 880301 2006/11/2 2006/11/5 NaN
343 880301 2006/11/3 2006/11/5 NaN
355 880301 2006/11/21 2006/11/26 2006/11/5
482916 880969 2021/12/24 2021/12/26 NaN
482918 880969 2021/12/28 2022/1/2 2021/12/26
482919 880969 2021/12/29 2022/1/2 2021/12/26
482920 880969 2021/12/30 2022/1/2 2021/12/26
482921 880969 2021/12/31 2022/1/2 2021/12/26
You can first drop_duplicates, then create the shift week date and merge back
out = df.drop_duplicates(['hy_code','week_date']).copy()
out['lastweekdate'] = out.groupby('hy_code')['week_date'].shift(1)
df = df.merge(out.drop('date',1),how='left')
df
Out[233]:
hy_code date week_date lastweekdate
0 880301 2006/10/31 2006/11/5 NaN
1 880301 2006/11/1 2006/11/5 NaN
2 880301 2006/11/2 2006/11/5 NaN
3 880301 2006/11/3 2006/11/5 NaN
4 880301 2006/11/21 2006/11/26 2006/11/5
5 880969 2021/12/24 2021/12/26 NaN
6 880969 2021/12/28 2022/1/2 2021/12/26
7 880969 2021/12/29 2022/1/2 2021/12/26
8 880969 2021/12/30 2022/1/2 2021/12/26
9 880969 2021/12/31 2022/1/2 2021/12/26

Incrementing row numbers by condition in postgres

I have a postgres table with timestamps and the rounded difference in hours between current and previous (lagged) timestamp in difftime
timestamp type difftime
2013-09-14 14:19:46 JPR03 2
2013-09-14 15:11:48 JPR03 1
2013-09-14 16:11:49 JPR03 1
2013-09-14 17:13:45 JPR03 1
2013-09-22 00:08:38 JPR03 175
2013-09-22 00:10:11 JPR03 0
2013-09-22 01:11:36 JPR03 1
2013-09-22 02:16:11 JPR03 1
2013-09-22 03:13:16 JPR03 1
2013-09-22 04:05:38 JPR03 1
2013-09-22 06:10:11 JPR03 2
2013-09-22 07:26:43 JPR03 1
2013-09-22 08:17:35 JPR03 1
2013-09-22 09:16:08 JPR03 1
2013-09-22 10:16:08 JPR03 1
2013-10-01 06:15:07 JPR03 212
2013-10-01 06:15:12 JPR03 0
2013-10-02 07:15:15 JPR03 25
2013-10-02 08:05:09 JPR03 1
My objective is to create an incremental row number sequence that increases by 1 when and only when the value in difftime is above a certain threshold x (ordered by time). If x = 5, then the output would look like this:
timestamp type difftime rownum
2013-09-14 14:19:46 JPR03 2 0
2013-09-14 15:11:48 JPR03 1 0
2013-09-14 16:11:49 JPR03 1 0
2013-09-14 17:13:45 JPR03 1 0
2013-09-22 00:08:38 JPR03 175 1
2013-09-22 00:10:11 JPR03 0 1
2013-09-22 01:11:36 JPR03 1 1
2013-09-22 02:16:11 JPR03 1 1
2013-09-22 03:13:16 JPR03 1 1
2013-09-22 04:05:38 JPR03 1 1
2013-09-22 06:10:11 JPR03 2 1
2013-09-22 07:26:43 JPR03 1 1
2013-09-22 08:17:35 JPR03 1 1
2013-09-22 09:16:08 JPR03 1 1
2013-09-22 10:16:08 JPR03 1 1
2013-10-01 06:15:07 JPR03 212 2
2013-10-01 06:15:12 JPR03 0 2
2013-10-02 07:15:15 JPR03 25 3
2013-10-02 08:05:09 JPR03 1 3
I am familiar with the RANK(), DENSE_RANK(), ROW_NUMBER(), and COALESCE() functions, but none of these would achieve the objective of incrementing a row number by condition (beginning with 0). Any suggestions on how to implement this kind of variable assignment or what functions might be applied here to partition based on a condition?
demo:db<>fiddle
You can use the cumulative SUM() function with a conditional value: Add 1 if the condition is met, 0 otherwise:
SELECT
*,
SUM(
CASE
WHEN diff >= 5 THEN 1
ELSE 0
END
) OVER (ORDER BY ts)
FROM --<your query>
In Postgres, I would recommend using filter:
select q.*,
count(*) filter (where diff > ?) over (order by ts) as rownum
from <your query> q;
The ? is a placeholder for whatever value you have in mind.

WCF : Moving from IIS 7 to IIS 8

I have moved my my wcf service from iis7 to 8.i can browse to the svc file but i cannot browse to any other methods through get or post method.it shows the below error
The sever encountered an error processing the request.see server logs for more details
the log file is shown below
Software: Microsoft Internet Information Services 8.5
Version: 1.0
Date: 2014-12-17 04:25:48
Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2014-12-17 04:25:48 (ipaddress) GET /service - 786 - (ipaddress) Mozilla/5.0+(Windows+NT+6.3;+WOW64;+Trident/7.0;+rv:11.0)+like+Gecko - 301 0 0 120
2014-12-17 04:25:48 (ipaddress) GET /service/ - 786 - (ipaddress) Mozilla/5.0+(Windows+NT+6.3;+WOW64;+Trident/7.0;+rv:11.0)+like+Gecko - 200 0 0 3
2014-12-17 04:25:53 (ipaddress) GET /service/MposService.svc - 786 - (ipaddress) Mozilla/5.0+(Windows+NT+6.3;+WOW64;+Trident/7.0;+rv:11.0)+like+Gecko (ipaddress):786/service/ 200 0 0 904
2014-12-17 04:27:42 (ipaddress) GET /service/MposService.svc - 786 - publicip Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/39.0.2171.95+Safari/537.36 - 200 0 0 628
2014-12-17 04:27:42 (ipaddress) GET /favicon.ico - 786 - public ip Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/39.0.2171.95+Safari/537.36 - 404 0 2 470
2014-12-17 04:28:24 (ipaddress) GET /service/MposService.svc/getCustomer section=s1 786 - 117.213.26.161 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/39.0.2171.95+Safari/537.36 - 400 0 0 640

Convert more than one Columns into Rows

I have a table with columns and value like
ID Values FirstCol 2ndCol 3rdCol 4thCol 5thCol
1 1stValue 5466 34556 53536 54646 566
1 2ndValue 3544 957 667 1050 35363
1 3rdValue 1040 1041 4647 6477 1045
1 4thValue 1048 3546 1095 1151 65757
2 1stValue 845 5466 86578 885 859
2 2ndValue 35646 996 1300 7101 456467
2 3rdValue 102 46478 565 657 107
2 4thValue 5509 55110 1411 1152 1144
3 1stValue 845 854 847 884 675
3 2ndValue 984 994 4647 1041 1503
3 3rdValue 1602 1034 1034 1055 466
3 4thValue 1069 1610 6111 1124 1144
Now I want a result set in below form, is this possible with Pivot or Case statment?
ID Cols 1stValue 2ndValue 3rdValue 4thValue
1 FirstCol 5466 3544 1040 1048
1 2ndCol 34556 957 1041 3546
1 3rdCol 53536 667 4647 1095
1 4thCol 54646 1050 6477 1151
1 5thCol 566 35363 1045 65757
2 FirstCol 845 35646 102 5509
2 2ndCol 5466 996 46478 55110
2 3rdCol 86578 1300 565 1411
2 4thCol 885 7101 657 1152
2 5thCol 859 456467 107 1144
3 FirstCol 845 984 1602 1069
3 2ndCol 854 994 1034 1610
3 3rdCol 847 4647 1034 6111
3 4thCol 884 1041 1055 1124
3 5thCol 675 1503 466 1144
Assuming the table name is t1 this should do the trick:
SELECT * FROM t1
UNPIVOT (val FOR name IN ([FirstCol], [2ndCol], [3rdCol], [4thCol], [5thCol])) unpiv
PIVOT (SUM(val) FOR [Values] IN ([1stValue], [2ndValue], [3rdValue], [4thValue])) piv
There's sorting issue, it'd be good to rename FirstCol to 1stCol, then ORDER BY ID, name would put it in required order.