Like Us Like Us Facebook Subscribe Subscribe us YouTube Whatsapp Share us Whatsapp Query Send your queries

How to Install DirectAdmin on Amazon AWS – Codentricks

How to Install DirectAdmin on Amazon AWS – Codentricks

How to Install DirectAdmin on Amazon on Amazon AWS, In this tutorial we will learn how to install DirectAdmin on Amazon AWS. For this you first you need to create AWS instance, the login via SSH for this you can use an application “putty” available for Windows OS as well as Linux.

Install DirectAdmin on Amazon AWS

DirectAdmin is a web hosting control panel like Cpanel + WHM that allows you to manage your websites through a graphical web-based interface. It’s known for its ease of use, speed, and stability. While cost for Cpanel is now increasing leap and bound where Directadmin comes in 5$ pm subscription.

Here are some key features of DirectAdmin:

How to Install DirectAdmin on Amazon on Amazon AWS Tutorial

For installing DirectAdmin on AWS we need License key, so first we need to buy directadmin. Then login to aws instance as root and run command below

bash <(curl -fsSL https://download.directadmin.com/setup.sh) 'license_key'

replace license_key with you keys obtained from directadmin.

After install, you will get details like, here we used a demo ip : 3.128.194.142, so you can understand better. After installation you get like the information given below, save these information.

The following information has been set:
Login: 3.128.194.142:2222
Admin username: admin
Admin password: ka2QQ3523GTygfdgLCHMsRz
Admin email: [email protected]

To login now, follow this URL: https://server-3-128-194-142.da.direct:2222 (Directadmin Login url)

Login to DirectAdmin

After login to DirectAdmin , go to custom build -> Build,   install  any application you need.

If you have and query or suggestion or need assistance  then please contact me, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

DirectAdmin changing IP Address using ipswap.sh

DirectAdmin changing IP Address using ipswap.sh

DirectAdmin changing IP Address using ipswap.sh. In this tutorial we will learn How to change your server IP address in DirectAdmin using ipswap.sh. When you install directadmin on AWS without elastic ip and in worst situation you need to restart instance the you get a new ip and you loose access to your old ip, In this scenario we need to change ip address.

For this first we need to login via ssh with putty now go to directory to /usr/local/directadmin/scripts.

You can use Linux command given below

cd /usr/local/directadmin/scripts

DirectAdmin changing IP Address using ipswap.sh

DirectAdmin changing IP Address

Run the command given below (it will require root access)

./ipswap.sh old_ip_address new_ip_address

Restart all services to IP Address change effect

systemctl restart pure-ftpd
systemctl restart exim
systemctl restart dovecot
systemctl restart httpd

You can also run da build rewrite_confs

Run the commands given below

cd /usr/local/directadmin/custombuild
./build set userdir_access yes
./build update
./build rewrite_confs

Learn how to install directadmin on Amazon Aws.

If you have and query or suggestion then please comment, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

Top 30 Question and Answer Python String

Top 30 Question and Answer Python String

In this post I am going to share Top 30 Question and Answer Python String, can be useful for CBSE Class XI and XII computer science with Python subject.

Top 30 Question and Answer Python String

Top 30 Question and Answer Python String

Q1. What is String in Python?

Ans. A sequence of characters which are enclosed in single(‘ ‘) or double (“”) quotes is known as String.

Q2. Is there any difference in ‘a’ or “a” in python?

Ans. No.

Q3. A string with zero character is called __________ string.

Ans. Empty.

Q4. Write the output of the following. 

str=”hello”

print(str[:4])

Ans. Hell

Q5. What do you mean by traversing a string?

Ans. Traversing a string means accessing all the elements of the string one by one by using index value.

Q6. What is the index value of the first  and last element of a string?

Ans. First 0 and last -1.

Q7. If the length of the string is 10 then what would be the positive index value of the last element?

Ans. 9 (10-1)

Q8. What type of error is returned by the following statement, if the length of string ‘str1’ is 10.

print(str1[13])

Ans. Index error.

Q9. Write the output of the following:

str1 = “Welcome to my Blog”

  1. print(str1[-1])
  2. print(str1[9])

Ans. 1. G and 2.o

Q10. Which of the following is an example of concatenation? 

  1. 6 + 3
  2. ‘6’ + ‘3’
  3. ‘a’ + ‘b’ + ‘c’

Ans. 1 and 3

Q11. What type of error is shown by the following code?

>>> 2 + ‘3’

Ans. TypeError

Q12. Write the output of the following.

>>> ‘A’ * 3

Ans. AAA

Q13. Write the output of the following

>>> ‘h’ in ‘Hindi’

>>>’i’ in ‘Hindi’

 

Ans. False , True

(‘h’ and ‘H’ are different)

Q14.  Write a program to accept strings and display the total number of alphabets.

Ans.

str = input(“Enter any string”)

s=0

for i in str:

if i.isalpha()==True:

s = s+ 1

print(“Total number of alphabets are”, s)

Q15. What is the difference between lower() and islower()?

Ans. lower() converts a string to lowercase while islower checks a string whether it’s in lowercase or not.

Q16. Write a program to accept a string and convert it into lowercase.

Ans.

str = input(“Enter any string”)

print(str.lower())

Q17. Write the output of the following:

>>>s = “My blog”

>>>s.upper()

>>>s.lower()

>>>s.islower()

>>>s.isupper()

>>>s.isalpha()

>>>s.isdigit()

Ans.

MY BLOG

my blog

False

False

False

False

Q18. Which of the following is/are not legal string operators?

  1. in
  2. +
  3. *

Ans. 4

Q19. Which of the following functions will return the total number of characters in a string?

  1. count()
  2. index()
  3. len()
  4. all of these

Ans. 3

Q20. Which of the following functions will return the first three characters of a string s?

  1. s[3:]
  2. s[:3]
  3. s[-3:]
  4. S[:-3]

Ans. 2 s[:3]

Q21. Which of the following functions will return the string with every ‘P’ replaced with a ‘z’?

  1. find()
  2. index()
  3. replace()
  4. split()

Ans. 3. replace()

Q22. Which of the following functions will return a list containing all words of the string?

  1. find()
  2. index()
  3. partition()
  4. split()

Ans. 4. split()

Q23. What is the output of the following code?

str1 = “Mission 999”

str2 = “999”

print(str1.isdigit(),str2.isdigit())

Ans. False True

Q24. Choose the correct function to get the ASCII code of a character.

  1. char(‘char’)
  2. ord(‘char’)
  3. ascii(‘char’)
  4. All of these

Ans. 2. ord(‘char’)

Q25. Given , which of the following expressions will return ‘How’ ?

  1. s[7:9]
  2. s[7:10]
  3. s[8:11]
  4. S[6:9]

Ans. B.

Q26. Which method should I use to convert String “Python programming is fun” to “Python Programming Is Fun” ?

  1. capitalize()
  2. title()
  3. istitle()
  4. upper()

Ans. 2. title()

Q27. Guess the correct output of the following String operations.

str1 = ‘Wah’

print(str1*2)

  1. WahWah
  2. TypeError: unsupported operand type(s) for * : ‘str’ and ‘int’
  3. WWaahh
  4. Wah2

Ans. 1. WahWah

Q28. If [‘one’, ‘four’, ‘three’, ‘two’]</code> is a list object, the <code>sort() function will return _____.

  1. [‘one’, ‘two’, ‘three’, ‘four’]
  2. [‘four’, ‘three’, ‘two’, ‘one’]
  3. [‘four’, ‘one’, ‘three’, ‘two’]
  4. None of the above

Ans. 3

Q29. To check whether string s1 contains another string s2, use __.

a) s1.contains(s2)
b) s2 in s1
c) s1.contains(s2)
d) si.in(s2)

Ans. a

Q30. Python does not support a character type; a single character is treated as strings of length one.

a) True
b) False

Ans. True.

Top 30 Question and Answer Python String query or suggestion

If you have any queries or suggestion regarding Computer Science with Python String Question and Answer then please leave a comment, I will try to answer as soon as possible.

If you have and query or suggestion then please comment, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

Advanced custom fields on save function trigger

Advanced custom fields on save function trigger

Advanced custom fields on save function trigger, in this tutorial I am going to share a PHP programme to automatic trigger when a advance custom field save or update from back-end. Recently I have to implement something like in a project, when a mentor create a session for students it will send whats app message to all students have the selected category. To save time I used advance custom field free version. you can see the screen shot given below …

Advance custom field on save Field group Screenshot

Advanced custom fields on save field group

 

Advanced custom fields on save function trigger WordPress Code

// on save / update trigger
function save_updated_acf_fields($post_id)
{

//var_dump($fieldD);
add_action('save_post', 'something_process',11,11);
function something_process()
{

$session_name=get_the_title();
$catId = get_field('field_668b804f201f2', $post_id);
$email = get_field('field_65d975036d82f', $post_id);
$mentor_name = get_field('field_65d975b86d831', $post_id);
$on_date = get_field('field_65642827439ed', $post_id);
$sendMsg = get_field('field_66978ee20ee08', $post_id);
$fieldD=array(
'session_name'=> $session_name,
'cat_id'=> $catId,
'on_date'=> $on_date,
'mentor_name'=> $mentor_name,
'email'=> $email,
'sendMsg'=>$sendMsg
);
print_r($fieldD);
$tmp = fopen(dirname(__file__).'/my_logs.txt', "a+"); fwrite($tmp,"\r\n\r\n".ob_get_contents());
fclose($tmp);
}
}
add_action('acf/save_post', 'save_updated_acf_fields');

You can use the code above in wordpress functions.php , also my_logs.txt we can use for debugging purpose. You can also read our tutorial on advance custom filed Advanced custom field how to populate select field.

If you have and query or suggestion then please comment, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

Advanced custom field how to populate select field

Advanced custom field how to populate select field

In this tutorial we will learn how to dynamically populate Advanced custom field select field in WordPress. I was trying a generate a dynamic select list so when I will create a update it from anywhere else it will automatically display in Advanced Custom Field select field.

Advanced custom field how to populate select field

Advanced custom field how to populate select field PHP Code

First we need PHP array with like, you can use you own custom function, I have used categoryList() in this tutorial.

{
"Programming"=>436,
"Finance"=>437
}

Suppose $category = categoryList(); contains data in format like shown above

function catListACF( $field ) {
//Change this to whatever data you are using.
$category = categoryList();
$field['choices'] = array();
foreach( $category as $key => $item ){
$field['choices'][$key] = $item;
}

return $field;
}
add_filter('acf/load_field/name=cateogry', 'catListACF');

Remember field name slug should be changed in add_filter(‘acf/load_field/name=cateogry’, ‘catListACF’);, here used category.

Use this php  code using in your functions.php file.

You can also read our tutorial on advance custom filed Advanced custom field how to populate select field.

If you have and query or suggestion then please comment, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

Months name in Hindi हिंदी के 12 महीने के नाम

Months name in Hindi हिंदी के 12 महीने के नाम

Months name in Hindi हिंदी के 12 महीने के नाम, In this post we will learn months name in Hindi and their duration.

Months name in Hindi

Months name in Hindi

First Month-> चैत्र (Chaitra):
Duration: From middle of March to middle of April. In Chaitra ( चैत्र) month we also celebrate Hindi New Year.

Second Month-> वैशाख (Bisakh):
Duration: From middle of April to middle of May.

Third Month-> जेठ (Jyeth):
Duration: From middle of May to middle of June.

Fourth Month-> अषाढ़ (Jyeth):
Duration: From middle of June to middle of July.

Fifth Month-> सावन (Sawan):
Duration: From middle of July to middle of August.
Also know as Rainy Season.

Sixth Month-> भादो / भाद्रपद (Bhado / Bhadrapad):
Duration: From middle of August to middle of September.

Seventh Month-> अश्विन (Ashwin):
Duration: From middle of September to middle of October.

Eight Month-> कार्तिक (Kartick):
Duration: From middle of October to middle of November.

Ninth Month-> मार्गशीर्ष (Margsirsh):
Duration: From middle of November to middle of December.

Tenth Month-> पौष (Posh):
Duration: From middle of December to middle of January.

Eleventh Month-> माघ (Magh):
Duration: From middle of January to middle of Febuary.

Twelth Month-> फाल्गुन (Falgun):
Duration: From middle of Febuary to middle of March.

 

If you have and query or suggestion then please comment, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

Class 12 Computer science with python syllabus 2024-2025

Class 12 Computer science with python syllabus 2024-2025

The CBSE Class 12 Computer Science with Python syllabus typically covers a wide range of topics aimed at providing students with a solid foundation in programming and computer science concepts using Python. Here’s a general outline of what is usually included in the syllabus:

Class 12 Computer science with python syllabus

Theory

Unit 1 – Programming and computational thinking

  • Revision of Python basics of Class 11
  • Functions
  • Introduction to files, text file, binary file, CSV files
  • File Handling
  • Using Python libraries
  • Recursion
  • Idea of efficiency
  • Data Visualization using Pyplot
  • Data structures

Unit 2 – Computer Networks

  • Data communication terminologies
  • Evolution of networking:
  • Structure of a network
  • Transmission media
  • Network devices
  • Network Stack
  • IP addresses
  • TCP
  • Protocols
  • Basic Network tools
  • Application layer

Unit 3 – Data Base Management

  • Writing a minimal Django based web application
  • Interface Python with SQL database
  • SQL commands

Class 12 Computer science with python Practical syllabus

  1. Python Programming
    • Writing and executing Python scripts
    • Implementing Object-Oriented concepts in Python
    • Using Python libraries (Pandas, Matplotlib, NumPy)
    • Handling files and exceptions in Python
  2. SQL Commands
    • Writing SQL queries (Create Table, Insert, Select, Update, Delete, Join)
  3. Project Work
    • Developing a project using Python programming and SQL commands

Guidelines

  • Duration: One academic session (usually the entire academic year)
  • Internal Assessment: Practical examination (30 marks) and project work (10 marks)
  • External Examination: Theory paper (70 marks)

This outline should give you a comprehensive overview of what to expect from the CBSE Class XII Computer Science with Python syllabus. Each school may slightly vary in how they teach and assess these topics, but these are the core areas that are covered. If you have specific questions about any of these topics or need further clarification, feel free to ask!

If you have and query or suggestion then please comment, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

JavaScript Salary Calculator: Estimate Your Salary

JavaScript Salary Calculator: Estimate Your Salary

JavaScript Salary Calculator: Estimate Your Salary, In this post we are going make simple application using HTML5, CSS and JavaScript to generate a estimate salary. This JavaScript tutorial is not complex so beginners will find it easy to learn.

Salary Calculator

Folder Structure of project Salary Calculator :

Folder name: salary

Salary folder contain main file names salary.html, sub folder name js and css. Sub folder js contain JavaScript file salary.js, while css folder contain css file file name style.css.

Main File salary.html code for Salary Calculator:

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Salary Calculation</title>
<link rel="stylesheet" href="css/style.css">
<script src="js/salary.js"></script>
</head>
<body>
<div class="c">
<h1>Salary Calculator</h1>
<p id="head">
Basic Pay
<input type="text" id="basic"/>
<br/>
<br/>

No. of Days
<input type="text" id="days"/>
<br/><br/>

<input type="submit" onclick="salary()" value="Submit" class="btn"/>
</p>
<div style="text-align:center;">
<div id="nets"></div>
Deduction<br/>
<span id="emplC"></span><br/>
<span id="emplP"></span><br/>
Addition<br/>
<span id="hr"></span><br/>
<span id="da"></span><br/>
<div id="salary"></div>
<div id="emrC"></div>
<div id="emrP"></div>
<div id="gsalary"></div>
</div>
</div>
</body>
</html>

Javascript file salary.js code for Salary Calculator:

// salary calculation script
function salary(){
   let basic=document.getElementById("basic").value;
   let days=document.getElementById("days").value;
   let od=0;
   basic=parseInt(basic);
   days=parseInt(days);
   od=parseFloat(basic/30); // for one month
   let netSalary= parseFloat(od*days);
   //emplC
   let emplC= parseFloat(netSalary * 0.0075);
   let emplP= parseFloat(netSalary * 0.0375);
   let hr= parseInt(3000);
   let da= parseFloat(netSalary * 0.10);
   let salary=0;
   salary=parseFloat(netSalary+da+hr-emplC-emplP);
   let emrC=parseFloat(netSalary*.0325);
   let emrP=parseFloat(netSalary*.12);
   let gsalary=parseFloat(salary+emrC+emrP);
   //console.log(salary);
   document.getElementById("nets").innerHTML="Basic: "+netSalary.toFixed(2);
   document.getElementById("emplC").innerHTML="ESI: "+emplC.toFixed(2);
   document.getElementById("emplP").innerHTML="PF: "+emplP.toFixed(2);
   document.getElementById("hr").innerHTML="HR: "+hr.toFixed(2);
   document.getElementById("da").innerHTML="DA: "+da.toFixed(2);
   document.getElementById("salary").innerHTML="Net Salary: "+salary.toFixed(2);
   document.getElementById("emrC").innerHTML="ESI Emplyor: "+emrC.toFixed(2);
   document.getElementById("emrP").innerHTML="PF Emplyor: "+emrP.toFixed(2);
   document.getElementById("gsalary").innerHTML="Gross Salary: "+gsalary.toFixed(2);
}

style.css Code for Salary Calculator:

body{
    background-color: #121c0e;
}
h1{
    color:#00ffe6;
  text-align:center;

}
#head{
text-align:center;
}
.note{
 text-align:center;
 font-size:18px;
}
.c{
   background-color: #121c0e;
  padding: 32px;
  margin-top: -10px;
  margin-right: -5px;
  margin-left: -5px;
  color:white;
}
#result{
    text-align:center;
    color:#afff00;
    font-size:25px;
}
.btn{
  padding: 10px;
  width: 300px;
  font-size: 1.2em;
  background:#207684;
  border: 0px;
  border-radius: 4px;
  color: #fff;
}

If you have any query or suggestion then let me know through your valuable comment, I will try to answer your comment as soons as possible.
If you have and query or suggestion then please comment, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

9 Things to Do After Installing Kubuntu 24.04 Command Line

9 Things to Do After Installing Kubuntu 24.04 Command Line

9 things to do after installing Kubuntu 24.04 to make life easier. Kubuntu shipped with KDE Plasma desktop 5.27.11 by default and as we know Plasma Desktop known for customization but for this we need to do some things command line  given below

Kubuntu 24.0

1. Update Kubuntu 24.04

Ensure you have the latest software and security patches by running Linux  commands given below in konsole / Terminal

sudo apt update
sudo apt dist-upgrade
or
sudo apt update && sudo apt upgrade -y

2. Install Restricted Codes in Kubuntu 24.04

Install codecs for playing popular media formats like MP3 and DVDs

sudo apt install ubuntu-restricted-extras

3. Install more fonts in Kubuntu 24.04

sudo apt install fonts-open-sans fonts-roboto fonts-oxygen fonts-lato

4. Install VLC

sudo apt install vlc

5. Install Video Editor

sudo apt install kdenlive
sudo apt install openshot-qt

6. Install Graphic manipulation tools

sudo apt install inkscape
sudo apt install gimp
sudo apt install krita

7. Webcam Tool

sudo apt install kamoso
sudo apt install cheese

8. Install Screen Recorder:

Install OBS Studio (also Wayland)

sudo add-apt-repository ppa:obsproject/obs-studio
sudo apt update
sudo apt install ffmpeg obs-studio

9. Install Visual studio code

sudo apt install code

If anything left then please let me know through comments.

ExtraTip : If someone want to install xampp then please follow this tutorial “How to install Xampp on Linux”.

 

If you have and query or suggestion then please comment, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

Create a simple MCQ quiz using pure Javascript

Create a simple MCQ quiz using pure Javascript

In this tutorial we are going to create a simple MCQ quiz using pure Javascript. We will use Javascript function checkAns() to all calculation. Complete source code given below to create  create mcq quiz programmatically so just copy and paste and create html file and open in a browser. Remember we did not use CSS (stylesheet) to enhance the look of MCQ quiz so you can customize as per your need.

Simple MCQ quiz using pure Javascript Code


<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Quiz Question</title>
</head>
<body>
<p>
<h1>MCQ</h1>
<h2>Quiz No. 1 :</h2>
India first world cup win...
</p>
<p>
<input type="radio" name="player" value="a" onclick="checkAns()">
<label>a. 1975</label><br>
<input type="radio" name="player" value="b" onclick="checkAns()">
<label>b. 1979</label><br>
<input type="radio" name="player" value="c" onclick="checkAns()">
<label>c. 1983</label><br>
<input type="radio" name="player" value="d" onclick="checkAns()">
<label>d. 1987</label><br><br>
<div id="res"></div>
</p>
<script>
function checkAns(){
let cAns="c";
let ans = document.querySelector('input[name="player"]:checked').value;
if(cAns==ans){
document.getElementById("res").innerHTML='<span style="color:green;font-Weight:bold;">You are right</span>';
}else{
document.getElementById("res").innerHTML='<span style="color:red;font-Weight:bold;">You are wrong</span>';
}
}
</script>
</body>
</html>

Simple MCQ quiz using pure Javascript Code Output

Simple MCQ quiz using pure Javascript Code Output

If you have and query or suggestion then please comment, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.