Raspberry Pi XBMC Media Center

In this project I will let you know steps to make your own Raspberry Pi XBMC Media Center.

Parts Required
The parts you will you need for this project are listed below. You will probably only need a USB keyboard and mouse for the setup after this you can remotely control XBMC (Kodi) via a tablet and/or web browser.

  • Raspberry PI
  • 4 GB SD Card (8 GB+ Recommended) or Micro SD Card if you’re using a Raspberry Pi B+ or 2
  • USB Keyboard
  • USB Mouse
  • HDMI Cord

Optional Item: Ethernet Cord or Wifi dongle

Step1:

Choose an operating system to install onto the Pi. Note: If you have a Raspberry Pi 2 please use OpenElec instead of Raspbmc. (You can follow the same steps but download the OpenELEC image instead of Raspbmc)

Raspbmc

 

Raspbmc

Raspbmc runs a full version of linux underneath XBMC but because of this it is slightly slower to boot up and the interface is somewhat slower when compared to a lighter weight version such as Xbian and OpenElec.

I found this the easiest to install and doesn’t require much work to have it working perfectly. You will need to tweak it a little to get the best out of it though. This is the most popular out of the three versions.

Find out more over at the Raspbmc website. Note: Raspbmc has now been discontinued please use OpenELEC instead.

OpenELEC

OpenELEC is a very light weight simple media center for the Raspberry Pi. The pro and con for this one is that the Linux OS underneath is virtually nonexistent. This allows for much faster boot times and just faster performance overall.

The biggest drawback on this is there is little to no room to move in terms of adding new drivers etc. If you do need to this then it will require an entire rebuild of your Pi.

This is great if you have technical skills and don’t require anything else but the standard drivers for XBMC (Kodi)

Xbian

xbian

Xbian much like OpenELEC is very light weight and fast but is much easier to install and configure than OpenELEC. This has everything Raspbmc has and is virtually identical. Xbian tends to get a lot of updates which means you get some minor features before the other two variations of XBMC.

This is perfect for anyone who wants faster updates but apart from that it is basically the same as Raspbmc.

Step 2

Installing Kodi (XBMC) Onto the SD Card

There are two ways to install Raspbian unto the SD Card the first two methods require a network connection to the Raspberry Pi. If you don’t have this luxury then simply follow my guide using the offline image.

Install via NOOBS (Network Connection Required)

Follow my earlier post How to install NOBS for Raspberry Pi for this.

 Install via OpenELEC Image

  1. Download the OpenELEC Project SD Card Image from the Raspberry Pi website.
  2. You will need a formatting tool. Download SD Formatter 4.0 for either Windows or Mac.
  3. Follow the instructions to install the formatting software.
  4. Insert your SD card into the computer or laptop’s SD card reader and check the drive letter allocated to it, e.g. G:/
  5. In SD Formatter, select the drive letter for your SD card (eg. G:/) and format

Install the OpenElec Image onto the SD Card

  1. Download and install the Win32DiskImager.
  2. Unzip the OpenElec image file so it will be .img and not img.gz (7zip is useful for this)
  3. Launch the Win32DiskImager and select the OpenElec ISO file and also the drive letter your SD card is assigned (Eg. G:/)
  4. Confirm you have the correct details and click on Write.

win32diskimager1

The Boot up

  1. Plug in all your necessary equipment into the Pi. (Keyboard, mouse,power supply and WiFi adapter(optional))
  2. Turn the Pi on by plugging in the micro USB cord from the power supply. It will now boot and spend about 5-10 minutes getting everything set up.
  3. Now it is all done and ready to go but if you would like to setup network and access files then go onto the next the section.

How to configure Visual studio load test Database manually?

To configure Visual studio load test Database manually perform following steps:
  1. Open a Visual Studio Command prompt. Type the following text: On a 32-bit version of Windows type: cd “c:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE” -or- On a 64-bit version of Windows type: cd “c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE”
  2. In that folder, type the following text:
    • SQL Express: SQLCMD /S localhost\sqlexpress /i loadtestresultsrepository.sql
    • SQL: You can install the database to any existing SQL server. For example, if you had a SQL server named Server1 you would use the following command: SQLCMD /S Server1 -i loadtestresultsrepository.sql

Caution The parameters are case sensitive. You must type uppercase S and lowercase i. SQLCMD /S pintu-home -i loadtestresultsrepository.sql

You might also need to specify a user name and password so that you can connect to Server. If so, you would use the following command: SQLCMD /S Server1 -U -P -i loadtestresultsrepository.sql Caution: The parameters are case sensitive.

configure Visual studio load test Database manually

  1. On the Load Test toolbar, choose Manage Test Controllers. The Manage Test Controllers dialog box is displayed.
  2. In the Load Test Results Connection String, click the browse button (…) to display the Connection Properties dialog box. Note:If you change the connection string for a controller, then you must select the controller.
  3. In Server Name, type localhost\sqlexpress or the name of the server that you used in step 2 such as Server1.
  4. Under Log on to the server, choose Use Windows Authentication.
  5. Under Connect to a database, choose Select or enter a database name. Select LoadTest from the drop-down list box.
  6. Choose OK.
  7. Choose Close in the Administer Test Controller dialog box

 

Windows 10 tweaks and tricks

Digging deep into Windows 10. Here are some of the most useful windows 10 tweaks and tricks.

  • Use the Hidden Screen Recorder App

Until now, if you wanted to record videos of the apps on your screen, you required a third-party app. However, Windows 10 changes this thanks in part to the new Xbox app. One of the new features of the Xbox app is the Game Bar, which allows not only to record footage of your gameplay but capture footage inside most of your apps as well. Naturally, this hidden functionality to record your apps is quite exciting.

To access the Game bar simply press and hold the Windows and G keys. The Game bar, which is essentially a toolbar, will then pop up on screen. If it’s your first time launching the Game bar for that app, you will get a message asking, “Do you want to open Game bar?”—simply click on “Yes, this is a game.”

windows10_recorder

  • Task view and virtual desktops

This feature was already there for MAC OS and Linux users long ago. Better late than never. Windows 10 now supports virtual desktop out off the box. To get started, click the Task View icon on the taskbar (immediately to the right of the Search box), or hold down the Windows key (abbreviated throughout as Win) and Tab. You can also drag an app to a new virtual desktop by bringing it over to the +New Desktop option at the lower right.

  •  Use Snap Assist for Split-Screen View

This feature helps to open two windows in a perfect split-screen view. To do that, start by dragging the first window to either the left or right edge of your screen. When you release your mouse button, the window will automatically be sized to fit exactly one half of your screen, then Snap Assist will populate the opposite half of your display with thumbnails of any other windows you currently have open.

  • Secret, powerful new Command Prompt tools

Windows 10 packs a new command line features, including the ability to copy and paste inside the command prompt with Crtl + C and Crtl + V.

To activate the goodies, open the command prompt. Right-click its title bar, then select Properties. You can find and enable the new features under the “Edit Options” section of the Options tab.

Note: Ctr+X will not work

  • GodMode

The legendary GodMode, a hidden staple for Windows power users, returns in windows10. As before, activating it unveils a power user menu that brings together all of your system’s far-flung settings and configuration options into a single location. Just create a new folder and rename it to following:

GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}

Don’t forget the period after “GodMode”, and you can rename the “GodMode” portion whatever you’d like if you want another name for the folder.

GodMode

 

How to enable Dark Mode in windows 10?

Steps to Enable Dark Mode in windows 10

Microsoft has introduced a dark theme option for the new Edge browser in Windows10 is looks great.
Enable Dark mode for Edge

 

As of now it is only available for Edge browser. But there is a simple tweak to enable dark mode for Windows 10. Following are the steps to do that.

Step 1: Launch the registry editor

Run the command regedit in run window or type it in search window and select it to open.

Step2: Access the correct value as mentioned below.

HKEY_CURRENT_USER -> SOFTWARE -> Microsoft -> Windows -> CurrentVersion -> Themes -> Personalize

Step3: Add a new item of type DWORD(32) value.

Add a new value of type DWORD(32) and rename it to  “AppsUseLightTheme,”. Keep the default value set to 0.

Enable dark mode - Regedit Personalize

Step:4 Logout/restart the system.

You are now done.

Note: Updating registry is not recommended. Try at your own risk.

How To Make WiFi Tethering in Windows 8.1

Steps to Configure Wifi Tethering in Windows:

  1. Launch an elevated command prompt under Windows 8 (command prompt with administrator privileges).
    To do this Press Windows + x key in windows 8 and click Command Prompt (Admin).
  2. Execute the below command to verify that your network interface support virtualization:

netsh wlan show drivers

If the “Hosted network supported” says “Yes“, then you’re ready to share the internet via Wi-Fi. Otherwise, you need to upgrade your hardware, if the software update doesn’t fix it.

  1. Now set up the Ad-hoc wireless network (wifi tethering) using this command. Replace the parts in markup tags with your own choices

netsh wlan set hostednetwork mode=allow ssid= key=

ssid is nothing but your desired Wi-Fi name, you can give your own.

Key is nothing but your Wi-Fi password. It should be Minimum 8 characters long.

Eg : netsh wlan set hostednetwork mode=allow ssid=myhomenet key=012345678

  1. Your hosted network has been created. Now, you need to start it.
    Use the command below to start your Wi-Fi Network:

netsh wlan start hostednetwork

cmd_hosted_network1

  1. Now type exit. Command Prompt will close.
  2. Open the connected network and right click on it and select “Connection Properties“. Now open Sharing Tab (Internet Connection Sharing) and check “Allow other network option”and from the dropdown select the “Local Area Connection”and Click “OK”.

connection_properties

  1. To Check the connection, open Control Panel-> Internet and Sharing and there you will see 2 connections one is your internet connection and the other one is Local Area Connection (Which is your WiFi Created)

Selenium Ruby Binding – how ?

Good part of selenium is that the selenium tests can be written in multiple programming languages like c#, Java, Perl, PHP, Ruby etc. I normally hear saying that “This Java project, so we can write tests in Java as well”.  The only advantage I see with this is that you can get help from development team incase you are stuck somewhere. But if you are good at c# or any other language it should not be an hindrance. Test framework will be different that coding framework unless you want to integrate it.

I covered Java and C# in most of my previous posts. Here I will be using Ruby to write the Selenium tests.

 A simple Ruby Test

require "selenium-webdriver"
driver = Selenium::WebDriver.for :firefox
driver.navigate.to "http://www.google.com"
element = driver.find_element(:name, 'q')
element.send_keys "Hello Selenium WebDriver!"
element.submit

require “selenium-webdriver”  – This is similar to import in Java and using in c#

The above example is without using any Test framework. In Ruby you can use Test Framework as you do with C# ( NUNIT test framework) and Java( JUNIT or TestNG framework).

In Ruby you can use minitest or BDD framework  RSpec or Cucumber

Structure of RSpec test

load File.dirname(__FILE__) + '/test_helper.rb' 
#'describe' marks the a test group
describe "Selenium Ruby Tests" do 
include TestHelper
 # 'it' marks the start of a test case, ends with the matching 'end'
it "Start Chrome" do
 browser = Selenium::WebDriver.for(:chrome) browser.navigate.to(site_url)
 sleep 1
 browser.quit
end
it "Start FireFox" do
browser = Selenium::WebDriver.for(:firefox) browser.navigate.to(site_url)
 sleep 1
 browser.quit
end
it "Start IE" do
 browser = Selenium::WebDriver.for(:ie) browser.navigate.to(site_url)
 sleep 1
 browser.quit
end 
end

For more information on RSPec click here .

How to convert xml to json format?

To Convert XML to JSON format

Consider a situation where in you have data in xml file and want to use it as a input to some other system where in it takes data in the form of JSON. You would require to convert XML to json format.

Below is an example of converting XML file into json file format.

#! /usr/bin/env ruby -rubygems

require 'rubygems'
require 'active_support/all'
require 'json'
json_str = Hash.from_xml(File.open(ARGV[0]).read).to_json
File.open(ARGV[1], 'w+').write json_str

To run the command,

xml-to-json.rb .file1.xml .file_out.json

 

 

Tips to speed up your slow PC

To speed up your slow PC first step should be restart. In fact you should restart the computer before performing any of the below mentioned steps. Its just like the human brain. You need restart when you are tired.

  1. Stop all unused applications
  2. Turn off unneeded Desktop Features that try to make things look better.
  3. Do a shut down/reboot also known as a cold reboot.
  4. Empty the Recycle Bin.
  5. Uninstall all applications that are no longer needed.
  6. Run “Error Checking” on all hard drives.
  7. Run “De-fragment” on all hard drives
  8. Install anti-virus software and keep it current.
  9. Find and Delete Temporary Files.
  10. Set your computer’s energy settings to High Performance.
  11. Clean Up Primary Partition.

Need detail information of any of the step. Do let me know?

 

Daily price updates for your favorite products via email

The prices of products listed on online shopping site like Amazon or Flipkart may vary every single day and here’s a simple Google Docs based solution to help you keep track of these price fluctuations via email.

The tool can track prices of all products listed on various Amazon websites (all Amazon.* country domains are supported) and Flipkart.com (if you are shopping in India).

For details on how to achieve this go to Digital Inspiration(http://www.labnol.org/internet/amazon-price-tracker/28156/)

How to uses SYSMON to Monitor Performance counter?

Monitor performance counter using SYSMON

The following example uses VBScript to add counters whose values are retrieved from the local computer, modifies some of the SYSMON properties that control how the monitor is displayed, and processes the OnCounterAdd event. The example uses the wildcard character (*) to add all instances of the process counter.

Save the bleow code in a HTML page and open in browser.

<HTML> <BODY BGCOLOR=#C0C0C0> <SCRIPT LANGUAGE="VBScript">
Sub Monitor_OnCounterAdded(index) Monitor.Counters.Item(1).Width = 8 End Sub </Script> 
<OBJECT CLASSID="clsid:C4D2D8E0-D1DD-11CE-940F-008029004347" ID="Monitor" HEIGHT=80% WIDTH=100%> 
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
Sub Window_OnLoad On Error Resume Next Monitor.ShowValueBar = False Monitor.ShowHorizontalGrid = True Monitor.Counters.Add("\Process(*)\% Processor Time") Monitor.DisplayType=sysmonLineGraph Monitor.GraphTitle="System Performance Overview" End Sub 
</SCRIPT> 
</BODY> 
</HTML>

Note: You need to enable ActiveX in your browser, to run the html file.