🎉 Initial commit

This commit is contained in:
docusland 2024-10-07 10:17:49 +02:00
commit b97050303f
8 changed files with 18707 additions and 0 deletions

20
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,20 @@
image: "python:3.7" #commands to run in the Docker container before starting each job.
before_script:
- python --version
- pip install -r requirements.txt # different stages in the pipeline
stages:
- linting
- testing
pylint:
stage: linting
image: registry.gitlab.com/mafda/python-linting
script:
- find . -type f -name "*.py" | xargs pylint
only:
- merge_requests
testing:
image: "python:latest"
stage: testing
script:
- pip install pytest
- pytest -v

14
data/code/shadok.py Normal file
View File

@ -0,0 +1,14 @@
SHADOK_CONVERSION = {"GA": 0, "BU": 1, "ZO": 2, "MEU": 3}
def translate_shadok_number_to_human_number(message: str) -> int:
"""
Translate a shadok number to human readable number.
example : BU MEU ZO MEU GA GA -> 1968
:param message:
:return:
"""
words = message.split()[::-1]
result = 0
for i, word in enumerate(words):
result += SHADOK_CONVERSION[word] * pow(4, i)
return result

45
data/oracle/logfile.ora Normal file
View File

@ -0,0 +1,45 @@
[2010-04-24 07:51:54,393] DEBUG - [main] BulkOpsClient.main(): Execution begin.
[2010-04-24 07:51:54,393] DEBUG - [main] BulkOpsClient.main(): List of all configurations loaded: {numofthreads=1, impstatchkinterval=30, maxloginattempts=1, manifestfiledir=.\Manifest\, sessionkeepchkinterval=300, routingurl=https://sso.crmondemand.com, hosturl=http://sdchs20n263.us.oracle.com, testmode=debug,maxthreadfailure=1, logintimeoutms=180000, csvblocksize=1000, maxsoapsize=10240}
[2010-04-24 07:51:54,393] DEBUG - [main] BulkOpsClient.main(): List of all options loaded: {password=*********, clientloglevel=detailed, waitforcompletion=False,datetimeformat=usa, importloglevel=errors, datafilepath=.\\data\\account1.csv,operation=insert, help=False, mapfilepath=.\\data\\account1.map,clientlogfiledir=., recordtype=account, duplicatecheckoption=externalid,username=oracle/oracle, csvdelimiter=,}
[2010-04-24 07:51:54,393] INFO - [main] Attempting to log in...
[2010-04-24 07:51:55,081] INFO - [main] Successfully logged in as: wchung/eric
[2010-04-24 07:51:55,081] DEBUG - [main] BulkOpsClient.doImport(): Execution begin.
[2010-04-24 07:51:55,081] INFO - [main] Validating Oracle Data Loader On Demand Import request...
[2010-04-24 07:51:55,081] DEBUG - [main] FieldMappingManager.parseMappings(): Execution begin.
[2010-04-24 07:51:55,097] DEBUG - [main] FieldMappingManager.parseMappings(): Execution complete.
[2010-04-24 07:51:55,331] DEBUG - [Thread-1] ODWSSessionKeeperThread.Run(): Submitting BulkOpImportGetRequestDetail WS call
[2010-04-24 07:51:55,331] INFO - [main] A SOAP request was sent to the server to create the import request.
[2010-04-24 07:51:55,862] DEBUG - [Thread-1] SOAPImpRequestManager.sendImportGetRequestDetail(): SOAP request sent successfully and a response was received
[2010-04-24 07:51:55,862] DEBUG - [Thread-1] ODWSSessionKeeperThread.Run(): BulkOpImportGetRequestDetail WS call finished
[2010-04-24 07:51:55,862] DEBUG - [Thread-1] ODWSSessionKeeperThread.Run(): SOAP response status code=OK
[2010-04-24 07:51:55,862] DEBUG - [Thread-1] ODWSSessionKeeperThread.Run(): Going to sleep for 300 seconds.
[2010-04-24 07:51:55,862] DEBUG - [main] SOAPImpRequestManager.handleSoapFaultException(): Handling SoapFaultException.
[2010-04-24 07:51:55,862] DEBUG - [main] There was an error sending the SOAP request to web service: SBL-ODU-01005
[2010-04-24 07:51:55,862] DEBUG - [main] BulkOpsClient.sendValidationRequest(): Experienced SOAP Request Rate Limit error while sending the validation request. Will try to send again in 1 sec.
[2010-04-24 07:51:56,862] INFO - [main] A SOAP request was sent to the server to create the import request.
[2010-04-24 07:52:01,268] INFO - [main] A response to the SOAP request sent to create the import request on the server has been received.
[2010-04-24 07:52:01,268] DEBUG - [main] SOAPImpRequestManager.sendImportCreateRequest(): SOAP request sent successfully and a response was received
[2010-04-24 07:52:01,268] INFO - [main] Oracle Data Loader On Demand Import validation PASSED.
[2010-04-24 07:52:01,268] DEBUG - [main] BulkOpsClient.sendValidationRequest(): Execution complete.
[2010-04-24 07:52:01,268] DEBUG - [main] BulkOpsClient.submitImportRequest(): Execution begin.
[2010-04-24 07:52:01,268] DEBUG - [main] BulkOpsClient.submitImportRequest(): Sending CSV Data Segments.
[2010-04-24 07:52:01,268] DEBUG - [main] CSVDataSender.CSVDataSender(): CSVDataSender will use 1 threads.
[2010-04-24 07:52:01,268] INFO - [main] Submitting Oracle Data Loader On Demand Import request with the following Request Id: 1QA2-Q5NU1...
[2010-04-24 07:52:01,268] DEBUG - [main] CSVDataSender.sendCSVData(): Creating thread 0
[2010-04-24 07:52:01,284] INFO - [main] Import Request Submission Status: Started
[2010-04-24 07:52:01,284] DEBUG - [main] CSVDataSender.sendCSVData(): Starting thread 0
[2010-04-24 07:52:01,284] DEBUG - [main] CSVDataSender.sendCSVData(): There are pending requests. Going to sleep.
[2010-04-24 07:52:01,284] DEBUG - [Thread-3] CSVDataSenderThread.run(): Thread 0 submitting CSV Data Segment: 1 of 1
[2010-04-24 07:52:02,487] INFO - [Thread-3] A response to the import data SOAP request sent to the server has been received.
[2010-04-24 07:52:02,487] DEBUG - [Thread-3] SOAPImpRequestManager.sendImportDataRequest(): SOAP request sent successfully and a response was received
[2010-04-24 07:52:02,487] INFO - [Thread-3] A SOAP request containing import data was sent to the server: 1 of 1
[2010-04-24 07:52:02,487] DEBUG - [Thread-3] CSVDataSenderThread.run(): There is no more pending request to be picked up by Thread 0.
[2010-04-24 07:52:02,487] DEBUG - [Thread-3] CSVDataSenderThread.run(): Thread 0 terminating now.
[2010-04-24 07:52:06,284] INFO - [main] Import Request Submission Status: 100.00%
[2010-04-24 07:52:07,284] INFO - [main] Oracle Data Loader On Demand Import submission completed succesfully.
[2010-04-24 07:52:07,284] DEBUG - [main] BulkOpsClient.submitImportRequest(): Execution complete.
[2010-04-24 07:52:07,300] DEBUG - [main] BulkOpsClient.doImport(): Execution complete.
[2010-04-24 07:52:07,300] INFO - [main] Attempting to log out...
[2010-04-24 07:52:09,487] INFO - [main] oracle/oracle is now logged out.
[2010-04-24 07:52:09,487] DEBUG - [Thread-1] ODWSSessionKeeperThread.Run(): Interrupted.
[2010-04-24 07:52:09,487] DEBUG - [main] BulkOpsClient.main(): Execution complete.

12648
data/pangaia/laravel.log Normal file

File diff suppressed because it is too large Load Diff

159
data/systemfiles/agent.log Normal file
View File

@ -0,0 +1,159 @@
01
03/22 08:51:01 INFO :.main: *************** RSVP Agent started ***************
02
03/22 08:51:01 INFO :...locate_configFile: Specified configuration file: /u/user10/rsvpd1.conf
03/22 08:51:01 INFO :.main: Using log level 511
03/22 08:51:01 INFO :..settcpimage: Get TCP images rc - EDC8112I Operation not supported on socket.
03
03/22 08:51:01 INFO :..settcpimage: Associate with TCP/IP image name = TCPCS
03/22 08:51:02 INFO :..reg_process: registering process with the system
03/22 08:51:02 INFO :..reg_process: attempt OS/390 registration
03/22 08:51:02 INFO :..reg_process: return from registration rc=0
04
03/22 08:51:06 TRACE :...read_physical_netif: Home list entries returned = 7
03/22 08:51:06 INFO :...read_physical_netif: index #0, interface VLINK1 has address 129.1.1.1, ifidx 0
03/22 08:51:06 INFO :...read_physical_netif: index #1, interface TR1 has address 9.37.65.139, ifidx 1
03/22 08:51:06 INFO :...read_physical_netif: index #2, interface LINK11 has address 9.67.100.1, ifidx 2
03/22 08:51:06 INFO :...read_physical_netif: index #3, interface LINK12 has address 9.67.101.1, ifidx 3
03/22 08:51:06 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
03/22 08:51:06 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
03/22 08:51:06 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
03/22 08:51:06 INFO :....mailslot_create: creating mailslot for timer
03/22 08:51:06 INFO :...mailbox_register: mailbox allocated for timer
05
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
06
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 129.1.1.1, entity for rsvp allocated and initialized
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 9.37.65.139, entity for rsvp allocated and
initialized
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 9.67.100.1, entity for rsvp allocated and initialized
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 WARNING:.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 9.67.101.1, entity for rsvp allocated and initialized
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 9.67.116.98, entity for rsvp allocated and
initialized
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 9.67.117.98, entity for rsvp allocated and
initialized
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
03/22 08:51:06 TRACE :..entity_initialize: interface 127.0.0.1, entity for rsvp allocated and initialized
03/22 08:51:06 INFO :......mailslot_create: creating socket for querying route
03/22 08:51:06 INFO :.....mailbox_register: no mailbox necessary for forward
03/22 08:51:06 INFO :......mailslot_create: creating mailslot for route engine - informational socket
03/22 08:51:06 TRACE :......mailslot_create: ready to accept informational socket connection
03/22 08:51:11 INFO :.....mailbox_register: mailbox allocated for route
03/22 08:51:11 INFO :.....mailslot_create: creating socket for traffic control module
03/22 08:51:11 INFO :....mailbox_register: no mailbox necessary for traffic-control
03/22 08:51:11 INFO :....mailslot_create: creating mailslot for RSVP client API
03/22 08:51:11 INFO :...mailbox_register: mailbox allocated for rsvp-api
03/22 08:51:11 INFO :...mailslot_create: creating mailslot for terminate
03/22 08:51:11 INFO :..mailbox_register: mailbox allocated for terminate
03/22 08:51:11 INFO :...mailslot_create: creating mailslot for dump
03/22 08:51:11 INFO :..mailbox_register: mailbox allocated for dump
03/22 08:51:11 INFO :...mailslot_create: creating mailslot for (broken) pipe
03/22 08:51:11 INFO :..mailbox_register: mailbox allocated for pipe
07
03/22 08:51:11 INFO :.main: rsvpd initialization complete
08
03/22 08:52:50 INFO :......rsvp_api_open: accepted a new connection for rapi
03/22 08:52:50 INFO :.......mailbox_register: mailbox allocated for mailbox
03/22 08:52:50 TRACE :......rsvp_event_mapSession: Session=9.67.116.99:1047:6 does not exist
09
03/22 08:52:50 EVENT :.....api_reader: api request SESSION
10
03/22 08:52:50 TRACE :......rsvp_event_establishSession: local node will send
03/22 08:52:50 INFO :........router_forward_getOI: Ioctl to get route entry successful
03/22 08:52:50 TRACE :........router_forward_getOI: source address: 9.67.116.98
03/22 08:52:50 TRACE :........router_forward_getOI: out inf: 9.67.116.98
03/22 08:52:50 TRACE :........router_forward_getOI: gateway: 0.0.0.0
03/22 08:52:50 TRACE :........router_forward_getOI: route handle: 7f5251c8
11
03/22 08:52:50 TRACE :.......event_establishSessionSend: found outgoing if=9.67.116.98 through
forward engine
03/22 08:52:50 TRACE :......rsvp_event_mapSession: Session=9.67.116.99:1047:6 exists
12
03/22 08:52:50 EVENT :.....api_reader: api request SENDER
13
03/22 08:52:50 INFO :.......init_policyAPI: papi_debug: Entering
03/22 08:52:50 INFO :.......init_policyAPI: papi_debug: papiLogFunc = 98681F0 papiUserValue = 0
03/22 08:52:50 INFO :.......init_policyAPI: papi_debug: Exiting
03/22 08:52:50 INFO :.......init_policyAPI: APIInitialize: Entering
03/22 08:52:50 INFO :.......init_policyAPI: open_socket: Entering
03/22 08:52:50 INFO :.......init_policyAPI: open_socket: Exiting
03/22 08:52:50 INFO :.......init_policyAPI: APIInitialize: ApiHandle = 98BDFB0, connfd = 22
03/22 08:52:50 INFO :.......init_policyAPI: APIInitialize: Exiting
03/22 08:52:50 INFO :.......init_policyAPI: RegisterWithPolicyAPI: Entering
03/22 08:52:50 INFO :.......init_policyAPI: RegisterWithPolicyAPI: Writing to socket = 22
03/22 08:52:50 INFO :.......init_policyAPI: ReadBuffer: Entering
03/22 08:52:51 INFO :.......init_policyAPI: ReadBuffer: Exiting
03/22 08:52:51 INFO :.......init_policyAPI: RegisterWithPolicyAPI: Exiting
03/22 08:52:51 INFO :.......init_policyAPI: Policy API initialized
03/22 08:52:51 INFO :......rpapi_getPolicyData: RSVPFindActionName: Entering
03/22 08:52:51 INFO :......rpapi_getPolicyData: ReadBuffer: Entering
03/22 08:52:51 INFO :......rpapi_getPolicyData: ReadBuffer: Exiting
03/22 08:52:51 INFO :......rpapi_getPolicyData: RSVPFindActionName: Result = 0
03/22 08:52:51 INFO :......rpapi_getPolicyData: RSVPFindActionName: Exiting
14
03/22 08:52:51 INFO :......rpapi_getPolicyData: found action name CLCat2 for
flow[sess=9.67.116.99:1047:6,source=9.67.116.98:8000]
03/22 08:52:51 INFO :......rpapi_getPolicyData: RSVPFindServiceDetailsOnActName: Entering
03/22 08:52:51 INFO :......rpapi_getPolicyData: ReadBuffer: Entering
03/22 08:52:51 INFO :......rpapi_getPolicyData: ReadBuffer: Exiting
03/22 08:52:51 INFO :......rpapi_getPolicyData: RSVPFindServiceDetailsOnActName: Result = 0
03/22 08:52:51 INFO :......rpapi_getPolicyData: RSVPFindServiceDetailsOnActName: Exiting
03/22 08:52:51 INFO :.....api_reader: appl chose service type 1
03/22 08:52:51 INFO :......rpapi_getSpecData: RSVPGetTSpec: Entering
03/22 08:52:51 INFO :......rpapi_getSpecData: RSVPGetTSpec: Result = 0
03/22 08:52:51 INFO :......rpapi_getSpecData: RSVPGetTSpec: Exiting
03/22 08:52:51 TRACE :.....api_reader: new service=1, old service=0
03/22 08:52:51 INFO :.......rsvp_flow_stateMachine: state SESSIONED, event PATHDELTA
15
03/22 08:52:51 TRACE :........rsvp_action_nHop: constructing a PATH
03/22 08:52:51 TRACE :........flow_timer_start: started T1
16
03/22 08:52:51 TRACE :.......rsvp_flow_stateMachine: entering state PATHED
03/22 08:52:51 TRACE :........mailslot_send: sending to (9.67.116.99:0)
03/22 08:52:51 TRACE :........mailslot_send: sending to (9.67.116.99:1698)
17
03/22 08:52:51 TRACE :.....rsvp_event: received event from RAW-IP on interface 9.67.116.98
03/22 08:52:51 TRACE :......rsvp_explode_packet: v=1,flg=0,type=2,cksm=54875,ttl=255,rsv=0,len=84
03/22 08:52:51 TRACE :.......rsvp_parse_objects: STYLE is WF
03/22 08:52:51 INFO :.......rsvp_parse_objects: obj RSVP_HOP hop=9.67.116.99, lih=0
03/22 08:52:51 TRACE :......rsvp_event_mapSession: Session=9.67.116.99:1047:6 exists
03/22 08:52:51 INFO :.......rsvp_flow_stateMachine: state PATHED, event RESVDELTA
18
03/22 08:52:51 TRACE :........traffic_action_oif: is to install filter
03/22 08:52:51 INFO :.........qosmgr_request: src-9.67.116.98:8000 dst-9.67.116.99:1047 proto-6
rthdl-7f5251c8
19
03/22 08:52:51 INFO :.........qosmgr_request: [CL r=90000 b=6000 p=110000 m=1024 M=2048]
03/22 08:52:51 INFO :.........qosmgr_request: Ioctl to add reservation successful
03/22 08:52:51 INFO :..........rpapi_Reg_UnregFlow: RSVPPutActionName: Entering

5756
data/systemfiles/kern.log Normal file

File diff suppressed because it is too large Load Diff

63
main.py Normal file
View File

@ -0,0 +1,63 @@
"""
This module has no real meaning.
Simply implemented for evaluating students.
"""
def list_filenames_of_log_files(*foldernames) -> list:
"""
List all the `*.log` files stored in the folders specified by foldernames.
This method returns a list containing the corresponding strings. Ordered in alphabetical order.
This method does not print anything.
:param foldernames:
:return: list of filenames
:raises FileNotFoundError: If one of the speficied folders does not exist
"""
return foldernames
def list_ipv4_listed_in_logfiles(*foldernames) -> list :
"""
Parse all the `*.log` files stored in the folders specified by foldernames.
This method returns a list of ip adresses stored in those files.
This method does not print anything.
Only IPv4 format are listed
No duplicates are returned.
:param foldernames:
:return: list of ips
:raises FileNotFoundError: If one of the speficied folders does not exist
"""
return foldernames
def cryptarithme(message:str = "SEND + MORE = MONEY") -> list:
"""
The `message` is a formatted mathematical operation.
Each letter represents a number between 0 and 9.
Find the value for each letter so that the full sentence is true.
Knowing that the first letter of each word cannot be a 0 if the word is longer than 1 letter.
It can occur that several results are possible. If so, all solutions must be returned in differents dictionnairies.
The order is not relevant.
Example : A + A = C returns [{"A" : 1, "C" : 2}, {"A" : 2, "C" : 4}, {"A" : 3, "C" : 6}, {"A" : 4, "C" : 8}]
:param message: The string to analyse
:return: List of dictionnaries with the following format : {
'letter1': value1,
'letter2': value2
}
:raises ValueError: If the string cannot be parsed properly.
:raises CryptarithmeError : If the string is not a possible Cryptarithme
"""
return message
if __name__ == '__main__':
list_filenames_of_log_files('data')
list_ipv4_listed_in_logfiles('data')
cryptarithme("")

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
pylint==3.3.1
pytest==8.3.3