Skip to main content

Posts

Get WIFI password using python

Below is the code which will help to get you or hack a wifi password. After running the program you will get all nearby available wifi passords in one go.  Here is the code:  # now we will store the profiles data in "data" variable by # running the 1st cmd command using subprocess.check_output data = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8').split('\n') # now we will store the profile by converting them to list profiles = [i.split(":")[1][1:-1] for i in data if "All User Profile" in i] # using for loop in python we are checking and printing the wifi # passwords if they are available using the 2nd cmd command for i in profiles:     # running the 2nd cmd command to check passwords     results = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', i,                         'key=clear']).decode('utf-8').split('\n...

Change an extension to file in python

Program to change an extension of a file in python: import os import shutil def renamefiles():     filelist = os.listdir(r"source path here")     print(filelist)     os.chdir(r"source path here")     path = os.getcwd()     for filename in filelist:         if filename.endswith(".xml"):             print("Old Name - " + filename)             (prefix, sep, sffix) = filename.rpartition(".")             newfile = filename + '.ok'             if not filename.endswith(".ok"):                 os.rename(filename, newfile)                 print("New Name - " + newfile)                 os.chdir(path) # path to source directory src_dir = r'source path here' # path to destination directory...

Java Program to print Star patterns

 Java Star Pattern Programs: ================================================================= Patterns 1:  package javaPrograms; public class StarPattern { public static void main(String[] args) { //i for rows and j for columns       //row denotes the number of rows you want to print   int i, j, row=6;    //outer loop for rows   for(i=0; i<row; i++)    {    //inner loop for columns   for(j=0; j<=i; j++)    {    //prints stars    System.out.print("* ");    }    //throws the cursor in a new line after printing each line   System.out.println();    }      } } ================================================================= Pattern 2:  package javaPrograms; public class StarPattern1 { public static void main(String[] args) { for(int i=1;i<=4;i++) { ...

Java Program to check if Number is Armstrong or not

 Logic for  Armstrong   number :)  Armstrong Number An  Armstrong  number is a positive m-digit number that is equal to the sum of the m th  powers of their digits. It is also known as  pluperfect , or  Plus Perfect , or  Narcissistic  number. It is an OEIS sequence  A005188 . Let’s understand it through an example. Armstrong Number Example 1:  1 1  =  1 2:  2 1  =  2 3:  3 1  =  3 153:  1 3  + 5 3  + 3 3  = 1 + 125+ 27 =  153 125:  1 3  + 2 3  + 5 3  = 1 + 8 + 125 =  134 (Not an Armstrong Number) 1634:  1 4  + 6 4  + 3 4  + 4 4  = 1 + 1296 + 81 + 256 =  1643 //Armstrong number list:0,1,153,370,371,407,1634 //Eg 153 rest to 3(Total number of digit ) each digit if addition come original number. package javaPrograms; import java.util.Scanner; public class ArmstrongNumber { public static vo...

Java Program to reverse the Array elements

 package javaPrograms; import java.util.Scanner; public class ReverseArray { public static void main(String[] args) { Scanner sc = new Scanner (System.in); System.out.println("Enter the number of Elements::"); int n =sc.nextInt(); System.out.println("Enter the "+ n +" number of array elements"); int a[] = new int[n]; for(int i=0;i<n;i++) { a[i]=sc.nextInt(); } System.out.println("The reverse of array Elements are as follow"); for(int i=a.length-1;i>=0;i--) { System.out.println(a[i]); } } }

Java Program to find Maximum element from the Array

 package javaPrograms; import java.util.Scanner; public class MaximumElementInArray { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter the Length of Array::"); int n = sc.nextInt(); System.out.println("Enter the "+n+" number of Array Element::"); int a[] = new int[n]; for(int i=0;i<n;i++) { a[i] =sc.nextInt(); } int max=a[0];    for(int i=1;i<a.length;i++) {    if(a[i]>max) {    max=a[i];    }    }    System.out.println("Maximum Element is::"+max); } }

Java Prgram to find the minimum element in the Array

 package javaPrograms; import java.util.Scanner; public class ArrayMinElement { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter the Length of Array::"); int n = sc.nextInt(); System.out.println("Enter the "+n+" number of Array Element::"); int a[] = new int[n]; for(int i=0;i<n;i++) { a[i] =sc.nextInt(); } int min=a[0];    for(int i=1;i<a.length;i++) {    if(a[i]<=min) {    min=a[i];    }    }    System.out.println("Minimum Element is::"+min); } }