Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of my employer.

Sunday, January 17, 2016

Getting started with Raspberry Pi 2 Model B - OS installation and fixing display issue (no dosplay on HDMI TV)

Devices:

Raspberry Pi 2 Model B (I bought it with a case and charger - Amazon link)
64 GB Micro SD card that came with an adapter -  Amazon link
(I also used a different USB adapter - Amazon link) 
MacBook Pro early 2011 running OS X El Capitan 10.11.2
Samsung TV PN58C8000YF (any other TV with HDMI ports should work)
USB keyboard and mouse
Ethernet cable
HDMI cable

OS installation:

1. I downloaded the OS image from https://www.raspberrypi.org/downloads/raspbian/ - Raspbian Jessie and unzipped the image file.  Connected the Micro SD card using the USB adapter to my MBP, then ran diskutil to find the device.

2. ~ RitwikG$ diskutil list
/dev/disk0 (internal, physical):
  ...
/dev/disk1 (disk image):
  ...
/dev/disk2 (disk image):
   ...
/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *32.4 GB    disk3
   1:             Windows_FAT_32 UUI                     32.4 GB    disk3s1

So disk3 here is the Micro SD card. Then I unmounted the card and copied the data from the downloaded image file to the SD card.

3. ~ RitwikG$ diskutil unmountDisk /dev/disk3
Unmount of all volumes on disk3 was successful
4. ~ RitwikG$ sudo dd bs=1m if=2015-11-21-raspbian-jessie.img of=/dev/rdisk3

You can find more information about this at https://www.raspberrypi.org/documentation/installation/installing-images/mac.md.

Please note: The raw disk /dev/rdisk3 was used in the command above. If you use /dev/disk3 instead, it will work as well but will take a lot longer to finish the copy operation. You can find more details about it at http://superuser.com/questions/631592/why-is-dev-rdisk-about-20-times-faster-than-dev-disk-in-mac-os-x.

The next step is connecting the Raspberry Pi with the SD card, ethernet cable that's connected to the router, keyboard. mouse, HDMI cable connected to the TV and at last the power cable to turn it on. At this point I was disappointed to see  that there was NO display on my TV screen. So I powered off the RP, took out the SD card, connected it to my laptop and made the following changes.

5. Go to the SD card directory, find the /boot/config.txt file, then add/uncomment the following:

hdmi_force_hotplug=1
config_hdmi_boost=4
hdmi_group=2
hdmi_mode=47

You can find more details about these changes here:
https://www.raspberrypi.org/forums/viewtopic.php?f=26&t=5851
Also some useful commands:

Run “tvservice –m CEA” to give a list of CEA supported modes.
Run “tvservice –m DMT” to give a list of DMT supported modes.
Run “tvservice -s” to give you the current state.

After that I connected the SD card back to the RP, and powered it on. Voila! The display was on my TV screen and I was all set to start playing with the RP.

Sunday, February 8, 2015

Untangle Network Security

If you are a network engineer or administrator, I can imagine how difficult your life is with the overwhelming cyber security threats throughout the planet. In this cat and mouse game you have to be always one step forward from the hackers, and finding the right tool and technology is one of the key factor to perform your due diligence.



In the recent past I have reviewed a book about "Untagle", the well known simple but powerful one stop shop for all of your network administration needs. This book is written in a very easy to understand language, with step-by-step instructions and demos which is quite useful for both beginners as well as experienced professionals. The chapters are strategically arranged to explore all available functionalities of Untangle from very basic ones to the most complex features. If you are looking to learn untangle, make sure you check it out. The book's name is Untangle Network Security.

Tuesday, February 4, 2014

Keyboard Mouse integration between Solaris 11.1 and Windows 7 using Synergy

Note: Please read the copyright notices and license agreements before making any changes to your software. This document is not intended to take care of legal issues.

I'm running Solaris 11.1 in my desktop machine, a keyboard and mouse is connected to this system. My laptop under the same network is running Windows 7. Following are the steps I have taken to use the same keyboard and mouse in my laptop using Synergy.

Solaris 11.1

Step 1. Install the required packages.

# pkg install SUNWPython SUNWcmake SUNWgcc SUNWxorg-headers
# pkg install pkg://solaris/SUNWxwinc

Step 2. Download and extract Synergy from -
http://synergy-foss.org/

Step 3. Navigate to the directory and run
$ ./hm.sh conf -g1

Step 4. Now run
$ ./hm.sh build

This step will fail with the following error message.

[ 89%] Building C object src/micro/CMakeFiles/micro.dir/uSynergy.o
In file included from /home/righosha/synergy-1.4.15-Source/src/micro/uSynergy.c:26:0:
/home/righosha/synergy-1.4.15-Source/src/micro/uSynergy.h:49:92: error: operator '==' has no right operand
*** Error code 1
The following command caused the error:
cd /home/righosha/synergy-1.4.15-Source/build/release/src/micro && /usr/bin/gcc  -DSYSAPI_UNIX=1 -DHAVE_CONFIG_H -DWINAPI_XWINDOWS=1 -O3 -DNDEBUG -o CMakeFiles/micro.dir/uSynergy.o   -c /home/righosha/synergy-1.4.15-Source/src/micro/uSynergy.c
make: Fatal error: Command failed for target `src/micro/CMakeFiles/micro.dir/uSynergy.o'

You will need to manually edit "src/micro/uSynergy.h" to resolve this issue. But before you do that, make sure you know if your system is little endian or big endian. Google it if you don't know how to figure that out. My system is little endian, most probably yours too.

Now open the file using your favorite editor, and comment out the following lines -

#if defined(USYNERGY_LITTLE_ENDIAN) && defined(USYNERGY_BIG_ENDIAN)
        /* Ambiguous: both endians specified */
        #error "Can't define both USYNERGY_LITTLE_ENDIAN and USYNERGY_BIG_ENDIAN"
#elif !defined(USYNERGY_LITTLE_ENDIAN) && !defined(USYNERGY_BIG_ENDIAN)
        /* Attempt to auto detect */
        #if defined(__LITTLE_ENDIAN__) || defined(LITTLE_ENDIAN) || (_BYTE_ORDER == _LITTLE_ENDIAN)
                #define USYNERGY_LITTLE_ENDIAN
        #elif defined(__BIG_ENDIAN__) || defined(BIG_ENDIAN) || (_BYTE_ORDER == _BIG_ENDIAN)
                #define USYNERGY_BIG_ENDIAN
        #else
                #error "Can't detect endian-nes, please defined either USYNERGY_LITTLE_ENDIAN or USYNERGY_BIG_ENDIAN";
        #endif
#else
        /* User-specified endian-nes, nothing to do for us */
#endif


and replace it with

#define USYNERGY_LITTLE_ENDIAN

Please clearly mark this change is done by you and this is not a part of the original software as mentioned in the copyright notice. Also if you are using a big endian machine then use "#define USYNERGY_BIG_ENDIAN" instead. Save your changes and go back to step 4 again. This time it should work fine.

Step 5. Create a synergy.conf file. You can create it anywhere e.g in your home directory. My Desktop system (hostname - host1.com and IP - a.b.c.d) is on the left side of my laptop (hostname - host2.com and IP - w.x.y.z) and my synergy.conf file looks like -

$ cat synergy.conf
section: screens
       host1:
       host2:
    end
    section: links
       host1:
           right = host2
       host2:
           left = host1
    end


Step 6. Start Synergy server from host1.
synergy-1.4.15-Source/bin$ ./synergys -f --config synergy.conf

Windows 7

Step 1. Download and install Synergy.
Step 2. Run Synergy
Step 3. Check client, enter server IP (IP of host1 i.e. a.b.c.d)
Step 4. Apply and Start.

Enjoy Synergy!

Monday, October 10, 2011

Share Picasa web album with friends who are not in Google+

Since Google+ came into the picture, I found it slightly difficult to share Picasa web albums with friends who don't have a Google+ account. However, when I clicked on the 'Share' button, a popup window appeared with an option to share my album with G+ friends. There was also a link 'Share via email only' in the bottom of the window. I clicked on that link and .. voila ! I can now share Picasa web albums with anyone.




Saturday, July 16, 2011

Virtual Box guest OS Solaris 10 U9 networking

I'm running Virtual Box 4 on Ubuntu 10.04 in my Toshiba laptop. I downloaded Oracle Solaris 10 9/10 Virtual Machine for Oracle VM VirtualBox and the installation was pretty simple and straight forward. My VBox was configured to use NAT. I chose networked - yes and name service - none during installation. After successful installation I took the following steps to enable networking by configuring DNS.

1. Added "nameserver 192.168.1.1" at /etc/resolv.conf
2. Aadded "10.0.2.2" at /etc/defaultrouter
I took these two information from another virtual machine, Solaris 11 Express 2010.11
3. Copied /etc/nsswitch.dns to /etc/nsswitch.conf
4. Enabled dns/client service using SVCS (svcadm enable dns/client)

However, I was not able to access internet after taking these steps. "netstat -rn" output was showing the default gateway was not configured properly and "route add" command was failing as well. My system was not able to ping the gateway. I got fed up with this and ran "sys-unconfig". After that I took the following configuration steps  -

Networked -> Yes
DHCP -> yes
IPV6 -> No
Kerberos -> No
Name Service -> None
NFSV4 domain config -> derived by system

and repeated steps 1-4 again. After a reboot networking started working as intended.