How-To: Fix my Mac VPN DNS resolution

So I assume a lot of people who read my blog are techies (even if you are not feel free to read! This might help you!), but I had a rather odd issue with my Cisco VPN client and my Mac. It appears that I would be able to access my servers via their IPs no problem; why I know my servers by IP is a maddening thing, don’t ask. However, whenever I tried to reach my servers via their hostname, my Mac would just flat out reject it. It would sometimes auto correct itself, but I am in the tech field! I am spoiled by having the world at my fingertips, and want my information now! So after much browsing, I found a solution from my coworker vijay360!

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

Basically, doing the above resets your Mac’s DNS 🙂 In short, for the non-techies out there, DNS is just a fancy way of saying what an IP should resolve to. For example, the internet would be a dark and scary place if http://google.com was only accessible via: http://64.233.160.19 . DNS helps you as a human be able to enter google.com and have the computer (and the internet) translate that for you! The story behind DNS is very simple, yet some facts about it are truly awesome and unbelievable. More on this soon 🙂

Hope this helps someone out there!

Original Source: http://vijay360.wordpress.com

Updated: Must Have Mac Software (now + Hardware)!

So now that I have been using my Mac for almost 3 months now, I can honestly say it has been on of the best investments for me! I have revised or added to the list I previously created; especially since some of you are starting to get your first Mac as well! 🙂 Below you will find what I consider a must have for anyone doing serious development/enterprise level work. Feel free to share some more in the comments section!

  • Email: AirMail (http://airmailapp.com/)
  • IRC/Lync/Chat: Adium (https://adium.im/)
  • Terminal: iTerm2 (http://www.iterm2.com/)
  • Text Editor: Sublime Text2 (http://www.sublimetext.com/2)
  • Docs: Dash (http://kapeli.com/dash)
  • Snap Windows: BetterSnapTool (http://blog.boastr.net/)
  • Virtualization: VirtualBox (https://www.virtualbox.org/)
  • VNC: Chicken (http://sourceforge.net/projects/chicken/)
  • Remote Desktop: Windows Remote Desktop Client (https://itunes.apple.com/us/app/microsoft-remote-desktop/id715768417)
  • Quick Access: Alfred (http://www.alfredapp.com/) QuickSilver (http://qsapp.com/)
  • Go To Terminal from Finder: cd to (https://github.com/jbtule/cdto)
  • SCP/FTP: FileZilla (https://filezilla-project.org/download.php)
  • Archive Access: TheUnarchiver (http://wakaba.c3.cx/s/apps/unarchiver)
  • Python Dev: PyCharm (http://www.jetbrains.com/pycharm/)
  • Java Dev: IntelliJ (http://www.jetbrains.com/idea/)
  • Oracle DB: sqldeveloper (http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html)
  • MySQL DB: MySQL Workbench (http://www.mysql.com/products/workbench/)
  • Package Manager: homebrew (http://brew.sh/)

Hardware:

  • Logitech Solar Keyboard (http://amzn.com/B005L38VRU) — Feels like the Mac keyboard and uses solar/artificial light to keep it charged! So long batteries!
  • Magic Trackpad (http://www.apple.com/magictrackpad/) — Once you invest in the track pad… I recommend ditching the mouse.
  • Moshi Palmguard (http://amzn.com/B009J90TR2) — I bought this cause my wrists would always smudge my Mac.
  • Klear Screen Cleaner Kit (http://amzn.com/B0023WU6OI) — Best screen cleaner although it has a funky smell when using it. Leaves my screen like new.
  • mStand Laptop Stand (http://amzn.com/B000OOYECC) — Amazing stand for the Mac. Solid aluminum and great build quality.
  • Unitek USB 3.0 and rj45 Hub (http://amzn.com/B00EHDNAOE) — Lets face it, we only get 2 USB ports and no wired connection. Pop this sucker in and you get both in a compact and portable device!
  • Official Mac Charger (http://amzn.com/B008ALAAV0) — Guys…buy a used one from Amazon. I saved myself close to $50 bucks buying a “used” one. Came in the box, like new. 🙂
  • Kuzy Black Case (http://amzn.com/B008AZYIKU) — Eh…take it or leave it. The bottom clips seem to have broken on mine, but overall for $20 bucks you can’t go wrong.

0129140037

Installing cx_Oracle on a Mac

UPDATE: I have updated this article to reflect the state of cx_Oracle and MacOS in 2017!

Spoiler Alert: It is way easier and this guide should be considered outdated!

Installing cx_Oracle on a Mac: 2017 Edition

So as previously mentioned, I got a Macbook Pro. Nearly two months later, I am loving it more and more. The only gripe I had was installing a specific package called cx_Oracle; a Python Oracle DB connection package. After a lot of attempts, I finally got a working copy installed on my local machine. I noticed there are many tutorials around the web, but they are a bit outdated, I am on Mavericks, so I will create a nice article not only for you guys, but also for myself.

Necessary Downloads:

  1. cx_Oracle — Source Code Only Option — (http://cx-oracle.sourceforge.net/)
  2. Oracle Instant Client Basic 64-bit (http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html)
  3. Oracle Instant Client SDK 64-bit (http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html)

Next Steps:
Assuming you downloaded all the above files, and they are found in your Downloads directory, run the following commands as sudo:

sudo su
mkdir /Users/<username_here>/oracle
mv /Users/<username_here>/Downloads/instantclient-* /Users/<username_here>/oracle
cd /Users/<username_here>/oracle
unzip instantclient-basic-macos.x64-11.2.0.3.0.zip
unzip instantclient-sdk-macos.x64-11.2.0.3.0.zip
cd instantclient_11_2/sdk
unzip ottclasses.zip
cd ..
cp -R ./sdk/* .
cp -R ./sdk/include/* .
ln -s libclntsh.dylib.11.1 libclntsh.dylib
ln -s libocci.dylib.11.1 libocci.dylib
vim ~/.bash_profile

 

Add the following lines (you may want to add these lines to your own accounts .bash_profile too):
export ORACLE_HOME=/Users/<username_here>/oracle/instantclient_11_2
export DYLD_LIBRARY_PATH=$ORACLE_HOME
export LD_LIBRARY_PATH=$ORACLE_HOME

 

Once you enter all the info, you should resource your bash_profile. After this, you setup instant client as well! I would validate all your settings are correct as well:

. ~/.bash_profile
echo $ORACLE_HOME # should be /Users/username_here/oracle/instantclient_11_2 if you followed this guide
echo $DYLD_LIBRARY_PATH # same as above
echo $LD_LIBRARY_PATH # same as above
which python # usually /usr/bin/python
which gcc # usually /usr/bin/gcc

If all of the above is set, then you are ready to proceed with the cx_Oracle Install!

. ~/.bash_profile
cd /Users/username_here/Downloads
tar -xzf cx_Oracle-5.1.2.tar.gz
cd cx_Oracle-5.1.2
sudo python setup.py build
sudo python setup.py install

If all went according to plan, it should have successfully installed! (if not post in the comments and I can help!) To test simply:

python
import cx_Oracle
# you may see some junk like:
/Library/Python/2.7/site-packages/cx_Oracle-5.1.2-py2.7-macosx-10.9-intel.egg/cx_Oracle.py:3: UserWarning: Module cx_Oracle was already imported from /Library/Python/2.7/site-packages/cx_Oracle-5.1.2-py2.7-macosx-10.9-intel.egg/cx_Oracle.pyc, but /Users/username_here/Downloads/cx_Oracle-5.1.2 is being added to sys.path

Hope this helps someone out there! 😀

UPDATE:
Seems like Oracle made a change to the basic zip since this was posted, the step when you are setting up symlinks. If you used my guide previously and you did:

ln -s libclntsh.dylib.11.2 libclntsh.dylib
ln -s libocci.dylib.11.2 libocci.dylib

you should unlink your symlinks and this should be…

ln -s libclntsh.dylib.11.1 libclntsh.dylib
ln -s libocci.dylib.11.1 libocci.dylib
I have updated the article since! 🙂
UPDATE 2:

William Smith, a commenter on the article, said he still ran into an error where Oracle software could not be found. He was able to get past the issue by using “sudo -E” with when installing:

$ sudo -E python setup.py install

The “-E” flag on sudo ensures that the local environment variables are preserved with root when the command is run. Thanks! Check out his full comment: http://joelvasallo.com/?p=276#comments

Must Have Mac Software/Apps

So I have been enjoying my Mac experiment for about a month now, and so far so good! My biggest issue when it came to my Mac was making it feel like my previous Fedora laptop. Below you will find what I consider a must have for anyone doing serious development/enterprise level work. Feel free to share some more in the comments section!

  • Email: AirMail (http://airmailapp.com/)
  • IRC/Lync/Chat: Adium (https://adium.im/)
  • Terminal: iTerm2 (http://www.iterm2.com/)
  • Text Editor: Sublime Text2 (http://www.sublimetext.com/2)
  • Docs: Dash (http://kapeli.com/dash)
  • Snap Windows: BetterSnapTool (http://blog.boastr.net/)
  • Virtualization: VirtualBox (https://www.virtualbox.org/)
  • VNC: Chicken (http://sourceforge.net/projects/chicken/)
  • Remote Desktop: Windows Remote Desktop Client (https://itunes.apple.com/us/app/microsoft-remote-desktop/id715768417)
  • Quick Access: QuickSilver (http://qsapp.com/)
  • Go To Terminal from Finder: cd to (https://github.com/jbtule/cdto)
  • SCP/FTP: FileZilla (https://filezilla-project.org/download.php)
  • Archive Access: TheUnarchiver (http://wakaba.c3.cx/s/apps/unarchiver)
  • Python Dev: PyCharm (http://www.jetbrains.com/pycharm/)
  • Oracle DB: sqldeveloper (http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html)
  • MySQL DB: MySQL Workbench (http://www.mysql.com/products/workbench/)
  • Package Manager: homebrew (http://brew.sh/)

Mac-ing my Mac: Show me the Packages

Another article on this topic and I hope it is helping someone else out there! So when using Linux, my favorite thing was being able to simply say “yum install .” Fortunately, I was aware of a custom package manager known as Brew. Very cool and easy to install; so easy it all installed with one command in the terminal!

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
brew install wget
brew install vim
brew install git

Source: http://brew.sh/