Thursday, November 9, 2023

Copilot in Command-Line Interface (CLI)

 


Introduction:

CoPilot in CLI is an innovative tool powered by GitHub that aims to streamline and enhance the development process for software developers. It brings GitHub Copilot's AI-powered code suggestions directly into the command-line interface (CLI), making it easier for developers to access intelligent code assistance and accelerate their coding workflows.


Key Features:


1) Seamless Integration: CoPilot in CLI seamlessly integrates into your development environment, allowing developers to access AI-generated code suggestions without leaving their command-line interface.


2) Code Assistance: Developers can enjoy code suggestions, auto-completions, and intelligent documentation as they write code, significantly reducing the time spent on repetitive coding tasks.


3) Cross-Linguistic Support: CoPilot in CLI supports a wide range of programming languages, making it a valuable tool for developers working on diverse projects.


4) Context-Awareness: The AI understands the context of your code, making it capable of providing more accurate and contextually relevant code suggestions.


5) Customization: Developers can customize CoPilot in CLI to fit their coding style and preferences, ensuring that it enhances their individual workflow.


6) Learning and Improvement: The more developers use CoPilot in CLI, the better it becomes at understanding their unique coding patterns, leading to more accurate and helpful suggestions over time.


7) Security and Compliance: GitHub places a strong emphasis on security and compliance. Developers can trust that their code suggestions are generated in a secure and compliant environment.


Benefits:


1) Increased Productivity: CoPilot in CLI reduces the time developers spend on repetitive coding tasks, allowing them to focus on more creative and complex aspects of their projects.


2)Enhanced Code Quality: With AI-powered suggestions, developers can write more accurate and efficient code, leading to higher code quality and fewer bugs.


3) Learning and Skill Development: CoPilot in CLI can serve as a valuable learning tool for developers by helping them understand coding best practices and idiomatic patterns in different languages.


4) Collaboration: CoPilot in CLI can enhance collaboration within development teams by providing consistent code suggestions and improving code review processes.


Potential Impact:


CoPilot in CLI has the potential to revolutionize the development process, especially for teams that rely on the command-line interface for coding. By providing intelligent code suggestions directly in the CLI, it can significantly enhance developer productivity, code quality, and learning experiences.


Next Steps:


1) Developers can start using CoPilot in CLI by installing and configuring the tool as per the GitHub documentation.

2) Explore the customization options to tailor the tool to individual coding preferences.

3) Encourage teams to integrate CoPilot in CLI into their workflows to experience the benefits first-hand.

4) Keep an eye on updates and improvements from GitHub as they continue to enhance the functionality of CoPilot in CLI.


In conclusion, CoPilot in CLI powered by GitHub is a game-changing tool that promises to simplify coding tasks, improve code quality, and empower developers to be more efficient and productive. By harnessing the power of AI, it is set to transform the way developers interact with their command-line interface and write code.

Wednesday, November 1, 2023

Display and control your Android device using "scrcpy" application

 


What is scrcpy?

As mentioned in Readme.md, this application (scrcpy) mirrors Android devices (video and audio) connected via USB or over TCP/IP, and allows to control the device with the keyboard and the mouse of the computer. It does not require any root access. It works on Linux, Windows, and macOS.

Why choosing this app?

  • Cross-platform support
  • Wireless support
  • Open-source project

How to install it?


Before you proceed to the installation make sure you already meet the prerequisites;
  • ADB is installed on your system.
  • Android version >= 11.
Then install,
  • For Windows, download the latest release executable file; i.e., x64 or x86, using the link, in addition to the server file.
  • For Linux, follow thoroughly the instructions mentioned here.

Running and using the "scrcpy" app:

For Linux users like myself, It's easy to follow the guide, however, the 3rd step might be overlooked the step to connect your device using a USB cable, then proceed to step 3. 


Other options

Use your companion Terminal and issue the command `scrcpy --help` or refer to the official documentation.




Don't Quit PC While Using Android Phone




Why You Need to Mirror Your Android Phone on Your PC


 

Mirroring your Android phone on your PC can be a useful tool for a variety of tasks. Here are just a few reasons why you might want to do this:

    • Recording a YouTube video. If you have a channel or you plan to have one, and you need to demonstrate phone-based content while on your laptop or desktop PC, then definitely screening your Android device to your computer will save much time and effort.
    • SMS verification. For example, if you are setting up a new online account and need to receive an SMS verification code, you can cast your phone to your PC and enter the code by copy-paste directly into the website or app.
    • To give presentations. If you need to give a presentation on your PC, mirroring your phone's screen can be a great way to share content with your audience. You can use your phone to display slides, images, or even live video footage.
    • To play games. Mirroring your phone's screen to your PC can give you a larger and more immersive gaming experience. You can also use your PC's keyboard and mouse to control your games, which can give you an advantage over other players.
    • To record your screen. If you need to record your phone's screen for a tutorial or other purpose, mirroring your phone to your PC can make the process much easier. You can use screen recording software on your PC to capture the mirrored image of your phone's screen.
    • To transfer files. Mirroring your phone to your PC can make it easy to transfer files between the two devices. You can drag and drop files between the two windows, or you can use a file transfer app.
    • To debug apps. If you are a developer, mirroring your phone to your PC can be helpful for debugging apps. You can use the developer tools on your PC to inspect the app's code and identify any errors.

How to... 

There are a number of different ways to mirror your Android phone on your PC. Some popular methods include:

    • Casting. Many Android phones have a built-in casting feature that allows you to mirror your screen to a variety of devices, including PCs. To cast your screen to your PC, you will need to install a casting receiver app on your PC.
    • USB cable. You can also mirror your Android phone to your PC using a USB cable. To do this, you will need to enable USB debugging on your phone and then connect the phone to your PC using a USB cable. Once the phone is connected, you can use a screen mirroring app on your PC to mirror the phone's screen.
    • Third-party apps. There are a number of third-party apps that can be used to mirror your Android phone to your PC. Some popular options include AirDroid Cast, Vysor, and Scrcpy.
    • Which method you choose will depend on your specific needs and preferences. If you are looking for a simple and easy-to-use method, casting is a good option. If you need to mirror your screen for more demanding tasks, such as gaming or debugging apps, you may want to use a USB cable or a third-party app.









Disable Firefox Auto-Update on Linux

 

Firefox disables the GUI for certain advanced options and settings to strike a balance between user control and simplicity. While Firefox aims to be a user-friendly web browser, it also needs to maintain a balance between providing customization options for advanced users and ensuring a smooth, secure, and user-friendly experience for the majority of users. 

Some advanced settings can have unintended and potentially harmful consequences if misconfigured. Disabling them in the GUI (about:preferences) reduces the likelihood of users accidentally changing critical settings. And this falls in minimizing user error. However, Mozilla, the organization behind Firefox, understands that power users and administrators may still need access to these advanced settings. That's why they provide alternative methods like the about:config page and the policies.json configuration file to change these settings. These methods require a bit more technical knowledge and are typically used by more advanced users or system administrators who need fine-grained control over Firefox's behavior.

To disable Firefox's automatic updating entirely from your Linux system follow these steps:

    1. Find the installation directory of Firefox (e.g.; /home/pop/firefox) then create the subdirectory distribution
    1. Create a policies.json file within /home/pop/firefox/distribution path
    2. Edit policies.json by pasting the following lines

    {
      "policies": {
        "DisableAppUpdate": true,
      }
   }

    3. Save the edits and close the file
    4. Open Firefox to check for changes if taken effect by heading to about:preferences


It is clear from the picture how the updates are disabled.
Additionally, you should see "Your browser is being managed by your organization." at the beginning of the preferences as a link; 

clicking it redirects to what is shown in the URL bar about:policies, you can see all policies took place in the previous file policies.json



Please note that disabling automatic updates for Firefox is not recommended, as it can leave your browser vulnerable to security risks. It is important to keep your browser up to date with the latest security patches. 

Furthermore, you can see all available policies (advanced options) under about:policies#documentation; how they are used is documented on the relevant webpage under what is mentioned as policies.json. You might notice, that different system distributions lead to different ways of configuration; for instance, Windows has its registry to modify the relevant options, while MacOS the same task achieved through XML/HTML file.



Another useful scenario is if someone wants to restrict Firefox from being updated beyond patch updates (still be updated with minor updates), one should add the policy within the policies.json file as

{
  "policies": {
    "AppUpdatePin": "120."
  }
}
In my case the latest update as of the time being is displayed using the terminal command /home/pop/firefox --version which shows 120.0a1; 120 is the patch version, while 0a1 is the minor version. So, the string value should always contain the patch version; and end with a dot ".". 

Please do remember multiple options are separated with a semicolon "," as this is a JSON language; so that the previous file should read as whole as;

{
   "policies": {
         "DisableAppUpdate": true,
         "AppUpdatePin": "120."
    }
}




Skip/Bypass Advertising Links on Browsers


Ad links are links that redirect you to a page with advertisements before taking you to your desired destination. They can be annoying and time-consuming, especially if you're trying to download a file or watch a video.

There are a few different ways to bypass ad links on browsers. One way is to use a browser extension. There are many different ad blocker extensions available, both free and paid. These extensions can block most types of ad links, including pop-ups, redirects, and overlays.

One of the powerful and known URL tracker blockers/bypassers is the reborn Universal Bypass extension today known as FastWard. It is available for all famous browsers, including Chrome, Firefox, and Edge.

Another way to bypass ad links is to use a proxy server. A proxy server is a server that acts as an intermediary between your computer and the internet. When you visit a website through a proxy server, the website sees the proxy server's IP address instead of your own. This can be useful for bypassing ad links, as many ad servers block traffic from known proxy servers.

Finally, you can also bypass ad links by directly entering the download URL of the file or video you want to access. To do this, you need to find the real download URL. This can be done by inspecting the page's source code or using a tool like LinkGrabber.

Here are some additional tips for bypassing ad links:

  • Use a private browsing mode. Private browsing mode prevents websites from tracking your browsing history and cookies. This can make it more difficult for ad servers to target you with ads.
  • Keep your browser up to date. Browser developers are constantly updating their browsers to patch security vulnerabilities and improve performance. This includes fixing bugs that can be exploited by ad servers.
  • Be careful about what links you click on. If you see a link that looks suspicious, don't click on it. It could be an ad link that will take you to a malicious website.

By following these tips, you can bypass ad links and save time and frustration.




Copilot in Command-Line Interface (CLI)

  Introduction: CoPilot in CLI is an innovative tool powered by GitHub that aims to streamline and enhance the development process for softw...