The .net framework provides and command-line installer utility for installing services on the Windows system. You can use installutil.exe to install the Windows service via the command line. For .net 4 framework it’s available under C:\Windows\Microsoft.NET\Framework\v4.0.30319 directory. How to Install Windows Service First of all, navigate to the .net framework directory and then run installutil.exe followed by the Windows server exe file path. cd “C:\Windows\Microsoft.NET\Framework\v4.0.30319\” installutil.exe C:\Users\Rahul\WindowsService\bin\Debug\WindowsService.exe” This will install service on your system. In case it prompts for the authentication, Input the username, and password of your Windows system. Remember the user name must start with “.\” followed by…
Author: Rahul
Composer is a useful tool for PHP developers, that simplifies the process of managing PHP application dependencies. If you’re working on MacOS and need to set up Composer, this guide will walk you through the steps in simple terms. Whether you’re a beginner or a seasoned developer, installing Composer on your MacOS system is a straightforward process that can enhance your development environment. Why Use Composer? Composer is a dependency manager for PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. Efficient management of project dependencies Streamlines package updates…
Image hotlinking is a problem faced by many website owners. When others embed your images on their websites directly from your server, it leads to unauthorized use of your content and can consume your bandwidth, slowing down your site. To protect your resources, it’s crucial to prevent hotlinking. This guide will show you how to use Apache’s .htaccess file to prevent image hotlinking. What is Image Hotlinking? Before we delve into the solution, it’s important to understand what image hotlinking is. Image hotlinking occurs when another website uses a direct link to an image hosted on your site, instead of…
Have you been itching to get your hands on the latest versions of Django, but haven’t found an easy way to do it on Fedora? You aren’t alone! We know that there are tons of new users who are interested in technology like Django, and we want to help them get set up quickly with the software they need. This blog post will walk you through how to get started with your local testing environment for Django on Fedora. Prerequisites: Basic knowledge of using a Linux terminal/command line and installation of software packages. Objective: To setup the development environment for…
Virtualenv is a tool used to create an isolated Python environment. This environment has its own installation directories and environment. This doesn’t share libraries with other environments. It is very helpful for the application required separate environments on the same server. The Virtualenv is the easiest and recommended way to configure a custom Python environment. This tutorial will help you to how to create a virtual environment for your Python application and use this. Prerequisites You must have the following packages installed on your system. Python 3 PIP Install Virtualenv with Python 3 You must have Python 3 and PIP…
You can easily pass command line arguments to a Python script. In this tutorial, we will help you to read the command line arguments in a Python script. Below is the sample Python script, which reads the command line arguments and print details. Create a sample script like script.py and copy the below content.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #!/usr/bin/python import sys # Print total number of arguments print ('Total number of arguments:', format(len(sys.argv))) # Print all arguments print ('Argument List:', str(sys.argv)) # Print arguments one by one print ('First argument:', str(sys.argv[0])) print ('Second argument:', str(sys.argv[1])) print ('Third argument:', str(sys.argv[2])) print ('Fourth argument:', str(sys.argv[3])) |
Then execute the above script with command line parameters. python script.py first 2 third 4.5 You will see the results below. The first argument is always the script itself. Output Total number of arguments: 5 Argument List: [‘script.py’, ‘first’, ‘2’, ‘third’, ‘4.5’] First argument: script.py…
Default let’s encrypt SSL certificates are issued for 90 days only. After this, you need to renew your SSL certificates. Let’s Encrypt allows the SSL renewal before 30 days of expiration. You can perform the renewal manually or configure auto-renewal using crontab. This tutorial will help you to auto-renew Let’s Encrypt SSL certificates automatically. The certbot script will take care of certificate renewal before expiration. How to Renew Let’s Encrypt SSL Certbot command-line utility provides users the option to renew SSL certificates before expiration. Before running the actual renewal process, you can do a dry run to verify that certbot…
This tutorial will help you to find files created or modified within X days. Here X means any number. Using the find command you can also search which is created or modified within X minutes. 1. Search files created/modified within 30 days Use this command to search all files created or modified within 30 days in /var/backup directory. Find provides the option -mtime to define number of days. find /var/backup -type f -mtime +30 You can also search file created within 60 minutes (1 hour) using -mmin optiopn. find /var/backup -type f -mmin +60 2. Search files with specific extension…
Cloudflare is a content delivery network service that acts as a reverse proxy. It is widely used by websites to serve content through Cloudflare’s global network. When the website traffic is routed through Cloudflare, the backend servers logged the Cloudflare IP address instead of the original visitor IP address. This tutorial will help you to enable Apache mod_cloudflare module on a Ubuntu system. Which will log the original visitor IP address to logs. Install mod_cloudflare for Apache Cloudflare provides an official module for the Apache server to capture real IP addresses. You need to enable the PPA of the Cloudflare…
Most of the Web/API services providers are shifting their environments to TLS 1.2 or greater. So to consume their services via PHP applications, you also need to force your application to use TLS 1.2 during making a connection. This tutorial will help you, how to use TLS 1.2 with PHP cURL. Using TLS 1.2 with PHP CURL Forcefully You can add the following code to your curl requests to use TLS 1.2. Use 6 as the value of CURLOPT_SSLVERSION forces cURL to use TLS 1.2. Below is the sample code to force use tls 1.2 with php curl:
1 | curl_setopt ($ch, CURLOPT_SSLVERSION, 6); |
For…
