Skills

  • Data Science

Experience

Benson Muriu

Work experience
  • Processing and Disbursement of loans.
  • Transfer transactions.
  • Processing of credit instraction
  • Block Website, App & Prompts
  • User
  • Generate python code to block a website, block mobile app and block all prompt related to it
  • ChatGPT
  • To block a website, mobile app, and all prompts related to it, you can modify the hosts file on your system. The hosts file is used to map hostnames to IP addresses and can be used to block access to specific websites or apps. Here's an example of Python code that can be used to block a website, an app, and all related prompts:
  • python
  • Copy code
  • import platform
  • import os
  • def block_website(website):
  • system = platform.system()
  • hosts_path = ''
  • if system == 'Windows':
  • hosts_path = r'C:\Windows\System32\drivers\etc\hosts'
  • elif system == 'Linux' or system == 'Darwin':
  • hosts_path = '/etc/hosts'
  • else:
  • print("Unsupported operating system.")
  • return
  • with open(hosts_path, 'a') as hosts_file:
  • hosts_file.write('\n127.0.0.1\t' + website)
  • def block_mobile_app(app_package_name):
  • system = platform.system()
  • hosts_path = ''
  • if system == 'Windows':
  • hosts_path = r'C:\Windows\System32\drivers\etc\hosts'
  • elif system == 'Linux' or system == 'Darwin':
  • hosts_path = '/etc/hosts'
  • else:
  • print("Unsupported operating system.")
  • return
  • with open(hosts_path, 'a') as hosts_file:
  • hosts_file.write('\n127.0.0.1\t' + app_package_name)
  • def block_all_prompts():
  • system = platform.system()
  • hosts_path = ''
  • if system == 'Windows':
  • hosts_path = r'C:\Windows\System32\drivers\etc\hosts'
  • elif system == 'Linux' or system == 'Darwin':
  • hosts_path = '/etc/hosts'
  • else:
  • print("Unsupported operating system.")
  • return
  • with open(hosts_path, 'a') as hosts_file:
  • hosts_file.write('\n127.0.0.1\twww.prompt.com')
  • hosts_file.write('\n127.0.0.1\tapp.prompt.com')
  • hosts_file.write('\n127.0.0.1\tapi.prompt.com')
  • # Usage example
  • block_website('www.example.com')
  • block_mobile_app('com.example.app')
  • block_all_prompts()
  • Note that modifying the hosts file requires administrative privileges. Therefore, you need to run the script as an administrator (on Windows) or with root/sudo access (on Linux or macOS) for it to work properly.
  • User
  • User
  • Generate python code to block a website, block mobile apps on android and block all prompt related to it
  • ChatGPT
  • To block a website on a computer, you can modify the hosts file as explained in the previous response. However, blocking mobile apps on Android requires a different approach. You'll need to configure your Android device's firewall to block specific apps. Here's an example of Python code that uses the adb command-line tool to block mobile apps on Android and also modifies the hosts file to block a website and all related prompts:
  • python
  • Copy code
  • import subprocess
  • def block_website(website):
  • hosts_entry = '127.0.0.1 ' + website
  • hosts_file_path = '/system/etc/hosts'
  • # Append the hosts entry to the hosts file
  • with open(hosts_file_path, 'a') as hosts_file:
  • hosts_file.write('\n' + hosts_entry)
  • def block_mobile_app(package_name):
  • # Block the app using adb command
  • subprocess.run(['adb', 'shell', 'pm', 'block', package_name], capture_output=True)
  • def block_all_prompts():
  • block_website('www.prompt.com')
  • block_website('app.prompt.com')
  • block_website('api.prompt.com')
  • # Block mobile app using adb command
  • block_mobile_app('com.example.app')
  • # Usage example
  • block_all_prompts()
  • Before running this code, ensure that you have the adb command-line tool installed and configured properly on your system. Additionally, you need to have USB debugging enabled on your Android device and connected to your computer via USB.
  • Please note that modifying system files and blocking apps on Android can have implications and may require root access on the device. It's important to proceed with caution and understand the potential consequences of these actions.
  • Responsibilities of a central processing officer
  • Data Processing: information or operational data.
  • Process Improvement.
  • Collaboration between Credit, IT and operations.
  • Daily Reporting of work processed previous day.

Related persons