Thursday, December 17, 2015

After updating my Mac OS El Capitan, my Seagate External HDD is now READ-ONLY mode. OMG!

Let's try to make this short:

Before updating my El Capitan, I was able to Write/Delete/Read on my Seagate 1TB External USB HDD disk. After updating my Mac OS El Capitan, I am not able to Write Move Delete any files or folder in my Seagate 1TB External USB HDD.

Okay, let's make it work now. All you need to do is to download the file that can be found at Seagate website. You don't need to buy it even if it's from Paragon https://www.paragon-software.com/home/ntfs-mac/. Basically, when you go to Paragon site, you need to purchase it or you can try it for 10 days.

Since you already bought the Seagate and it was working before the update, all you need is download the version from Seagate Site which is this link http://www.seagate.com/support/downloads/item/ntfs-driver-for-mac-os-master-dl and of course you need to click the I Accept

Taaadddaaa!!!! Now click the Download.

Note before Installing it MAKE SURE THAT YOUR SEAGATE HDD is ATTACHED to your COMPUTER, and then now INSTALL IT. After installing the NTFS_for_Mac_14.0.456.dmg file. It requires you to RESTART your Mac system.

Good luck and happy Seagate... ing!

Monday, October 5, 2015

Safari browser very slow loading page in Mac OS - El Capitan

Sometimes when loading a page using Safari in my Mac OS El Capitan, it won't load at all and even when using the Chrome browser. You can make it work again by doing any of the option I have listed below:

1st Option (Turn-off and On the current WiFi or Restart it): Right click on the Wifi icon at the top right of your screen and click Turn Off then Turn On. If you want to keep doing this approach, you can create an alias in your profile "~/.bash_profile" bash and restart it by opening a terminal and execute the command. Follow the step below on how to add an alias into your profile:

Open a terminal  +space and type the following command and restart your Terminal again

echo "alias restart_wifi='sudo ifconfig en0 down && sudo ifconfig en0 up'" >> ~/.bash_profile

After executing the command above, use the command "restart_wifi" from your Terminal to actually restart the WiFi from Terminal/Console


2nd Option (Flush the DNS): Open a terminal  +space and type the following command:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder;



Thursday, October 1, 2015

How To Enable the Write / Create Folder to you USB NTFS External Disk in MacBook MacOS?

Very easy step on how to allow you to create folder or copy file from MacBook to your USB NTFS drive. This is a simple hack or trick for your MacOS to allow you to write to your USB drive which you always used in Windows OS or the drive that you just bought in the store and pre-formatted for Windows OS.

Let's do it!

open a terminal in your MacOS

0) Enter the following command (Use nano editor):



sudo nano /etc/fstab

Friday, September 18, 2015

Change the default screenshot location for Mac OS

How to change the default screenshot location for Mac?

If you noticed that when taking a screenshot on your Mac desktop, all the screenshot files will be save into your Desktop as Mac default setup. That case, it will make a mess on your Dekstop layout. The way I organized it, is I changed the default screenshot location and just store it in a folder or different location. To do it, you only need three step

Step 1: Open Terminal Window
  • Open a Terminal by pressing ⌘ space and type "Terminal" or Click "Launchpad" and type "Terminal

Step 2: Set the new location
  • Type the following command: 
  • defaults write com.apple.screencapture location <fullpath>
Example:

defaults write com.apple.screencapture location /Users/guest/screen

Step 3: Commit the new location to System UI
  • Type the following command: 
  • killall SystemUIServer



Friday, July 10, 2015

My Attempt Of Parsing an Information from Log Files in Linux or in z/OS Unix

My first attempt of parsing an information from a huge log files. I have created a unix script just to extract the information from within a range in a Linux or a Unix environment.

1st: I created a file in unix /usr/bin/parse.
  • Command: sudo nano /usr/bin/parse
  • Copy the script below and paste it in the newly create parse file

2nd: Make the /usr/bin/parse executable.
  • Command: sudo chmod ug+rwx,o+rx /usr/bin/parse

Script for parsing:


#!/bin/bash
# parse - will dump or tail a file between range from and to
# regular expression to validate if the input is number
re='^[0-9]+$'
if [ "$#" -eq 0 ]; then
  read -p "Please enter filename : " filename
  # this will check if the input for filename is empty
  if [ -z $filename ]; then
     echo "File name $filename must not be empty. Please try again"; exit 1
  fi
  # this will check if the file exist
  if [ -r $filename ]; then
     # Get the input for start range
     read -p "What line would you like to start : " startno

     if ! [[ $startno =~ $re ]] ; then
        echo "error: Start number is an invalid input" >&2; exit 1
     fi

     read -p "What line would you like to end   : " endno
     if ! [[ $endno =~ $re ]] ; then
        echo "error: End number is an invalid input" >&2; exit 1
     fi
     eval "sed -n '$startno,$endno p' $filename"
  else
     echo "File name $filename does not exist"
     exit 1
  fi
elif [ "$#" -eq 2 ]; then
  echo "$1"
  echo "$2"
  echo "awk 'NR>=$1' $2"
  eval "awk 'NR>=$1' $2"
elif [ "$#" -eq 3 ]; then
  echo "$1"
  echo "$2"
  echo "$3"
  echo "sed -n '$1,$2p' $3"
  eval "sed -n '$1,$2p' $3"
else
 echo -n "Invalid Argument. Example: parse 100 1000 myfiles.log"
fi

Sunday, April 26, 2015

"ArtifactTransferException: Failure to transfer com.sun.jmx:jmxri:jar:1.2.1", How to resolved this Maven Error?

While I was creating a maven module for my project, I noticed an Error Message in my Eclipse Problem window or when you open the POM.xml and see the Red “X” and it shows:

Multiple annotations found at this line:
                - ArtifactTransferException: Failure to transfer com.sun.jmx:jmxri:jar:1.2.1 from https://maven-repository.dev.java.net/nonav/repository was cached in the local repository, 
                 resolution will not be reattempted until the update interval of java.net has elapsed or updates are forced. Original error: Could not transfer artifact com.sun.jmx:jmxri:jar:1.2.1 from/to 
                 java.net (https://maven-repository.dev.java.net/nonav/repository): No connector available to access repository java.net (https://maven-repository.dev.java.net/nonav/repository) of type 
                 legacy using the available factories AetherRepositoryConnectorFactory, WagonRepositoryConnectorFactory
                - ArtifactTransferException: Failure to transfer com.sun.jdmk:jmxtools:jar:1.2.1 from https://maven-repository.dev.java.net/nonav/repository was cached in the local repository, 
                 resolution will not be reattempted until the update interval of java.net has elapsed or updates are forced. Original error: Could not transfer artifact com.sun.jdmk:jmxtools:jar:1.2.1 from/to 
                 java.net (https://maven-repository.dev.java.net/nonav/repository): No connector available to access repository java.net (https://maven-repository.dev.java.net/nonav/repository) of type 
                 legacy using the available factories AetherRepositoryConnectorFactory, WagonRepositoryConnectorFactory
                - Missing artifact com.sun.jdmk:jmxtools:jar:1.2.1
                - Missing artifact com.sun.jmx:jmxri:jar:1.2.1

To cut the story short, this was caused when I added the log4j 1.2.15 in my pom.xml as shown below:

      <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.15</version>
      </dependency>

To fix the problem, I excluded the jdmk.jmxtools, jmxri and jms by using following code snippet for my log4j 1.2.15 dependency:

      <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.15</version>
                  <exclusions>
                        <exclusion>
                              <groupId>com.sun.jdmk</groupId>
                              <artifactId>jmxtools</artifactId>
                        </exclusion>
                        <exclusion>
                              <groupId>com.sun.jmx</groupId>
                              <artifactId>jmxri</artifactId>
                        </exclusion>
                        <exclusion>
                              <groupId>javax.jms</groupId>
                              <artifactId>jms</artifactId>
                        </exclusion>
                  </exclusions>
      </dependency>

Friday, April 10, 2015

How to make 'tail' command with color in SSH or Unix

While I was debugging the logs early in the morning for an application issue, it's hard to identify which is ERROR or INFO or the CLASS that I'm looking for when you're dealing with one color (i.e. green), it's hard. When remote and tailing a logs for debugging, it's not easy especially if you have a lot of application logs writing to your file. My approach in a way to make it understandable and easy to trace, I just change the color while tailing it, so that, it's easy for me to trace which one is ERROR or even the specific text based on your keyword or the name of your Java Class You may try the following command below and you can also experiment it.

Quick notes: /INFO/ and /ERROR/ are the keyword and you can replace it.

Command below will print all line with INFO in GREEN and all line with ERROR in RED

tail -1000f <log.file>| awk '/INFO/ {print "\033[32m" $0 "\033[39m"} /ERROR/ {print "\033[31m" $0 "\033[39m"}'

Command below will print all line in WHITE except for the line with ERROR. The line with ERROR will be print in RED.

tail -1000f <log.file>| awk '// {print "\033[37m" $0 "\033[39m"} /ERROR/ {print "\033[31m" $0 "\033[39m"}'

Please post your suggestion to make this "tail" and "awk" works better.

For Colors:
            
   30 - black   34 - blue          40 - black    44 - blue
   31 - red     35 - magenta       41 - red      45 - magenta
   32 - green   36 - cyan          42 - green    46 - cyan
   33 - yellow  37 - white         43 - yellow   47 - white


   

Friday, January 30, 2015

To Enable Remote Command from Red Hat Central Management Portal

The latest version of the following packages needs to be installed:

up2date 
rhncfg 
rhncfg-actions 
rhncfg-client
 
The remote commands currently on the Pending actions queue can be applied immediately to the system by running the command from the command prompt:

# rhn_check

But schedule actions actually depends on rhnsd service (Red Hat Network Daemon) that periodically connects to Red Hat Network to check (rhn_check) for updates, notifications or to apply remote commands if it is configured. This service will check with RHN every 240 minutes (default). If you want to schedule your remote command to run every hour, please change the value in the file to:

/etc/sysconfig/rhn/rhnsd

INTERVAL=60

Please take note that changing this interval to less than 15 minutes will result to "Abuse of Service" error which means that the system is checking in with RHN more than the allowed number of times (100 check in per 24 hours).

After changing the INTERVAL, run this command:

# service rhnsd restart
 
Actually, to run remote commands, we only need to enable:

# rhn-actions-control --enable-run

but if you want to run config files, diffing package versions, mtime, etc., --enable-all
will be appropriate.

--enable-all will let you deploy remote commands

Wednesday, January 28, 2015

GHOST: glibc vulnerability (CVE-2015-0235) - How to fix the issue in Ubuntu and Red Hat

In Linux Ubuntu, the easy way to fix is update your library to the following version:


Follow the command below to update the Ubuntu library
  • $ sudo apt-get update
  • $ sudo apt-get dist-upgrade
In Linux Red Hat, the easiest way to resolved the issue is to update the glibc and nscd  packages on your system using the package release with the following errata: 


Thursday, January 8, 2015

What is working in IT in a non-IT Company vs an IT Software or Service Provider company?

After working in both conditions here are my observations:

Working for pure IT services company:

- I worked on many projects involved many technologies, latest and old.
- Less pressure during development since SDLC involved, sufficient time for
development. Even with agile also, I used to get much time to do things since we followed "agile way of estimating effort" 
- I used to get time to do things for my own learning, for example using JUnit ,MUnit, Mockito, writing unit test cases, doing POC, setting local dev environment using Virtual Box or VMware or Fusion and now, you can actually leverage the AWS for the cheapest t2.nano instance for almost $5 / month.
- I don't have to interact with customer directly unless I am in a big role.
- Challenging work environment and you will be on the go. 

Working for non-IT company as an IT support engineer:

- Working closely with customers (people who doesn't know technology well).
- Things changes so fast, even after project launch I used to get change requests to modify something instantly! 
- Very tight schedules and too much pressure.
- Once project goes live I used to get couple of weeks to one month free time.
- I am only working on one project, to support the users on technical issues etc. I am quite familiar with the system now and there is nothing to learn much. 
- Not so challenging, doing simple things within shortest time is challenging.

- Convincing users on certain things is difficult. Whenever we tell them that certain things cannot be done this way or that way, they immediately says "if you can't do it, why you need this computer system?"

Hard to pick which field you want to take:

To work in a IT Service company, is fun and you will envolve on different company, high expectation of course, don't afraid if you fail because the today's failure can make way for your tomorrow's triumph...

To work in IT support or in-house is kind of layback especially if your rule is supporting internal client. You can make your life busy if you want to. Make your own challenge but it's up to you. You can do that or just go with the flow.