This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from bs4 import BeautifulSoup | |
| URL = 'https://www.cbar.az/currency/rates' | |
| response = requests.get(URL) | |
| soup = BeautifulSoup(response.content, 'html.parser') | |
| codes = [] | |
| values = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from hpe3parclient import client, exceptions | |
| username = 'username' | |
| password = 'password' | |
| # Storage IP | |
| ip_address = 'IP' | |
| Storage = 'Storage Name' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Define the username that’s locked out | |
| $Username = Read-Host "Please enter username: " | |
| ## Find the domain controller PDCe role | |
| $Pdce = (Get-AdDomain).PDCEmulator | |
| # Check if user locked out | |
| $LocketOutStatus = Get-ADUser -Properties LockedOut -Identity $Username | select LockedOut | |
| if ($LocketOutStatus.LockedOut -eq 'True'){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pyVim.connect import SmartConnect, SmartConnectNoSSL, Disconnect | |
| from pyVmomi import vim | |
| import re, ssl | |
| vc = 'Vcenter name' | |
| username = 'username' | |
| password = 'password' | |
| pg = input('New network name: ') # Port Group name in Vcenter | |
| vlan_id = input('New vlan ID: ') # Vlan ID | |
| esx_host = ['esxi1', 'esxi2'] # List of ESXi hosts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PyQt5 import QtCore, QtGui, QtWidgets | |
| import os | |
| class Ui_MainForm(object): | |
| # Select Python file | |
| def open_python_file(self): | |
| directory = QtWidgets.QFileDialog.getOpenFileName(directory="C:\\", filter="*.py") | |
| self.InputFile.setText(directory[0]) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Import-Module PSSQLite | |
| Add-PSSnapin Quest.ActiveRoles.ADManagement | |
| # Database path | |
| $Database = "C:\report\UsersLastLogon.SQLite" | |
| $Query = "CREATE TABLE IF NOT EXISTS UsersLastLogon ( | |
| Username TEXT, | |
| Computername TEXT, | |
| LastLogon TEXT)" |
OlderNewer