Jerry Lee Ford - Microsoft Windows PowerShell 2.0 Programming for the Absolute Beginner (2nd Ed) 2008
Книга посвящена Ver2, Ver 3 Powershell'а
Pipeline
cmd.exe, данные передаются как текст => затруднения, когда ожидаемяй формат отличается от необходимого.
Windows PowerShell возвращает объекты, к свойствам или методом обращается второй командлет.
"With object piping, the programmer is relieved of the responsibility of formatting object data, significantly simplifying the scripting process." - стр. 9
Listing тут
Pipeline
cmd.exe, данные передаются как текст => затруднения, когда ожидаемяй формат отличается от необходимого.
Windows PowerShell возвращает объекты, к свойствам или методом обращается второй командлет.
"With object piping, the programmer is relieved of the responsibility of formatting object data, significantly simplifying the scripting process." - стр. 9
Listing тут
[Специалист] Автоматизация административных задач при помощи Windows PowerShell 3.0 [2015, RUS]
Видео 1-3
И то, что удалось извлечь
И то, что удалось извлечь
Richard Siddaway - PowerShell in Practice - 2010
Просмотрел 1-е 4 главы.
Нет заданий в конце каждой главы. Рассматривает PS ver.2, ver.3
Форум тут. Из книги запустил скрипты:
Взаимодействие с WMI
Время последней перезагрузки
Get-WMIObject -Class Win32_OperatingSystem -property LastBootUpTime | foreach {[System.Management.ManagementDateTimeConverter]::ToDateTime($_.LastBootUpTime)}
ИД процесса приложения notepad.exe
Get-WmiObject -Class Win32_Process -Filter 'Name = "notepad.exe"' | Select Name, Processid | Format-Table -AutoSize
Нет заданий в конце каждой главы. Рассматривает PS ver.2, ver.3
Форум тут. Из книги запустил скрипты:
Взаимодействие с WMI
Время последней перезагрузки
Get-WMIObject -Class Win32_OperatingSystem -property LastBootUpTime | foreach {[System.Management.ManagementDateTimeConverter]::ToDateTime($_.LastBootUpTime)}
ИД процесса приложения notepad.exe
Get-WmiObject -Class Win32_Process -Filter 'Name = "notepad.exe"' | Select Name, Processid | Format-Table -AutoSize
try to connect two modules: WIC-1T and WIC-2T by this cables: DB60-V35MT + V35(female)-RS232(male) + SS-RS232FC. All cables standard length, about 3 meters. This means that summary length of all cables about 6 meters. I configure this modules on 2651XM, IOS 12.3.Lights on both modules green, but "Serial1/0 is up, line protocol is down "
Hello, friends.
I try to connect two modules: WIC-1T and WIC-2T by this cables: DB60-V35MT + V35(female)-RS232(male) + SS-RS232FC. All cables standard length, about 3 meters. This means that summary length of all cables about 6 meters. I configure this modules on 2651XM, IOS 12.3.Lights on both modules green, but "Serial1/0 is up, line protocol is down "
DB60-V35MT + V35(female)-RS232(male) - are from the right side of the photo.

Wic-1T configuration (DTE)
interface Serial1/0
ip address 10.0.0.2 255.255.255.0
encapsulation ppp
Wic-2T configuration (DCE)
interface Serial0/1
ip address 10.0.0.1 255.255.255.0
encapsulation ppp
clockrate 2000000
dce-terminal-timing-enable
Serial1/0 is up, line protocol is down
Hardware is DSCC4 Serial
Internet address is 10.0.0.2/24
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, loopback not set
Keepalive set (10 sec)
LCP Listen
Closed: IPCP, CDPCP
Last input never, output 00:02:51, output hang never
Last clearing of "show interface" counters 00:03:56
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 1158 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
11 packets output, 154 bytes, 0 underruns
0 output errors, 0 collisions, 4 interface resets
0 output buffer failures, 0 output buffers swapped out
29 carrier transitions
DCD=up DSR=up DTR=up RTS=up CTS=up
Serial0/1 is up, line protocol is down
Hardware is PowerQUICC Serial
Internet address is 10.0.0.1/24
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, LCP REQsent, loopback not set
Keepalive set (10 sec)
Last input never, output 00:00:00, output hang never
Last clearing of "show interface" counters 00:04:15
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 1158 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
52 packets output, 728 bytes, 0 underruns
0 output errors, 0 collisions, 16 interface resets
0 output buffer failures, 0 output buffers swapped out
10 carrier transitions
DCD=up DSR=up DTR=up RTS=up CTS=up
I try to connect two modules: WIC-1T and WIC-2T by this cables: DB60-V35MT + V35(female)-RS232(male) + SS-RS232FC. All cables standard length, about 3 meters. This means that summary length of all cables about 6 meters. I configure this modules on 2651XM, IOS 12.3.Lights on both modules green, but "Serial1/0 is up, line protocol is down "
DB60-V35MT + V35(female)-RS232(male) - are from the right side of the photo.

Wic-1T configuration (DTE)
interface Serial1/0
ip address 10.0.0.2 255.255.255.0
encapsulation ppp
Wic-2T configuration (DCE)
interface Serial0/1
ip address 10.0.0.1 255.255.255.0
encapsulation ppp
clockrate 2000000
dce-terminal-timing-enable
Serial1/0 is up, line protocol is down
Hardware is DSCC4 Serial
Internet address is 10.0.0.2/24
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, loopback not set
Keepalive set (10 sec)
LCP Listen
Closed: IPCP, CDPCP
Last input never, output 00:02:51, output hang never
Last clearing of "show interface" counters 00:03:56
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 1158 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
11 packets output, 154 bytes, 0 underruns
0 output errors, 0 collisions, 4 interface resets
0 output buffer failures, 0 output buffers swapped out
29 carrier transitions
DCD=up DSR=up DTR=up RTS=up CTS=up
Serial0/1 is up, line protocol is down
Hardware is PowerQUICC Serial
Internet address is 10.0.0.1/24
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, LCP REQsent, loopback not set
Keepalive set (10 sec)
Last input never, output 00:00:00, output hang never
Last clearing of "show interface" counters 00:04:15
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 1158 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
52 packets output, 728 bytes, 0 underruns
0 output errors, 0 collisions, 16 interface resets
0 output buffer failures, 0 output buffers swapped out
10 carrier transitions
DCD=up DSR=up DTR=up RTS=up CTS=up
Lubuntu внутри домашней сети
Не мог установить, пока не поменял адресное пространство. Мой Netgear напрочь отказывался пропускать вовне сеть 169.254.0.X / 24
После сброса в дефолтный конфиг - пинги пошли и настала пора конфига SAMBA
https://ubuntuforums.org/showthread.php?t=1623346
To enable file sharing on a Lubuntu 10.10 machine, go to Preferences > Synaptic Package Manager and add the following:-
* samba
* system-config-samba
* gvfs-bin
* gvfs-backends
После всего ярлык SAMBA не хотел запускаться
После сброса в дефолтный конфиг - пинги пошли и настала пора конфига SAMBA
https://ubuntuforums.org/showthread.php?t=1623346
To enable file sharing on a Lubuntu 10.10 machine, go to Preferences > Synaptic Package Manager and add the following:-
* samba
* system-config-samba
* gvfs-bin
* gvfs-backends
После всего ярлык SAMBA не хотел запускаться
- отсутствовал пакет gksu- при запуске через ком. строку не находилсярешено:Установил
SystemError: could not open configuration file `/etc/libuser.conf': No such
file or directory
решено:sudo touch /etc/libuser.conf
Настройка SAMBA
Если SAMBA не хочет запускаться, после смены места монтирования папок, то проще её переустановить:
sudo apt-get purge samba-common
sudo apt-get autoremove
sudo apt-get update
sudo apt-get install samba smbclient
проверкаsmbclient -L 127.0.0.1 -N
Не знаю, почему так получилось.. прописал ip-адрес и имя сервера в
windows\system32\drivers\etc\hosts и монтировал по имени, а не по
адресу:
net use m: \\alexlaptop\ktorrent
Настройка SSH:
This service will start running as soon as it is installed. To verify this, you can do
- sudo apt-get install openssh-server
- ssh localhost
yes to the question about the unknown fingerprint and do you want to continue connect, and then providing your password. You will then log in to your own local computer over SSH. This is pretty useless, except as a test, so type
- exit
to end that SSH session.
Качаем и ставим Teamviewer:sudo dpkg -i teamviewer_linux_x64.deb
1. лечим отсутствие зависимостей:sudo apt-get -f install
2. доставляемDependency is not satisfiable: libpng12-0
3. еще раз ставимsudo dpkg -i teamviewer_linux_x64.deb
сессия в кармане. )))
Запуск Utserver из командной строки
utserver -settingspath /opt/utorrent-server-alpha-v3_3/ &
Установка HAMACHI для доступа извне:
https://help.ubuntu.com/community/Hamachi
http://ubuntovod.ru/instructions/hamachi-ubuntu-linux.html
Ставим на Lubuntu и на Win клиента. Из-под Ubunta создаем сеть. Клиентом цепляемся к ней, получаем SSH сессию
Теперь чтобы подключиться защищенным пользователем без прав, надо:
1. Создать пользователя,Задать ему каталог, описание, shell, имя
sudo useradd -m -d /home/user2 -c "user for R2" -s /bin/bash user2
2. Задать скрипт для запуска .bash_profile со стартом telnet сессии на нужный порт:
#!/usr/bin/expect -f
set timeout 20
set IPaddress 192.168.1.253
telnet $IPaddress XXXX
exit
3. сменить у скрипта группу chgrp и владельца chown на соответствующего пользователя
4. задать пароль пользователю passwd
Список команд mc (http://mydebianblog.blogspot.ru/2011/01/midnight-commander.html)
Распечатать: https://cloud.github.com/downloads/drakulavich/russian-mc-cheatsheet/rmc.pdf
Связь 2 роутеров кучей кабелей
Стенд разрастается.
Типы памяти CISCO 2600
Достал несколько WIC-1T, WIC-2T.
Нашел кабели
DB60-V35MT с переходником на 232MT и кабели SS-232FC.
Задача - состыковать, чтобы закупить недостающую 2522 или NM-8A/S и собрать Frame-Relay
Each serial WIC has one LED, labeled CONN for each port, which lights when the serial port is connected. CONN LED indicates:
port is in DTE mode, the have been detected
Data Send Ready (DSR),
Data Carrier Detect (DCD),
and Clear To Send (CTS) .
port is in DCE mode, have been detected
Data Terminal Ready (DTR)
Ready To Send (RTS) .
Конфиги стандартны для DCE (clock rate) и DTE, по умолчанию encapsulation = HDLC.
Диагностика:
debug serial interface
debug interface serial 3
undebug all
И...
Оказывается белые переходники не EIA-232, а EIA-530, соответственно связаться с SS-232 они не могут (http://www.advancedrelay.com/downloads/pinouts-for-serial-interfaces.pdf).
Типы памяти CISCO 2600
Достал несколько WIC-1T, WIC-2T.
Нашел кабели
DB60-V35MT с переходником на 232MT и кабели SS-232FC.
Задача - состыковать, чтобы закупить недостающую 2522 или NM-8A/S и собрать Frame-Relay
Each serial WIC has one LED, labeled CONN for each port, which lights when the serial port is connected. CONN LED indicates:
port is in DTE mode, the have been detected
Data Send Ready (DSR),
Data Carrier Detect (DCD),
and Clear To Send (CTS) .
port is in DCE mode, have been detected
Data Terminal Ready (DTR)
Ready To Send (RTS) .
Конфиги стандартны для DCE (clock rate) и DTE, по умолчанию encapsulation = HDLC.
Диагностика:
debug serial interface
debug interface serial 3
undebug all
И...
Оказывается белые переходники не EIA-232, а EIA-530, соответственно связаться с SS-232 они не могут (http://www.advancedrelay.com/downloads/pinouts-for-serial-interfaces.pdf).
Powershell
Powershell ссылки и материалы
Windows Powershell ISE [АйЭсИ]
Центр сценариев Microsoft
Если модулей маловато, для Windows 7 смотрим тут и тут (RSAT - 1 (SP1) ) - качать 289 МБ.
Для Windows 10 - RSAT (remote Server Administration Tools) - требуется перезагрузка
Модули также зависят от ОС, таким образом в PowerShell Windows 7 нет того, что есть в Win2012 и Server2012
Windows Powershell ISE [АйЭсИ]
Центр сценариев Microsoft
Если модулей маловато, для Windows 7 смотрим тут и тут (RSAT - 1 (SP1) ) - качать 289 МБ.
Для Windows 10 - RSAT (remote Server Administration Tools) - требуется перезагрузка
Модули также зависят от ОС, таким образом в PowerShell Windows 7 нет того, что есть в Win2012 и Server2012
Computer Networks: A Systems Approach 5e - Exercises (1.27)
Решение в MathCAD
Презентация по кодированию звука (найдено в интернет), поможет для понимания задачи
For the following, as in the previous problem, assume that no data compression is done. Calculate the bandwidth necessary for transmitting in real time:
(a) High-definition video at a resolution of 1920×1080, 24 bits/pixel, 30 frames/second.
(b) POTS (plain old telephone service) voice audio of 8-bit samples at 8 KHz.
(c) GSM mobile voice audio of 260-bit samples at 50 Hz.
(d) HDCD high-definition audio of 24-bit samples at 88.2 kHz.

Презентация по кодированию звука (найдено в интернет), поможет для понимания задачи
For the following, as in the previous problem, assume that no data compression is done. Calculate the bandwidth necessary for transmitting in real time:
(a) High-definition video at a resolution of 1920×1080, 24 bits/pixel, 30 frames/second.
(b) POTS (plain old telephone service) voice audio of 8-bit samples at 8 KHz.
(c) GSM mobile voice audio of 260-bit samples at 50 Hz.
(d) HDCD high-definition audio of 24-bit samples at 88.2 kHz.
Computer Networks: A Systems Approach 5e - Exercises (1.26)
Решение в MathCAD
For the following, assume that no data compression is done, although in practice this would almost never be the case. For (a) to (c), calculate the bandwidth necessary for transmitting in real time:
(a) Video at a resolution of 640×480, 3 bytes/pixel, 30 frames/second.
(b) Video at a resolution of 160×120, 1 byte/pixel, 5 frames/second.
(c) CD-ROM music, assuming one CD holds 75 minutes’ worth and takes 650 MB.
(d) Assume a fax transmits an 8×10-inch black-and-white image at a resolution of 72 pixels per inch. How long would this take over a 14.4-kbps modem?
For the following, assume that no data compression is done, although in practice this would almost never be the case. For (a) to (c), calculate the bandwidth necessary for transmitting in real time:
(a) Video at a resolution of 640×480, 3 bytes/pixel, 30 frames/second.
(b) Video at a resolution of 160×120, 1 byte/pixel, 5 frames/second.
(c) CD-ROM music, assuming one CD holds 75 minutes’ worth and takes 650 MB.
(d) Assume a fax transmits an 8×10-inch black-and-white image at a resolution of 72 pixels per inch. How long would this take over a 14.4-kbps modem?
Computer Networks: A Systems Approach 5e - Exercises (1.25)
Compare the channel requirements for voice traffic with the requirements for the real-time transmission of music, in terms of bandwidth, delay, and jitter. What would have to improve? By approximately how much? Could any channel requirements be relaxed?
3 колонки:
BW Delay Jitter
голос не выск требования критично критично
онлайн музыка чем больше тем лучше не критично критично
Для передачи голоса достаточно нескольких kbps (трафик сильно сжимается, кодируется, присутствуют паузы в разговоре). Задержка важна чтобы не было задержек с ответом абонентов.
Онлайн трансляция музыки требует большей пропускной способности для более качественной передачи звука (меньшее сжатие для сохранения частот, нет пауз). Задержка не важна, проигрыватель будет воспроизводить данные в порядке поступления. Джиттер критичен, так как при сильном увеличении задержек возможно нарушение трансляции.
3 колонки:
BW Delay Jitter
голос не выск требования критично критично
онлайн музыка чем больше тем лучше не критично критично
Для передачи голоса достаточно нескольких kbps (трафик сильно сжимается, кодируется, присутствуют паузы в разговоре). Задержка важна чтобы не было задержек с ответом абонентов.
Онлайн трансляция музыки требует большей пропускной способности для более качественной передачи звука (меньшее сжатие для сохранения частот, нет пауз). Задержка не важна, проигрыватель будет воспроизводить данные в порядке поступления. Джиттер критичен, так как при сильном увеличении задержек возможно нарушение трансляции.
Computer Networks: A Systems Approach 5e - Exercises (1.24)
Решение в MathCAD
Consider a network with a ring topology, link bandwidths of 100 Mbps, and propagation speed 2×108 m/s. What would the circumference of the loop be to exactly contain one 1500-byte packet, assuming nodes do not introduce delay? What would the circumference be if there was a node every 100 m, and each node
introduced 10 bits of delay?

Consider a network with a ring topology, link bandwidths of 100 Mbps, and propagation speed 2×108 m/s. What would the circumference of the loop be to exactly contain one 1500-byte packet, assuming nodes do not introduce delay? What would the circumference be if there was a node every 100 m, and each node
introduced 10 bits of delay?
Computer Networks: A Systems Approach 5e - Exercises (1.23-С)
Решение в MathCAD
Результаты немного отличаются от тех, что в ответах, но это логично
(c) How sensitive are these results to the number of switches along the path? To the bandwidth of the links? To the ratio of packet size to packet header size?

Результаты немного отличаются от тех, что в ответах, но это логично
(c) How sensitive are these results to the number of switches along the path? To the bandwidth of the links? To the ratio of packet size to packet header size?
Computer Networks: A Systems Approach 5e - Exercises (1.23-B)
Решение в MathCAD
Условия см. тут: http://net-of-mine.blogspot.ru/2014/05/computer-networks-exercises-123-a.html
Задача:
(b) For what filesize n B is the total latency incurred before the entire file arrives at the destination less for circuits than for packets?
Начнем с временной диаграммы для коммутации каналов:

Установка соединения - частный случай, а в общем случае картина приведена выше (критика принимается)
Временная диаграмма для коммутации пакетов:

Здесь ситуация усложняется задержками передачи пакета на каждом свиче.
Итоговое решение:
Условия см. тут: http://net-of-mine.blogspot.ru/2014/05/computer-networks-exercises-123-a.html
Задача:
(b) For what filesize n B is the total latency incurred before the entire file arrives at the destination less for circuits than for packets?
Начнем с временной диаграммы для коммутации каналов:
Установка соединения - частный случай, а в общем случае картина приведена выше (критика принимается)
Временная диаграмма для коммутации пакетов:
Здесь ситуация усложняется задержками передачи пакета на каждом свиче.
Итоговое решение:
Подписаться на:
Сообщения (Atom)
