Change the network name in Windows 8/8.1

Here’s a quick little tip to get your week started.

Remember back in the Windows 7 days (oh so long ago…) when all you had to do to change the network name was click on the icon in the “Network and Sharing Center” and it would let you change the network name as well as the icon?

What? You don’t remember? Okay okay, so granted this wasn’t a widely used feature by any means, but sometimes (especially if you’re in any sort of tech industry) its nice to name your networks.

Well Windows 8 got rid of the icon completely (no surprise there) and along with it the ability to change the network name. Why Microsoft removed this, I will never know.

network-name

Never fear though, the ability to change the network name still exists in a round about way.

To do this you will need to open up the Registry Editor (regedit.exe) and navigate to (hint: the search feature in regedit comes in very handy here!):

Under the “Profiles” key, you will likely find several more child keys. Within each of the keys there will be a value called “ProfileName“. This is the one we are after to change.

change-network-name-profilenameAll we need to do is double click the value, and change the value data to whatever you want, close regedit.exe. Now reopen your “Network and Sharing Center“, you should see your new network name (no reboot required, awesome)!

newly-changed-network-name

Changing between static and DHCP IP address

Something as simple as describing how to change a PC to a static IP address (or back to a dynamic IP address ) is often overlooked by people who have been in the industry for a long time. I’m guilty myself of this. Too often while providing phone support (either internal or to customers) I will throw out “Oh yeah I just need you to set your computers IP address statically”. Most of the time I bet that I probably get a very evil glare on the other side of the phone.

You might be asking right now why you would ever need this information, and to be perfectly blunt most people will never need this information. However, if you ever have to phone support for any device that connects to the internet, believe me, the tech on the other line will praise you for knowing a little of the basics.

What is an IP address

To move forward, lets go back a little bit and cover the basics. What is an IP address? The Wikipedia description sums this up nicely:

An Internet Protocol address (IP address) is a numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol for communication. An IP address serves two principal functions: host or network interface identification and location addressing.

At its most basic level, I like to describe an IP address works like a mailing address. It tells computers where to send data to communicate with each other.

Dynamic vs Static

Ever go to the coffee shop with your laptop or smart phone, connect to their hot spot and surf the internet? Have you ever wondered why you don’t have to do any configuration during this process? An IP address can be provided to devices along with all the information it needs to connect to the internet via a DHCP server. A DHCP server is a device (often a router in residential situations) that resides on the same network and hands out the required information to devices that request it. However in larger networks, there either may not be a DHCP server or the I.T. department may assign addresses statically for management later down the road.

Okay, so when would I need this info?

Being in the Security/CCTV industry, I deal with a variety of different IP based devices on a daily basis. Using an IP camera as an example, often manufactures will program their device by default with a static IP. In order to program a new IP address into that camera, you need to place your computer into the same subnet in order to connect to it. This requires you setting up a static IP address. Likewise, when working with support over the phone, they will often ask you to factory reset the device so that you can log back into it and program it (again requiring a static IP within the same subnet).

Alright, so it could be useful. But now what?

Well, now that all the basics have been covered, lets get into how to change it! I will be using a PC running Windows 8.1 but the instructions are similar going all the way back to Windows XP.

First we need to open up the Network Connections window. Depending on your OS this is where things might vary slightly.

Windows XP
Start > Control Panel > Network Connections

Windows Vista/7
Start Orb > Control Panel > Network and Sharing Center > Change Adapter Settings

Windows 8/8.1
Right Click Network Icon in Task Bar > Network and Sharing Center > Change Adapter Settings

Its important to note there is dozens of different ways to get to these screens, but those are the most efficient ways of describing them based on years of doing tech support.

At the Network Connections screen, you may be presented with one or two (or more) connections. Depending which one you are working with is the one you will do the following steps. For example, to set a static IP address on your wireless connection then you would want to work on the one that says “Wireless Adapter“. On the controversy, if your working with a wired connection, you’ll want to find the one that says “Local Area Connection” or “Wired Ethernet Adapter“.

network-connections

Right click on the adapter you want to set a static IP address and click Properties.

Under the window that says “This connection uses the following items” search for Internet Protocol Version 4 (TCP/IPv4) and double click on it.

local-area-connection-properties

There is a few different options here. If you want to use DHCP (eg. at a coffee shop or at home) then set it to “Obtain and IP address automatically” and “Obtain DNS server address automatically“.

To set a static IP address, change it to “Use the following IP address” and enter the information manually. I’m not going to go into the specifics of where to get the IP address to enter as that’s beyond the point of this “quick” little blurb. but typically this would be provided to you (either by tech support, or an I.T. department).

ipv4-properties

Getting started with the Android SDK

If your a newcomer into the Android world and want to start your adventure into Android development, you wont get very far without first setting up the Android SDK.

It can seem overwhelming setting up the Android SDK for the first time, but it’s actually pretty straight forward.

First things first, its important to note that I will be covering this on a Windows based PC. Depending on your configuration the instructions may be slightly different but they should be similar enough to work your way through it. I’m not here to start a debate, I use both Linux and Windows, but my preferred development environment when it comes to Android is Windows.

Downloading The Android SDK

First you will want to head on over to the Android SDK download page and start your download. As of writing this, there are two options. The first is the “Eclipse ADT with Android SDK“. This is the one that I will be covering on how to use (for now). The other is the “Android Studio Beta” which will at some point replace Eclipse ADT.

To get started with the download, click the blue “Download Eclipse ADT with Android SDK” button on the Android SDK page linked above. Normally I would be nice and throw a direct link here, but trust me, you’re going to spend a lot of time on the Android Developers site if your serious about becoming an Android developer, so might as well get used to this page sooner rather than later!

download-adt-with-android-sdk

This will take you to an agreement page. Again depending on your configuration the next steps may vary slightly but this page should auto detect which OS your using so you simply need to choose your architecture (32 bit or 64 bit).

android-sdk-agreement

Once you accept the agreement, your 354 MB download will begin. The time to download will obviously vary depending on your internet speed.

android-sdk-download

Extracting the Android SDK

Next we need to install it. Hopefully you remembered where you saved the zip file to! Since we’re using a Windows PC, you should be able to extract the zip file without any additional software. Simply right click the zip file and click “Extract All“. This will pop up the extraction wizard. I would recommend extracting it to the desktop for ease of access, but this is ultimately your choice on where to extract the files to. Depending on your computers speed, time to extract will vary (but hopefully you’re using a faster computer than mine, which I believe was the first PC the dinosaurs used!)

extract-android-sdk

 

Installing the Android SDK

All right, so you’ve downloaded the Android SDK, you’ve extract it to some place easily accessible… now what? Well my friend, now we need to go through the installation of the platform you’ll be developing for. The nice thing about the ADT is that there is no installation process for . Once the files are extracted, you are free to move or rename the folder as much as your little heard desires. If you open the folder, you’ll see two folders (eclipse and sdk) and one executable (SDK Manager).

android-sdk-adt-folder

The eclipse folder is where the IDE (Integrated Development Environment) is located. We will be working with this a little later.

The sdk folder is where the files from the SDK Manager will be downloaded to and stored.

The SDK Manager is the tool used to download the different parts of the SDK that you will need over the course of development.

Before we go any further, to make things easier, lets rename the ADT folder from “adt-bundle-windows-x86_64-20140702” to just “Android ADT“. We will refer to this as the ADT folder from here on out.

Lets go ahead and double click on SDK Manager to open it up.

You’ll be presented with all the different available parts of the SDK such as extras (usb driver, Google Play Services, etc.) as well as different platforms and APIs. To get started, we want to download and install API 20 which is for the upcoming “L” release of Android. Simply put a check mark in the box beside “SDK Platform Android L Preview” and click “Install Packages“. At this point you’ll be prompted to accept the license agreement before installing.

android-sdk-manager

When finished, you can go ahead and close the SDK Manager.

Download and Install JDK

Going back to the Android ADT folder we extracted previously, if you attempt to open eclipse.exe in the eclipse folder you will most likely be greeted with an error about missing JDK.

jdk-missing

If you do see this error, then we need to download and install the Java Development Kit (JDK) from here. Simply find your platform (in my case Windows x64) and click the download link on the right.

jdk-download

When the download finishes, simply run the JDK installation file and follow the on screen prompts. You can use the NNNF method here if you wish (Next, Next, Next, Finish). When its done, you should see a screen that says successfully installed.

java-jdk-installed

 

Opening Eclipse for the first time

With the SDK downloaded and the JDK now installed, we’re ready to open Eclipse for the first time. Open up your Android ADT folder again, open the eclipse folder and run eclipse.exe. Since this is the first time it has been opened, we need to set a location for the “Workspace”, which is just a location for Eclipse to store all your project files. I recommend making a new child folder called “workspace” inside the Android ADT folder, but you could place the workspace folder anywhere on your computer. Hit “OK” when you’ve chosen the folder. You can choose

eclipse-workspace

 

A few moments later, eclipse will open and you’ll be ready to start writing the next big thing on Android! Stay tuned as I write posts going deeper and deeper into Android development

eclipse

Easily find a devices unknown IP using Wireshark

It happens to all I.T. guys sooner or later. You have a device on a network (maybe yours, or maybe a customers) and you need to figure out what IP address that device has. Some devices will provide this information via a console port, or maybe you can check your DHCP server’s reservation list… but what if you do not have access to any of these methods?

Well I am here to tell you there is another way!

The answer is Wireshark.

There’s a few different methods you can use to track down unknown IP addresses using Wireshark, I’ll cover the few different ways that I use.

This is probably the easiest way and the method that most people I talk to use, however it requires that you know the devices mac ID or mac Address.  Doing it this way, you can leave the device on the existing network and simply set up a filter for the devices mac ID.  For example, if the devices mac was 00:02:69:03:2D:11 then you would use a filter something like this:

When you start the capture, depending on how much (if any) traffic is going through, you should see the device IP address show up under either source or destination.

device-ip1

Looking at the image above, since I know my PC IP address is 172.16.248.21, I can tell that the device has an IP of 172.16.248.232! Perfect!

Now what if you don’t know the mac address?

It gets a little more tricky. If I don’t have the mac, usually I will remove the device off the existing network and place it into a test network with only my Wireshark PC and the device itself to prevent any excess network traffic. This is by far the easiest method where possible, however I realize there are times where this might not be possible either.

The next option would be to reboot the device. While a device is powering up, it will always send out ARP broadcasts across the network. If it uses DHCP, the ARP will be after it contacts the DHCP server and requests an IP. While the device is booting up, you should see something similar to this:

device-arp

I won’t go into extensive technical details here, but the gist of it is that the device is broadcasting across the network looking for a DHCP server, when it replies then the device will request an IP address. When the DHCP server assigns an IP address, the device will then send out an ARP identifying what IP address it has (which is the last line in the image). Again, based of this, we now know the device has an IP of 172.16.248.232.

Of course, this is only a very small portion of the capabilities of network monitoring with Wireshark, but by far this is one of the most useful tools any I.T. person can have in their toolbox.

Highly secretive print screen tips

Okay, so maybe they aren’t that secretive, but they are definitely helpful and not as well known as they should be!

Everyone has used that magic Print Screen button (PrtScn) at one point or another. Contrary to my belief as a child, no it does not send anything to the printer as the name implies!

In case you don’t know, the Print Screen button simply takes a “snapshot” of everything on your screen and copies it to the clipboard, where you can paste it (Ctrl-V) into your photo editing software for example.

Normal Print Screen

 

Tip #1
You can actually skip the whole “opening photo editing software and pasting” situation all together if you really want. Instead, use “Windows Key + PrtScn” which will create a new folder in your “Pictures” directory called “Screenshots” and automatically save your screen in PNG format.

Tip #2
You can also Print Screen just the active window instead of the entire screen. This comes in handy if you only need an image of a particular window and not the entire screen. For this, you simply use “Alt + PrtScn“. You still have to manually paste this into your photo edition software like a normal Print Screen, but saves a lot of time editing out windows that you didn’t intend to show in your screen shot.

Active Window Print Screen

 

Tip #3
This way could be considered more complicated, or less complicated depending how you look at it, but you could use the “Snipping Tool” built into  Windows 7+.  Basically you would open the “Snipping Tool” app and create a new snip by highlighting any area of your screen. The “Snipping Tool” will automatically open that portion of the screen into the built in photo editor where you can choose to edit, or just simply save the image for later use.

 

Expanding content area of WordPress TwentyFourteen theme

I stumbled upon a post on a blog run by David Lehman (NowhereLAN) the other day that caught my attention. It was regarding changing the page content area in WordPress’ TwentyFourteen theme.

Like David, I used TwentyFourteen as the base for my theme, and have been editing it to suit my needs. One of the things that bothered me was the excessive padding around the content area. As David points out in his post, its not so much a padding issue as it is the max-width set in the css file.

Two things I did differently.

First off, I did not edit the TwentyFourteen theme directly. Instead I am using a child-theme with TwentyFourteen as the template, this is the way that WordPress recommends to prevent overwrites when theme updates happen.

The second thing was the content width on all pages/posts/etc. David’s post only covers changing the page-content class, which will only change the width on actual WordPress pages. Instead, in my child-theme I did the following:

Since this was in my child-themes css file,  it will override the max-width on all posts instead of just pages.  I did not have to include the margin entry either since that is already set in TwentyFourteens css file.

Lightweight GA (Google Analytics) on WordPress installation

Today was time to install Google Analytics onto this blog. As you can imagine, there is far more than a “handful” of WordPress plugins to enable something as simple as GA Tracking.

I wanted to go for something a little more lightweight. Let’s face it, a plugin is a little overkill for two reasons. First of all, without tearing down into the source code of each plugin, you really don’t know what all its doing in the background. And second of all, Google gives you the Analytics code, so why make it harder than it has to be?

I vouched to instead edit my WordPress themes footer.php file, and add the Analytics tracking code provided by Google. By doing this, I eliminate the need to install possibly heavy or insecure plugins.

Simply drop the code from Google (example below) into the footer.php file (/wordpress_dir/wp-content/themes/theme-name/footer.php) anywhere before the </body> tag and Bob’s your uncle.

 

Force secure connection (SSL/HTTPS) using .htaccess and mod_rewrite

It recently came up where I wanted to force users visiting the IdleDev page to use a secure connection (https) domain wide (mostly for the development of Zero Day to ensure a secure connection is used at all times).

Unfortunately this was something that did not appear to be directly supported by my host. Luckily they do allow .htaccess and mod_rewrite, so from there it was easy.

By placing that text into your .htaccess file, and replacing “www.exampledomain.com” with your own domain, it will redirect the user to use an secure connection throughout the entire domain (essential for sending encrypted passwords, or any other data over the web that requires a secure connection).

It’s important to note that this method of redirect will give a 301 response (Moved Permanently) domain wide while still maintaining the structure that was originally typed in (eg. http://exampledomain.com/this/is/a/test will still redirect to https://exampledomain.com/this/is/a/test). You can also use .htaccess Redirect to just redirect specific files.

This example will only redirect index.php from the original domain to the new domain. This method will not maintain the domain structure so not as useful as the previous method in my opinion.