728x90
반응형

WARNING: THIS DEVICE HAS BOOTED FROM THE BACKUP JUNOS IMAGE

August 14, 2018
login as: root
Using keyboard-interactive authentication.
Password:
Last login: Fri Jun 29 09:58:18 2018 from 83.244.171.242
— JUNOS 15.1X49-D45 built 2016-04-25 07:29:58 UTC

***********************************************************************
** **
** WARNING: THIS DEVICE HAS BOOTED FROM THE BACKUP JUNOS IMAGE **
** **
** It is possible that the primary copy of JUNOS failed to boot up **
** properly, and so this device has booted from the backup copy. **
** **
** Please re-install JUNOS to recover the primary copy in case **
** it has been corrupted and if auto-snapshot feature is not **
** enabled. **
** **
***********************************************************************

root@FW01-SHIRAJ-SRX% cli
shroot@FW01-SHIRAJ-SRX> show chassis alarms
1 alarms currently active
Alarm time Class Description
2018-06-28 12:48:36 GMT Minor Host 0 Boot from backup root <– This is where its booted from

root@FW01-SHIRAJ-SRX> show system storage partitions
Boot Media: internal (da0)
Active Partition: da0s2a
Backup Partition: da0s1a
Currently booted from: backup (da0s1a) <– This is the partitions name

Partitions information:
Partition Size Mountpoint
s1a 2.4G /
s2a 2.4G altroot
s3e 185M /config
s3f 2.1G /var
s4a 224M recovery
s4e 15M

root@FW01-SHIRAJ-SRX> show system snapshot media internal
Information for snapshot on internal (/dev/da0s1a) (backup)
Creation date: Jun 28 12:44:56 2018
Information for snapshot on internal (/dev/da0s2a) (primary)
Creation date: Nov 20 22:15:26 2016
JUNOS version on snapshot:
junos : 15.1X49-D60.7-domestic <– This is the version it was on before the crash

root@FW01-SHIRAJ-SRX> request system snapshot media internal slice alternate <– Copy the working partition to crashed partition
Formatting alternate root (/dev/da0s2a)…
Copying ‘/dev/da0s1a’ to ‘/dev/da0s2a’ .. (this may take a few minutes)
The following filesystems were SHIRAJhived: /

root@FW01-SHIRAJ-SRX> show system storage partitions
Boot Media: internal (da0)
Active Partition: da0s2a
Backup Partition: da0s1a
Currently booted from: backup (da0s1a)

Partitions information:
Partition Size Mountpoint
s1a 2.4G /
s2a 2.4G altroot
s3e 185M /config
s3f 2.1G /var
s4a 224M recovery
s4e 15M

root@FW01-SHIRAJ-SRX> show system alarms
1 alarms currently active
Alarm time Class Description
2018-06-28 12:48:36 GMT Minor Host 0 Boot from backup root

root@FW01-SHIRAJ-SRX> show system snapshot media internal slice 1
Information for snapshot on internal (/dev/da0s1a) (backup)
Creation date: Jun 28 12:44:56 2018
Information for snapshot on internal (/dev/da0s2a) (primary)
Creation date: Jun 29 10:57:23 2018
JUNOS version on snapshot:
junos : 15.1X49-D45-domestic <– once copied check the partion have same version on slice 1 and slice 2

root@FW01-SHIRAJ-SRX> show system snapshot media internal slice 2
Information for snapshot on internal (/dev/da0s1a) (backup)
Creation date: Jun 28 12:44:56 2018
Information for snapshot on internal (/dev/da0s2a) (primary)
Creation date: Jun 29 10:57:23 2018
JUNOS version on snapshot:
junos : 15.1X49-D45-domestic <– once copied check version is same

root@FW01-SHIRAJ-SRX>
root@FW01-SHIRAJ-SRX> request system reboot media internal
Reboot the system ? [yes,no] (no) yes

Shutdown NOW!
[pid 9183]

root@FW01-SHIRAJ-SRX>
*** FINAL System shutdown message from root@FW01-SHIRAJ-SRX ***

System going down IMMEDIATELY



TO UPDATE THE VERSION

root@FW01-SHIRAJ-SRX> request system software add no-copy no-validate /var/tmp/junos-srxsme-15.1X49-D60.7-domestic.tgz reboot <– update the software verion
root@FW01-SHIRAJ-SRX>
login as: root
Using keyboard-interactive authentication.
Password:
Last login: Fri Jun 29 11:10:42 2018 from 81.103.90.67
— JUNOS 15.1X49-D60.7 built 2016-09-13 22:27:47 UTC

root@FW01-SHIRAJ-SRX%
root@FW01-SHIRAJ-SRX%
root@FW01-SHIRAJ-SRX> show system storage partitions
Boot Media: internal (da0)
Active Partition: da0s1a
Backup Partition: da0s2a
Currently booted from: active (da0s1a)

Partitions information:
Partition Size Mountpoint
s1a 2.4G /
s2a 2.4G altroot
s3e 185M /config
s3f 2.1G /var
s4a 224M recovery
s4e 15M

root@FW01-SHIRAJ-SRX> show system snapshot media internal
Information for snapshot on internal (/dev/da0s1a) (primary)
Creation date: Jun 29 11:41:10 2018
JUNOS version on snapshot:
junos : 15.1X49-D60.7-domestic
Information for snapshot on internal (/dev/da0s2a) (backup)
Creation date: Jun 29 10:57:23 2018
JUNOS version on snapshot:
junos : 15.1X49-D45-domestic <– check the backup partion have same version as primary

root@FW01-SHIRAJ-SRX> show system snapshot media internal slice 2
Information for snapshot on internal (/dev/da0s1a) (primary)
Creation date: Jun 29 11:41:10 2018
JUNOS version on snapshot:
junos : 15.1X49-D60.7-domestic
Information for snapshot on internal (/dev/da0s2a) (backup)
Creation date: Jun 29 10:57:23 2018
JUNOS version on snapshot:
junos : 15.1X49-D45-domestic

root@FW01-SHIRAJ-SRX> request system snapshot media internal slice alternate <– copy the primary partition to backup
Formatting alternate root (/dev/da0s2a)…
Copying ‘/dev/da0s1a’ to ‘/dev/da0s2a’ .. (this may take a few minutes)
The following filesystems were SHIRAJhived: /

root@FW01-SHIRAJ-SRX> show system snapshot media internal
Information for snapshot on internal (/dev/da0s1a) (primary)
Creation date: Jun 29 11:41:10 2018
JUNOS version on snapshot:
junos : 15.1X49-D60.7-domestic <– check the partition have same version
Information for snapshot on internal (/dev/da0s2a) (backup)
Creation date: Jun 29 11:58:33 2018
JUNOS version on snapshot:
junos : 15.1X49-D60.7-domestic <– check the partition have same version

root@FW01-SHIRAJ-SRX>

 

 


 

https://blog.shiraj.com/2018/08/this-device-has-booted-from-the-backup-junos-image/

 

THIS DEVICE HAS BOOTED FROM THE BACKUP JUNOS IMAGE « Memorise

THIS DEVICE HAS BOOTED FROM THE BACKUP JUNOS IMAGE August 14, 2018 login as: root Using keyboard-interactive authentication. Password: Last login: Fri Jun 29 09:58:18 2018 from 83.244.171.242 — JUNOS 15.1X49-D45 built 2016-04-25 07:29:58 UTC ************

blog.shiraj.com

 

#Firewall #Juniper #SRX

728x90
SMALL
Posted by gromet
728x90
반응형

SMTP 테스트(bash and telnet to test an email)

 

[[ $4 ]] || {
    printf "Usage\n\t$0 <domain> <email> <from_email> <rcpt_email>\n"
    exit 1
}
{
    sleep 1
    echo "helo $2"
    sleep 0.5
    echo "mail from:<$3>"
    sleep 0.5
    echo "rcpt to:<$4>"
    echo
} | telnet $1 25 |
    grep -q "Unknown user" &&
    echo "Invalid email" ||
    echo "Valid email"

 

Usage :

./script.sh domain email from_email rcpt_email

 

https://stackoverflow.com/questions/14326350/bash-and-telnet-to-test-an-email

 

bash and telnet to test an email

I'm trying to find out whether an email address is valid. I've accomplished this by usign telnet, see below $ telnet mail.example.com 25 Trying 0.0.0.0... Connected to mail.example.com. Escape

stackoverflow.com

#SMTP #메일테스트 #bash

 

728x90
SMALL
Posted by gromet
728x90
반응형

POP3 접속 테스트 (BASH check POP3 mail with telnet)

 

#!/bin/bash
 
fetch(){
  sleep 1
  echo "USER user@website"
  sleep 1
  echo "PASS mypassword"
 
  sleep 1
  echo "LIST"
 
  for i in `seq 1 10`
  do
    sleep 1
    echo "RETR $i"
    sleep 1
    echo "DELE $i"
  done
 
  sleep 1
  echo "QUIT"
}
 
fetch |telnet <server> 110

 

https://gist.github.com/metalx1000/34d3e65d197e26952790

 

BASH check POP3 mail with telnet

BASH check POP3 mail with telnet. GitHub Gist: instantly share code, notes, and snippets.

gist.github.com

 

#pop3 #메일테스트

728x90
SMALL
Posted by gromet
728x90
반응형

 

PHP SQL Injection 방지 처리 코드

PHP5


if(isset($_GET) AND count($_GET)>0 AND !empty($_GET)) {
        foreach($_GET AS $g_index => $key) {
                //echo $g_index.'|'.$key.'<br>';
                $key = preg_replace("/[\r\n\s\t\'\;\"\=\-\-\#\/*]+/","", $key);
                $key = str_replace('union', '', $key);
                $key = str_replace('select', '', $key);
                $key = str_replace('from', '', $key);
                $key = str_replace('where', '', $key);
                $_GET[$g_index]=$key;
        }
}

#PHP #PHP5 #SQLInjection

 

 

728x90
SMALL
Posted by gromet

2022. 11. 18. 18:54 WorkHolic

SSD 돌연사 #2

728x90
반응형

SSD 돌연사 #2

 

오늘도 연락이 왔다.
갑자기 컴퓨터가 안 켜진다는....
상황을 들어보니 부팅 디스크를 못 찾아서 부팅이 안되는 상태였다.

PC를 받아서 확인해 보니 BIOS에서 인식은 되나 부팅은 안되는...
부트 파티션 및 모든 파티션이 인식이 안되는 것 같았다.

가성비 제품으로 이메이션 SSD를 많이 쓰고 있는데 2번째다.
모든 SSD가 돌연사 가능성이 있다는 것은 알고 있다.

3년 보증 제품이라 연락해서 교환을 받아야 한다.

가지고 있던 240GB 이메이션 SSD(또? ^^)로 교체했고
데이터는 다행이 1TB HDD에 있어서 무사했고
OS도 Windows Image Backup이 되어 있어서 최근 상태로 복원할 수 있었다.
다행.

 

#SSD #돌연사 #백업 #윈도우이미지백업 #OS복구

728x90
SMALL
Posted by gromet
728x90
반응형

UPS 사용시 정전 이후 복전 시 서버 켜기

 

상황 1

정전
프로그램 작동
서버 종료/꺼짐
UPS 종료/꺼짐
복전
UPS 켜짐
서버 BIOS 설정(after power loss : on)에 따라 서버 켜짐

 

 
 
상황 2

정전
프로그램 작동
서버 종료/꺼짐
복전 (UPS 작동 중)
서버는 수동으로 켜야 함
    UPS fails to automatically power on if AC Power is restored before PowerChute Network Shutdown has issued a UPS/Outlet Group turn off command.
        => it needs to be manually powered back on.
 
    2. 배터리 방전 되기전에 서버 종료기능을 넣었는데 다시 전원이 들어 올 경우에 서버 자동 부팅가능한지는 확인해보셔야 될 것 같습니다.
    일반적인 기능으로는 안 되는 것으로 알고 있습니다.
   
 
 
“상황 2”를 해결하기 위해 공유기 등 제 3의 장치를 이용하여 WOL 기능으로 서버를 부팅시킬 수 있음
    예) 장치에서 5분 마다 1번씩 WOL 패킷 발송
 
 
    HPE ProLiant Gen9 Servers - How to Set Wake On LAN option?

    Enabling or disabling Wake-On LAN 
    1. From the System Utilities screen, select System Configuration > BIOS/Platform Configuration (RBSU) > Server Availability >         Wake-On LAN and press Enter.
   

 

#UPS #정전 #복전 #서버자동시작

728x90
SMALL
Posted by gromet

블로그 이미지
나는 운이 좋은 사람이다 나는 나날이 점점 더 좋아진다 내가 하는 선택과 행동은 반드시 성공으로 이어진다 내게는 인내력과 지속력이 있다 네게는 좋은것들만 모여든다
gromet

공지사항

Yesterday
Today
Total
반응형

달력

 « |  » 2024.7
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

160x600