Sunday, February 14, 2016

Disable Login List in Redhat

To Enable:

gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults --type bool --set /apps/gdm/simple-greeter/disable_user_list true

To Disable:

# gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults --type bool --set /apps/gdm/simple-greeter/disable_user_list false

---

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>