Skip to content

Instantly share code, notes, and snippets.

View i386net's full-sized avatar
🏠
💻👻

i386net

🏠
💻👻
View GitHub Profile
@i386net
i386net / Get-LocalHosts.ps1
Last active July 16, 2023 10:58
Scans a specified range of the local network to get hosts online.
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
@i386net
i386net / get_users.ps1
Created May 11, 2021 10:27
Find AD users with blank or weak passwords
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 ""
}
@i386net
i386net / mac-vendor.txt
Created May 9, 2021 14:01 — forked from aallan/mac-vendor.txt
List of MAC addresses with vendors identities
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?
@i386net
i386net / ftp_backup.md
Last active May 11, 2021 08:27
Mikrotik backup to ftp
/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
@i386net
i386net / handler.sh
Last active February 2, 2021 12:01
shell file handler
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"

Aligning images

left alignment

This is the code you need to align images to the left:

(ノ ˘_˘)ノ‥…━━━★typeof null === 'object' ┐( ̄ヘ ̄;)┌

@i386net
i386net / fanvil-phonebook.js
Last active November 30, 2020 13:38
Создание адресной книги для аппартов Fanvil #mango
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) {
@i386net
i386net / Список абонентов Манго.js
Last active December 4, 2020 15:00
Получить список абонентов Манго Офис #mango
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' ]);
}
@i386net
i386net / multiple-ssh-authkeys.md
Created August 10, 2020 06:38 — forked from otkrsk/multiple-ssh-authkeys.md
Add multiple SSH keys to the authorized_keys file to enable SSH authentication when connecting to a server.

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