Thursday, October 19, 2017

Juniper SRX DB mode (Debug mode)

During our regular maintenance, after rebooted one SRX345, and found it stuck at db mode, which is debug mode.

After a short and quick analysis, I found Juniper JunOS devices may get stuck in the boot process or fail to boot the OS, in rare cases, after a sudden power loss or ungraceful power shut down. Juniper  routers, switches and firewalls  can experience file system corruption, which prevents the device from recovering to a functional state. It is recommended that customers minimize their log configurations to prevent excessive read/writes to the file system, which reduces the stress on storage media and reduces the potential occurrence of this issue. Moreover, if abrupt power failures are transient for a very short period of time, the availability of an UPS can also prevent the device from experiencing a sudden power loss.

You do not have to worry about damaging hardware in these situations, as the hardware cannot tell the difference between a graceful shutdown and pulling the power cord. The potential for damage is with the file system structure. It is possible for data to be corrupted, when the computer's power is interrupted with the operating system running. The data could be in the nodes, which could result in files being lost or file contents being corrupted.

Although rare, this issue more likely occurs on platforms that use a UNIX/BSD-based operating system, such as Junos, to access the flash-based storage media.

“Although rare, file system damage can occur with an abrupt power off, which may cause problems on the next boot. Use the request system halt or request system reboot command to gracefully shut down or reboot the OS. Once the OS is halted, it is safe to remove power.”  - from O'Reilly Media’s JUNOS Enterprise Switching book.

There are a couple of KB discussing the fix. KB29811 is using a USB to copy a snapshot from healthy device to faulty device. KB20046  suggest to press space to go to u-boot prompt and enter some commands to fix issue.



db> help
    DDB Quick Help  
  -------------------  
Type 'c' to continue, 'reset' or 'panic' to restart. 

print       p           examine     x           search      set         write       
w           delete      d           break       dwatch      watch       dhwatch     
hwatch      step        s           continue    c           until       next        
match       trace       alltrace    where       bt          call        show        
ps          gdb         reset       kill        watchdog    thread      panic       
ddbdumpsys  dumpsys     
db> reset


Friday, October 6, 2017

WAMP and Wordpress Install on AWS Free Tier Windows 2012 R2

AWS provides a 750 hours free tier on Windows machine. I am always wondering how to install wordpress on it to use this free tier instance . Here is all steps I followed today. Most steps are same as WPMU DEV's post "Setting Up WordPress Locally for PC/Windows with WampServer". I do add some of my own experience in the steps.

Basically WampServer = (Apache, PHP, MySQL on Windows). WAMP is the software suite installed on popular Windows operate system, includes Apache, MySQL, PHP and some other tools. It is derived from LAMP which stands for Linux, Apache, MySQL, and PHP. As the name implies, while LAMP is used on Linux servers, WAMP is used on Windows servers.

Note: Microsoft WebPI is another popular way to install wordpress on Windows server. But truly not recommend. I managed to get it working and eventually still find WAMP is better and easier to use.


Google Blogger Usage Tips and Tricks


Here are some collections for bloggers from my pas blogger experience:



1. Adjust Right Sidebar margin width

Sometimes, the space between main body posts section and right side bar is too wide. You may want to change it from 40px to 10 px. Here is the code I found from here:

#sidebar-right-1{
position
: relative;
left
: 40px !important;
}
Add the code to Blogger Them Designer - Advanced - Add CSS section as show below.


Saturday, September 30, 2017

Ubuntu LAMP and WordPress Installation

I have selected Ubuntu as OS platform to install my php, wordpress and mysql. It gave me lots of learning experience on Linux. Here is many steps I recorded during working on my 51sec.org blog site.

1. Configure Interfaces

Welcome to Ubuntu 15.10 (GNU/Linux 4.2.0-16-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

48 packages can be updated.
37 updates are security updates.

Last login: Sat Feb 13 20:16:03 2016 from 192.168.2.62
john@ubuntu15:~$ cd /etc/network
john@ubuntu15:/etc/network$ sudo vi interfaces
[sudo] password for john: 

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface -- use DHCP 
auto eth0

iface eth0 inet dhcp

# The secondart network interface -- use static ip address
auto ens160
iface ens160 inet static
address 192.168.2.22
netmask 255.255.255.0
gateway 192.168.2.1
dns-nameserver 8.8.8.8
~

~
john@ubuntu15:/etc/network$sudo /etc/init.d/networking restart


Friday, September 29, 2017

Basic Linux Commands (Tips and Tricks)

1. Basic Commands

man : manual
ls :List Directory Contents
pwd :print working directory
cd :change directory
mkdir :Make directory
cp :Copy
mv :Move
find and locate and whereis
kill

Thursday, September 28, 2017

Troubleshooting Wordpress Out of memory on Free Tier AWS Linux Issue

All-In-One WP Migration
Redhat Openshift made a change from Openshift online 2 to online 3. Deadline is end of Sep 2017. My blog www.51sec.org which was hosted at Red Hat Openshift Online 2 environment for last a couple of years has been migrated from Redhat Openshift Platform to AWS Linux Free Tier a couple of days ago before deadline. At the beginning, migration process was easy and smooth since I am keeping same domain 51sec.org.

Also Wordpress plug-in "All-in-One WP Migration" helped a lot during this process. Whole blog was exported to a 120M package. Unfortunately I still got a problem when access www.51sec.org site later which is running on AWS Linux instance.

Wednesday, September 27, 2017

Launch and Access Amazon AWS EC2 Instances

Amazon Web Services (AWS) is a secure cloud services platform, offering compute power, database storage, content delivery and other functionality to help businesses scale and grow. Millions of users are currently leveraging AWS cloud products and solutions to build sophisticated applications with increased flexibility, scalability and reliability.

In this post, I recorded all steps regarding how to launch a free tier AWS instance and how to use a client to access the instance.
1. Launch a EC2 Instance
1.1 Access Amazon AWS site :

Sunday, September 24, 2017

Creat AWS Diagrams Online

I was looking for some online tools to create impressive AWS diagram for my learning process. Most of online diagram websites provide certain free usages. Here are some websites I found useful to me.

 

1. AWS 3D Diagram from Cloudcraft.co


It is quite impressive when I started to make my first diagram. Limit grid size is a big pain when you try to draw a detail diagram for your AWS VPC, but it is good enough to draw a three tier application deployment. 

Cloudcraft allows registered user to create AWS diagrams for free using all available components with some feature limited. Upgrade to Cloudcraft Pro for import of live AWS data and unlimited size diagrams. It can automatically calculate the cost for your design, and  also provides live connection to your AWS account. The smart components feature makes it much easier to connect other components you lay on the grid than any other websites I tried. Love it. So far, I think it is best site for me .

Monthly $49 can get your subscription to pro level to unlock those restrictions.


NetSec Youtube Videos