/log warning "Create variables"
:local currentDate "$[/system clock get date]"
:local id "$[/system identity get name]"
:local BackupName ("$id-backup-".[:pick $currentDate 7 11]."-".[:pick $currentDate 0 3]."-".[:pick $currentDate 4 6].".backup")
:local ConfigName ("$id-config-".[:pick $currentDate 7 11]."-".[:pick $currentDate 0 3]."-".[:pick $currentDate 4 6].".rsc")
:local array [:toarray ""]
# Setup FTP params
# FTP IP address no quotes, ex: 10.10.10.200
:local ftp ip-address
This file contains 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
function Get-LocalHosts { | |
<# | |
.SYNOPSIS | |
Scans a specified range of the local network. | |
.DESCRIPTION | |
Scans a given range of IP addresses on a local network. Displays hosts that are online | |
and resolves their names, mac addresses and manufacturer. The following databases are used to resolve mac addresses: | |
• maclookup.app | |
• wireshark |
This file contains 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
Get-ADUser -Filter * -SearchBase "OU=some_ou,DC=some_domain,DC=local" | ForEach { | |
$_.SamAccountName | |
(new-object directoryservices.directoryentry "", ("domain\" + $_.SamAccountName), "123456").psbase.name -ne $null | |
Write-Host "" | |
} |
This file contains 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
000000 Officially Xerox | |
000001 SuperLAN-2U | |
000002 BBN (was internal usage only, no longer used) | |
000003 XEROX CORPORATION | |
000004 XEROX CORPORATION | |
000005 XEROX CORPORATION | |
000006 XEROX CORPORATION | |
000007 XEROX CORPORATION | |
000008 XEROX CORPORATION | |
000009 powerpipes? |
This file contains 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
for file1 in ./dir1/*.* | |
do | |
filename1=$(basename "${file1%.*}") | |
for file2 in ./dir2/*.* | |
do | |
filename2=$(basename "${file2%.*}") | |
if [ "$filename1" = "$filename2" ]; | |
then | |
mkdir "$filename1" | |
cp "$file1" ./"$filename1" |
(ノ ˘_˘)ノ‥…━━━★typeof null === 'object'
┐( ̄ヘ ̄;)┌
This file contains 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
const phones = './path/to/file/phones1.txt' // исходный список абонентов | |
const phoneBookPath = './path/to/phonebook/pb.xml'; // файл адресной книги | |
//Пишем в синхронном режиме ---------------------------------------------------- | |
fs.writeFileSync(phoneBookPath, | |
'<?xml version="1.0" encoding="UTF-8"?>\r\n<PhoneBook>\r\n', | |
{encoding: 'utf-8'}, | |
(err) => console.log(err)); | |
fs.readFile(phones, 'utf8' , (err, data) => { | |
if(err) { |
This file contains 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
function getUsers() { | |
const items = document.querySelectorAll('.filtered-item'); | |
const arr = []; | |
items.forEach(item => {arr.push({name : item.querySelector(".name").textContent, number : item.querySelector(".transfer-number").textContent})}); | |
console.table(arr, [ 'name', 'number' ]); | |
} |
Step 1: Generate first ssh key Type the following command to generate your first public and private key on a local workstation. Next provide the required input or accept the defaults. Please do not change the filename and directory location.
workstation 1 $ ssh-keygen -t rsa
Finally, copy your public key to your remote server using scp
NewerOlder