Common List Of Mime Types

Below is a list of mime types I come across most often. Suggest others mime-types that should be a part of the list by leaving a comment below. You can also view my other article on finding the mime-type of a file to see how you can return the mime-type of a file determined by the file extension.

List Of Mime Types

Text

PHP – text/html
HTML – text/html
HTM – text/html
CSS – text/css

Multipart

– multipart/mixed

Application

PDF – application/pdf
ZIP – application/zip
JAVASCRIPT – application/javascript
JSON – application/json

Image

GIF – image/gif
JPEG – image/jpg
JPG – image/jpg
PNG – image/png

Video

MPEG-1 – video/mpeg
MP4 Video – video/mp4
Quicktime – video/quicktime
WMV – video/x-ms-wmv
3GP – video/3gpp

Audio

MP3 – audio/mpeg
MP4 – audio/mp4
Ogg Vorbis – audio/ogg

If you see anything missing from my list of mime types, please message me or leave a comment.

Conclusion

Browsers will detect the mime-type of files and display them accordingly. And because of this, it is important to have the correct Content-Type header set for your files. For example, if you read a jpeg from disk and echo the contents to the page, you must set the content type to image/jpeg or image/png in order for the browser to display it as an image and not just display the contents of the file.

Manually Override DNS -Window, Linux and Mac Examples

Overview

First off, let me explain what a DNS Entry is in order for us to understand why we would need to override it. Basically a DNS entry is a record or entry that tells us what ip address is of a domain will point to. Such as an example (not actual) IP of 66.12.23.124 could point to a domain such as www.example.com.

Say perhaps we are updating a DNS entry and as the nature of DNS would have it, sometimes it will take up to 48 hours for the DNS to propagate through the Internet. Or perhaps we don’t want to update a DNS record which could affect everyone but rather just change a record for ourselves, locally. In these case, we can manually override the DNS change which will only reflect on our local machine. Below I will show you how to achieve this on Windows, Linux and Mac.

Manually Override DNS on Windows

Open up the hosts file located under “C:\Windows\System32\etc\drivers\“. In there you will see the IP address in the left column and a space separated list of domains to the right. The below example will set the 3 domains of www.example.com, anotherdomain.example.com and lastdomain.com to the IP address of 10.0.0.1.

10.0.0.1 www.example.com anotherdomain.example.com lastdomain.com

Manually Override DNS on Linux

vi the hosts file which is located under /etc/hosts. Add in a line below the last entry in the same fashion as you would for windows. For example if you wanted to change the ip address for the domain www.example.com to point to 192.168.0.20 you would enter:

10.0.0.1 www.example.com anotherdomain.example.com lastdomain.com

Manually Override DNS DNS on Mac

Mac is the same as the above linux example. Simply edit the hosts file under /etc/hosts and add in the entries as needed. So again, you could enter something such as:

172.10.1.5 www.anydomain.com

Manually Override DNS Using IPV6

You don’t always have to use a standard IPV4 as the IP address. You can also use IPV6 and enter it into any of the hosts files like so:

fe80::1%lo0 localhost

And that is all there is in Manually Override DNS in windows, linux and mac.

Using Curl As A Wget For Mac Replacement

Overview

I was trying to download a file on my Mac and realised that there is no wget for Mac. Since I consistently use wget I decided to find a way to get wget for mac. I found a quick way to create an fake wget command by creating an alias of curl. By creating the alias, I am able to call ‘wget’ and it will invoke curl -O in the background and download the file just as wget would have. This is a quick way to get wget for Mac.

Using Curl As A Wget For Mac Replacement

In order to create an alias of `wget` that will simply run the command curl -O I ran the command below:

echo 'alias wget="curl -O"' >> ~/.bash_profile

Now when i type ‘wget http://www.example.com’ it will download the url as you would expect from wget. As mentioned before, in the background it will be invoking curl to download the file. So when I run `wget`, it is actually executing curl -O to download the file as we won’t even notice the difference. Well maybe a small difference. But the end result is the same and your file is downloaded.

Example Using The Replacement wget For Mac

wget http://www.example.com/helloworld.html

The -O option to curl tells curl to save the URL as a file rather than displaying the source.

And that is all there is to it.

5 Tips On Running Meetings Effectively

Overview

Meetings are vital to any organisation. It can be the difference between being a well communicated business and complete discord and miscommunication. Here I will give you 5 tips on running meetings effectively. You should also check out my other post on the best ways start a new project for tips on kicking your project off in the right direction.

Stick To The Agenda

Before the meeting, create a topic driven agenda. It is important to make sure you cover all the topics during the meeting and ensure that you don’t stray off topic to discuss other points. If another point is raised, jot it down and place it in the following meetings agenda.

Keep Your Team In The Loop

The more your team knows about the project, they more they will feel involved. It will also help them realise their importance and keep them motivated. Let them know if you are on track, what the current issues are and any changes to the project.

Don’t Obsess Over A Point

If you find you are stuck on a topic too long, don’t stress about it. Put it aside and move onto the next topic. Getting stuck on a single topic will draw out the meeting and causes frustration and can lead to lack of interest and loss of focus from your team. Sometimes a difficult topic is worth throwing to the team to research or ponder over in their own time and then have them bring their research into the following meeting.

Make Sure Are You In Control

It is way too easy to stray off course. Be in control of (but not overpowering) the meeting and keep the your team’s focus on the points of the agenda. Allow everyone to have their say and be involved in the meeting however don’t let anyone overpower the meeting. A well heard meeting allows you to hear what your team has to say and allows you to pick up any issues your team may have. Let them know what their priorities are and what their focus should be on.

End Correctly

Meetings are incredibly important and the outcome of a meeting is one of the main reasons you have them. It lets everyone know where the project is at and what is still required. At the end of the meeting make sure that everyone knows what their responsibilities are, what their priorities are and that there are no uncertainties with their tasks. It will ensure that everyone can quickly proceed with their part of the project and will be working on the correct milestones.

Is Apple Losing It’s Innovative Edge

iOS8 Renovates Their Design

The world has played audience to the overhaul Apple has gone through this last year. Not only has the company changed its stance to be a more friendly entity, it’s also promised to be more open. After releasing iOS 7, which completely renovated the visual palette of the original iPhone, Apple has gone a step further this time. The release of iOS 8 took everyone by surprise as it discarded the original iPhone blueprints and replaced them with a more interactive and friendlier interface.

Is Apple Losing It’s Innovative Edge

Lightbulb

Lightbulb

It is very hard to completely redo the design of a popular interface without altering the experience of dedicated users. This task proved hard even for Apple, as the new interface with a wide range of flaws, both trivial and fatal, hit the market. With numerous bugs coming into the spotlight as users and critics explore the new OS, there is an obvious capacity for improvement. Some of the more vital areas of problem are related to Wi-Fi and battery drainage. Despite working flawlessly on iPhone 6, iOS 8 doesn’t seem to pay much attention to the older phones or iPads. The dragged Wi-Fi speed, massive amount of storage for the update, and heavy apps draining battery are really getting on users’ nerves.

Many new Features And Just As Many Bugs

Although the number of bugs in iOS is much higher than anticipated, it also includes quite a few cool new features. One of the most useful addition is Continuity. Allowing the user to pair devices, Continuity makes transition of work smooth and you can switch devices easily. To respond to the complaints, Apple has also added a Bug Reporter to the mix, which allows you to report any foul play to the company. Gamers and have a reason to rejoice as Safari allows them to run Web Software for the WebGL and hence get 3D graphics. IndexedDB standard has also been met which lets the users continue emails, word processing etc without interruption during faulty internet access.

Apple Is Losing It’s Polish

Apple Losing It's Polish

Apple Losing It’s Polish

Apple’s products have always been well polished and any features and designs are well thought out and beautifully implemented. That being said, the latest round of products seem to have less passion and polish that what we have come to expect. Will they step up their game and get back to where they were? I certainly hope so.
It is starting to appear that Apple is playing more of a game of catch up than leading the world in innovation.

They’ll Bounce Back

Or will they? Is Apple Losing It’s Innovative Edge? Apple’s diehard fans are highly unlikely to think much of the bump on the road Apple’s hit. Looking at the brand’s past reputation, we know they’ll bounce back and reclaim their position.

Fastest Way To Format File Size In PHP

Overview

In this short post, you will find a PHP function that has got to be the quickest way to convert bytes into an easier to read format of kilobytes, megabytes, gigabytes and petabytes. The PHP filesize convert function below takes the number (as bytes) passed to it and will convert it into an easier to read format. It will also round off the result to 2 decimal places. Very convenient and free from my site.

Fastest Way To Format File Size In PHP

The PHP convert function will take the number passed to it and continually loop and divide the number by 1024. We divide by 1024 since that is the number of bytes in a kilobyte as well as the number of kilobytes in a megabyte and so on. Each time we divide by 1024, we see if the result is still bigger than 1024. Once the number is less than 1024, we then count the number of times we had to divide the original number and that will tell us if the number is B, KB, MB, etc. For example, if we divided the number 3 times, that would mean the original number is in the GB. So we get the third element out of our $types array which returns GB.

<?php

function formatSize( $bytes )
{
	$types = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB' );
	for( $i = 0; $bytes >= 1024 && $i < ( count( $types ) -1 ); $bytes /= 1024, $i++ );
		return( round( $bytes, 2 ) . " " . $types[$i] );
}

Usage Examples

Below are some examples on how to format file size in php using the above function.

<?php

// call the above formatSize function and pass it a number as bytes

echo formatSize(8763432); // will echo 8.35 MB
echo formatSize(258); // will echo 258 B
echo formatSize( filesize('/path/to/some/file'); // will echo out the file size of that file

 ?>

Agree To Xcode License Command Line

Overview

With the newer versions of Xcode and iOS being released lately, you will undoubtedly be presented with the updated license agreement. Agreeing to it is mandatory and below I will show you how. So if you are not sure, read on.

Agree To Xcode License Command Line

Performing tasks on the command line in Terminal will cause you to continually be prompted to accept the license agreement like so

12:25pm @ darianbr:  xcodebuild

The prompt looks something like this

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
Agree To Xcode License Command Line

Agree To Xcode License Requires Admin Privileges

Accepting the license will require admin privileges. Do so by running the xcodebuild command as sudo. You will be prompted to enter your password and you will be shown the Xcode license agreement.

12:26pm @ darianbr: sudo xcodebuild

You will be prompted to etner your password and will be shown the license agreement.

Password:

You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.

Hit the Enter key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf'

Accepting the Xcode License Agreement

At the end of the license agreement, as show below, you will need to type ‘accept’ (I highlighted in yellow) in order to accept the xcode licence agreement.

5. Services; Mac Developer Program.
A. Apple may provide access to services by or through the Developer Software for you to use.  Use of these services may require an Apple ID, may require you to accept additional terms and may be subject to additional fees. If you elect to use such services in conjunction with the Developer Software, your usage of such services will be subject to those additional terms and conditions (e.g., your use of Developer IDs obtained from your Apple Developer Program account will be subject to the applicable Apple Developer Program terms for Developer IDs), but this License will continue to apply to your use of the Developer Software licensed hereunder. If you would like to submit Applications you develop to the Mac App Store, then you must apply to join the Mac Developer Program. More information about Apple’s Developer Programs is available at http://developer.apple.com/. Apple reserves the right to refuse admission to any of its 

By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel]

Final Words

After typing ‘accept’ and hitting enter, you will now have accepted the license agreement and will no longer be prompted to agree to xcode license agreement.

5 Tips To Starting A New Project

Overview

Starting a new project with a client can be a daunting process. It will set the tone for your relationship with your clients so it is important to start our correctly and on the same page as your clients expectations. It is also vital to run your meetings effectively to ensure complete project success.

Understand Your Client Needs

Before you can deliver the project to a client, it is imperative that you understand what they need. Starting a new project on the right track can be the difference between a happy client and an irate client. Make sure that you listen carefully and document what they need from you and then tailor your solution to fit in with their needs not the other way around. In meetings, don’t be scared to take too many notes and draw small annotations to capture what your client is thinking. Miscommunication happens all too easy and can cause projects to derail off course

Review Their Needs

After meeting with your clients and listening to them closely, go through all your scribbled notes and build a project overview. It will allow you to see how much work is involved as well as letting you know if you have the ability to deliver exactly what they want.

Let The Know What They Are In For

You have now decided that you are able to deliver what they want so go through your project overview and get a ball park figure on what it will cost them and let them have it. There is no use wasting both you and your clients time going through all the steps only to have them pull out at the end when they see the cost.

Functional Spec

Now that you understand exactly what is needed, it is time for you to show your client exactly what they are getting and what they can expect from your. Flesh out all your notes and plan the project stage by stage. It will give your client a first glimpse of what they are getting and allows both you and your client to see anything that has been overlooked or perhaps misunderstood. Have your client approve the functional spec and move forward with the quote.

Quote With Deliverables

So both you and your client are on the same page and both agree on what you are to deilver, now it is time to give them the quote and deilverables. Deliverables are a step by step timeline of what each milestone will deliver to them and when it will be delivered. The quote is a list of the costs against each section of the project. It is important that your client understands how long it will be before they can expect to see more results. If a milestone is going to be delayed, let your client know as soon as you can. It will reduce a lot of the stress. A client that is left in the dark is can easily become an irritable, unhappy client.

Apple iPhone 6 Full Review

Apple iPhone 6 Full Review

The most awaited phone of the year is finally here. Yes, we are talking about Apple iPhone 6. People all over the world have waits anxiously for new Apple iPhones and Apple never disappoints them. This year also Apple has come up with new, unique and amazing device, iPhone 6.

Features of Apple iPhone 6

Design: For the past few years Apple has stuck to its sharp edges and flat sided design. But, this time the Apple has changed the design and has come up with curved edges like the iPad-mini. Although, changes have been made in the design, the quality of material from which the device is made has been kept same. Also, iPhone 6 has gone thinner and is 6.8mm thick and the iPhone 6 Plus is 7.1mm. The volume button and the power button are same as before.

Dimensions

iPhone 6:
Height: 138.1 mm (5.44 in)
Width: 67.0 mm (2.64 in)
Depth: 6.9 mm (0.27 in)
iPhone 6 Plus:
Height: 158.1 mm (6.22 in)
Width: 77.8 mm (3.06 in)
Depth: 7.1 mm (0.28 in)

Apple iPhone 6 1

Display

iPhone 6 has a screen of 4.7 inches and iPhone 6 Plus sports a massive 5.5 inch screen. The with a resolution of 750X1334 pixels and 1080X1920 for the iPhone 6 Plus. The pixel density of the device is 326ppi. Just like it’s predecessor, it still has the Retina HD which is considered a better technology and claims to give better and wider angle of view.

iPhone 6:
4.7 in @ 1334 x 750 pixel resolution
326 ppi pixel density,
iPhone 6 Plus:
5.5 in @ 1920 x 1080 pixel resolution,
401 ppi pixel density

Apple iPhone 6 2

Interface

The iPhone 6 comes with the newer version of iOS 8 which looks great visually although some people are saying the Apple iPhone 6 has the same novel flat looks of iOS7. This time, iOS 8 biggest features are the Health Hub and Apple Pay which are updated with passbook. The feature of the Health Hub is that it basically collects data about a user’s vitals from different gadgets including the iPhone and Apple Watch. Apple has planned to replace wallets by iPhone 6 it has the NFC Chip. This NFC Chip can be used to pay in bills in McDonalds, Starbucks and many others franchises.
Apple iPhone 6 3

Processor and Memory

The biggest highlight of iPhone 6 is its new A8 system chip which is 25% smaller than the A7 but still A8 has 2 billion transistors which makes Apple, the first company in the world to get 20nm chips in mass production devices. Instead of 32 bits, A8 runs with a 64-bit enabled chip.
A major change has also been done in the memory part. Apple iPhone 6 will not be available in 32 GB and will be available only in 16GB, 64G and 128GB of internal memory. However, the option of micro SD Cards is still not there in iPhone 6.
Apple iPhone 6 4

Camera Quality

The device comes with a of 8MP camera with 1.5u pixels same as before. But changes are done in optics as iPhone 6 will have a wider lens, f/2.2 aperture and sapphire cover. Also, a new slow mode is introduced which will allow user to capture a twice the frame-rate for a twice more pronounced effect which means 720p at 240fps. Optical image stabilization is missing and it comes with digital stabilization.
Apple iPhone 6 5

Battery

The battery is of 2915 mAh for the iPhone 6 Plus while the iPhone 6 is 1810 mAh which gives better backup than previous versions of iPhone.
iPhone 6: 1810 mAh
iPhone 6 Plus: 2915 mAh
Cost: $299 for 32GB.

Final Verdict

The Apple iPhone 6 has got better screen and better features. It looks good in design and has got better iOS. So it’s definitely a good buy, only if you can afford it.
Apple iPhone 6 6

List Of Common Ports And Protocols

List Of Common Ports And Protocols

Below is a list of common ports and protocols as well as the service it is generally associated with. If you feel there are ports that should be on this list, please leave a comment or contact us.

PortDescriptionTCPUDP
20FTP – data port (File Transfer Protocol)
21FTP – command port (File Transfer Protocol)
22SSH (Secure Shell)
23Telnet
25SMTP – Sending Mail (Simple Mail Transfer Protocol)
43WHOIS – Domain Name Lookup
53DNS (Domain Name System)
67DHCP – Server (Dynamic Host Configuration Protocol)
68DHCP – Client (Dynamic Host Configuration Protocol)
80HTTP – Webservers such as Apache2 and IIS – more info on accessing websites on alternate ports
110POP3 – Receiving emails (Post Office Protocol, version 3)
123NTP (Network Time Protocol)
143IMAP – Receiving emails (Internet Message Access Protocol)
443SSL – Webserver with encryption (Secure Socket Layer)
Plesk Control Panel also uses this port
1433MSSQL – Database (Microsoft SQL Server)
2082cPanel
2083cPanel over SSL
2095cPanel Webmail
2096cPanel Webmail over SSL
3128Squid Proxy – Default Squid Proxy Port. Port 8080 is another common port for squid.
3306MySQL – Database
8080HTTP Port (Alternate port generally used when port 80 is already in use – more info)
8443Plesk Control Panel

 

Accessing a website on a different port

When you access websites, you are, by default, accessing them on the port 80 since this is the default web port used by websites. This means that http://www.darian-brown.com/ is the exact same as http://www.darian-brown.com:80/ (where :80 specifies the port number). However if the website server is using another port such as a more commonly used alternate port 8080, then you will need to specify the non-default port in the following format: http://www.example.com:8080/ where www.example.com is the website domain or IP address and 8080 is the port number the website is running on.