среда, 26 августа 2015 г.

Shell One string power!


Linux one string power!

$ for f in *.c; do echo "Processing $f file.."; done

Use example

$ for f in *.wav; do play $f; done   -  play all wav files in dir

Kill many PIDs proceses
kill -9 `ps axu | grep savelogs.sh | awk '{print $2}'`


find . -name '*.orig' -delete      - find and remove such files

вторник, 25 августа 2015 г.

cisco password reset

To access ROMMON mode in minicom pres ctrl-a-f

1) Type confreg 0x2142  - to avoid startup config at boot

2) reset

3) Ctrl−C in order to skip the initial setup procedure.

4) copy startup−config running−config  - if  want check old configuration
copy running−config startup−config  -  if want  start with default config

5) show running−config - check old configuration

6) Type configure terminal
enable secret <password>   - change enable password

7) Issue the no shutdown command on every interface that you use.

8) config−register 0x2102   - return to normal boot with  config

9)  ctrl-z  - exit from configure mode

10)   running−config startup−config   - save changes to startup config

11)  reload

How make BREAK  combination.

Standard Break Key Combinations
SoftwarePlatformOperating SystemTry This
HyperterminalIBM CompatibleWindows XPCtrl-Break
HyperterminalIBM CompatibleWindows 2000Ctrl-Break
HyperterminalIBM CompatibleWindows 98Ctrl-Break
Hyperterminal (version 595160)IBM CompatibleWindows 95Ctrl-F6-Break
KermitSun WorkstationUNIXCtrl-\l
Ctrl-\b
MicroPhone ProIBM CompatibleWindowsCtrl-Break
MinicomIBM CompatibleLinuxCtrl-a f
ProComm PlusIBM CompatibleDOS or WindowsAlt-b
SecureCRTIBM CompatibleWindowsCtrl-Break
TelixIBM CompatibleDOSCtrl-End
TelnetN/AN/ACtrl-], then type send brk
Telnet to CiscoIBM CompatibleN/ACtrl-]
TeratermIBM CompatibleWindowsAlt-b
TerminalIBM CompatibleWindowsBreak
Ctrl-Break
TipSun WorkstationUNIXCtrl-], then Break or Ctrl-c
~#
VT 100 EmulationData GeneralN/AF16
Windows NTIBM CompatibleWindowsBreak-F5
Shift-F5
Shift-6 Shift-4 Shift-b (^$B)
Z-TERMINALMacAppleCommand-b
N/ABreak-Out BoxN/AConnect pin 2 (X-mit) to +V for half a second
Cisco to aux portN/AControl-Shft-6, then b
IBM CompatibleN/ACtrl-Break

Tips to Troubleshoot

  • Problems that you encounter during password recovery often occur because you are not sure about what the break key sequence is for the (non-Cisco) software you use. For software not listed in the table, and for additional information, refer to the documentation of the individual software packages.
  • The auxiliary (AUX) port is not active during the boot sequence of a router. Therefore, it is no use if you send a break through the AUX port. You need to have connection to the console port, and have these settings:
    9600 baud rate
    No parity
    8 data bits
    1 stop bit
    No flow control
  • Some versions of Windows NT have hyperterminal software that cannot send the correct break key signal. Refer tohttp://www.hilgraeve.com/hyperterminal.html leavingcisco.com for more information and for an upgrade of the hyperterminal software.
  • In some cases, the break sequence might not get transmitted properly when using a USB/Serial converter cable. In such cases, use a keyboard with a different connector port (for example, a PS/2).

How to Simulate a Break Key Sequence

Break key sequence simulation is useful if your terminal emulator does not support the break key, or if a bug does not allow your terminal emulator to send the correct signal.
Note: The hyperterminal under Windows NT had this behavior in the past.
Complete these steps to simulate a break key sequence:
  1. Connect to the router with these terminal settings:
    1200 baud rate
    No parity
    8 data bits
    1 stop bit
    No flow control
    You no longer see any output on your screen, and this is normal.
  2. Power cycle (switch off and then on) the router and press the SPACEBAR for 10-15 seconds in order to generate a signal similar to the break sequence.
  3. Disconnect your terminal, and reconnect with a 9600 baud rate. You enter the ROM Monitor mode.

If all these methods fail to properly send a break, retry the procedures from a different terminal or PC platform.

среда, 5 августа 2015 г.

wl-500gp (V1) 128MB RAM UPGRADE and recovery

Сразу опишу все методы востановления прошивки, на случай если устройство уже "брик" или стало "бриком" в процессе апгрейта, и веб интерфейс не доступен.
Большая часть информации взята здесь.
http://wl500g.info/showthread.php?12962-HowTo-Upgrading-RAM-to-128-MB-(WL-500gP-WL-500W-and-WL-700gE)
Если у вас есть  UART - сразу подпаивайтесь, чтобы можно было наблюдать за реакцией роутера во время востановления. Подключаемся как обычно - Tx, Rx, Ground
Подключаемся к порту 0 (на плате выведено два). Скорость порта 115200 (8N1).
Но можно обойтись и без UART модуля.

1) Заводской режим "RECOVERY" -  зажимаем "резет" , вынимаем питание, ждем секунду,
возвращаем питание, держа резет, пока роутер не начнет медлено мигать "power"ом.
После этого ставим у себя на интерфейсе 192.168.1.2/24, подключаем роутер любым LAN портом и пингуем 192.168.1.1.
Если пинг есть - переходим к пункту прошивки. Если нет - слудующий метод.

2) "Хакерский" метод "9го пина" (9 pin trick). Ищем 9 контакт флеша - со стороны ОЗУ и замыкаем его на землю. Отключаем питание , ждем секунду, включаем питание, ждем 15 сек
пока "power" не начнет мигать. Отключаем питание.
После этого роутер должен пинговатся как 192.168.1.1


3) Прошивка  в таком режиме производится либо через родную утилиту, либо с помощью
встроеного в роутер тфтп сервера.
tftp
connect 192.168.1.1
binary
trace
put  имя_прошивки

ждем 5 мин или наблюдаем консоль, пока не появится DONE:

d.: Timeout occured
Reading :: TFTP Server.
Failed.: Timeout occured
Reading :: TFTP Server.
Failed.: Timeout occured
Reading :: TFTP Server.
TFTP_BLKLEN!!
Done. 5656576 bytes read
Download of 0x565000 bytes completed
Write kernel and filesystem binary to FLASH (0xbfc40000)
flash device 'flash1.trx'

Programming...

done. 5783552 bytes written


Ждем пока роутер скачает прошивку и перешьется. и напишет DONE.
Перегружаем - в консоли видем лог загрузки.

Пробуем зайти на веб 192.168.1.1!!

4) Лучшей прошивкой, для этого роутера считается "прошивка Энтузиастов" - наследница
"прошивки Олега".
https://drive.google.com/folderview?id=0B0IgNylGYpqsT2NNN1NZZXNOelU#list
Она более менее актуальна, и поддерживает 128мб. Таже хорошо поддерживает IPTV (использует igmproxy), и умеет работать с opkg.
Еще варианты: DD-WRT, OpenWRT, X-WRT, TomatoUSB и прочее.
Прошиваемся первым методом, и проверяем работу роутера.

5) Итак айгрейд. Обязательно впаять резитор R43 номиналом 33 или 22 Ом с обратной стороны платы. У меня там была впаяна "заглушка" - елемент без сопротивления. Но в других эксземплярах действительно елемент отсутствует.
Без резистора плата будет видеть только половину памяти.


6) Аккуратно феном нагреваем и отпаиваем чипы по 16 МБ и впаиваем по 64МБ.
Где взять чипы? Я нашел на OLX модуль DDR для ноутбука (SO-DIMM) на 512МБ
по маркировке чипа Elpida D5116AFTA-5B-E 

рекомендуемые чипы:
Hynix HYMD532646CP6J-D43 PC3200 DIMM: it has Hynix HY5DU121622CTP-D43 chips
Samsung M470L6524BT0-CB3 PC2700 SO-DIMM: it has Samsung K4H511638B-TCB3 chips
Samsung M470L6524DU0-CB3 PC2700 SO-DIMM: it has Samsung K4H511638D-UCB3 chips
Transcend TS32MSD64V3M PC2700 SO-DIMM: it has Elpida D5116AFTA-5B-E chips
Процесс:
https://www.youtube.com/watch?v=c1C1IxkAHg4

7) После пропайки резистора и новых чипов в консоли пишем.

nvram set sdram_init=0x0011 
nvram set sdram_ncdl=0 
nvram commit 
reboot

8) Посмотреть на 128МБ

free