teleren/devto huggingface dataset:
How to make Terminal use MAMP’s PHP (in only 3 steps)
Tags: experience, php
Published: 2024-03-16 10:09:00

---
title: How to make Terminal use MAMP’s PHP (in only 3 steps)
published: true
date: 2015-07-17 17:27:47 UTC
tags: Experience,PHP
canonical_url: https://io.serendipityhq.com/experience/how-to-make-terminal-use-mamps-php-in-only-3-steps/
---

In MacOSX there is a default Apache + PHP server.

When you type the `php` command in Terminal, the PHP version used is the one shipped with the MacOSX.

But, if you install MAMP, then what you want is that the version used is the one shipped with MAMP.

So, let’s make Terminal aware of the existence of the MAMP’s PHP binaries and use them instead of the ones shipped with MacOSX.

## STEP 1: Verify which PHP is used by your Terminal

To verify which PHP is your Terminal using, open it and type:

```
$ which php
/usr/bin/php
```

Make another try:

```
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

```

As you can see, the PHP binaries are in `/usr/bin/php` and this path is also printed by the `echo $PATH` command.

And, ever as you can see, the MAMP’s folders don’t are showed. We have to add them to `$PATH`.

## STEP 2: Add MAMP’s PHP binaries to $PATH variable

To make Terminal aware of the existence of the MAMP’s PHP binaries and make it use them, you have to modify the `$PATH` variable modifying the file `~/.bash_profile` located in your root user folder (`~` stands for root and [you can type it using “Option + 5”](http://apple.stackexchange.com/a/60965/136137)). Use [VIM](http://cmgm.stanford.edu/classes/unix/vi.html) to open it in your Terminal (you’ll have to type in your admin password):

```
sudo vi ~/.bash_profile
Password: •
```

If you cannot edit the file, enter the `Edit mode` simply typing `a`.

Write in the file the `$PATH` variable that Terminal has to use (keep attention to the version MAMP is currently running checking your MAMP’s preferences!):

```
PATH=/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php5.6.6/bin:$PATH
```

Then, [save the file](http://askubuntu.com/a/252772/364826), so FIRST press `Esc` on your keyboard to quit the `edit mode` and fallback to `command line mode`, then type:

```
:wp
```

A short hand could be to press `SHIFT` and the letter `Z` **for two times**.

## STEP 3: Load the `.bash_file` and check all went good

Now it’s time to [load the new `.bash_profile` file](http://stackoverflow.com/a/4608197/1399706). Type:

```
$ source ~/.bash_profile
```

Finally, check that all went good and that the configuration is right:

```
$ which php
/Applications/MAMP/bin/php/php5.6.6/bin/php
$ echo $PATH
/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php5.6.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
```

Now the path to MAMP’s PHP binaries is set and used before all others by you system.

Remember to “Make. Ideas. Happen.”.

I wish you flocking users, see you soon!

L'articolo [How to make Terminal use MAMP’s PHP (in only 3 steps)](https://io.serendipityhq.com/experience/how-to-make-terminal-use-mamps-php-in-only-3-steps/) proviene da [ÐΞV Experiences by Serendipity HQ](https://io.serendipityhq.com).
Write a highly efficient python Web Crawler
Tags: python, coding
Published: 2020-10-05 10:55:17

---
title: Write a highly efficient python Web Crawler
published: true
date: 2015-07-14 00:00:00 UTC
tags: Python,Coding
canonical_url: 
---

As my previous blog, I use the python web Crawler library to help crawl the static website. For the Scrapy, there can be customize download middle ware, which can deal with static content in the website like JavaScript. However, the Scrapy already helps us with much of the…

   
[Read On](https://www.loginradius.com/engineering/blog/write-a-highly-efficient-python-web-crawler/)
How to upgrade to Windows 10
Published: 2022-08-09 14:58:03

---
title: How to upgrade to Windows 10
published: true
date: 2015-07-11 20:00:45 UTC
tags: 
canonical_url: https://www.funkysi1701.com/posts/2015/how-to-upgrade-to-windows-10/
---

Microsoft are releasing a new operating system on July 29th called Windows 10.

If you have questions about Windows 10 watch this video by [Scott Hansleman](https://www.hanselman.com/blog/Windows10IsComingheresWhatToTellNontechnicalParent.aspx). He explains how to upgrade from Windows 7 and 8 to Windows 10 and what to expect after you upgrade.

<iframe width="560" height="315" src="https://www.youtube.com/embed/nuCpdlMFvUY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

My advice to everyone is that you backup your devices before you upgrade, this is good practice before you install any software or updates.

Microsoft are offering Windows 10 for free for a whole year, so don’t panic. Take your time, backup all your important files and when you are ready install Windows 10. Nothing is going to stop working after July 29th if you don’t have the latest operating system on your machine.

I hope this helps answer some of your questions about what to do at the end of the month. If not feel free to write a comment or contact me with your questions.
Popups in Print Media 2.0
Published: 2019-12-23 21:12:24

---
title: Popups in Print Media 2.0
published: true
date: 2015-07-08 02:42:41 UTC
tags: 
canonical_url: 
---

Well, we’ve come full circle. This morning, I took a [Journal métro](http://journalmetro.com/) (while exiting the [Métro](http://stm.info/)) to discover that an enterprising marketing guy had stuck a popup on my print media.

![](https://cdn-images-1.medium.com/max/630/0*c2j8Q3jfOLyQMnNy.jpg)

I’m a fan of print media. I prefer to read [Le Monde Diplomatique](http://www.monde-diplomatique.fr/) or [Monocle](http://monocle.com/) in their print forms (even considering tablets). I also think that traditional media can learn from new media. But, seriously, let popups and popovers die already.

_Originally published at_ [_michaelsanford.com_](http://michaelsanford.com/popups-in-print-media-2-0/) _on January 15, 2013._
Why do we call them bugs?
Published: 2022-08-09 14:58:21

---
title: Why do we call them bugs?
published: true
date: 2015-07-07 20:00:45 UTC
tags: 
canonical_url: https://www.funkysi1701.com/posts/2015/why-do-we-call-them-bugs/
---

![](https://storageaccountblog9f5d.blob.core.windows.net/blazor/wp-content/uploads/2015/07/11666093_10153470803062792_4914668365512645054_n.jpg?w=960&ssl=1)

On my way home from the office I spotted this little chap. In my expert opinion it is a “bug”.

This particular “bug” is harmlessly sitting outside, but have you ever wondered why computer problems are often named after this little chap (and his friends)?

![](https://storageaccountblog9f5d.blob.core.windows.net/blazor/wp-content/uploads/2015/07/H96566k.jpg?resize=300%2C236&ssl=1)

The first recorded bug report was in 1947 when Grace Hopper found a moth between the relays of a Harvard Mark II, this moth was then tapped in the log book as evidence.

Since then the process of removing bugs has been called “debugging”. However bugs had existed in electrical devices before this.

In the early days of telegraphy, there were two types of keyers. The older “manual” keyers which required the operator to code the dots and dashes. And the newer, semi-automatic keyers that would send a string of dots automatically. These semi-automatic keyers were called “bugs”. One of the most common brands of these keyers, the Vibroplex, used a graphic of a beetle.

Luckily the bugs I deal with don’t have legs or wings and are just errors in computer code. When I debug code I need to look at the inner workings of the code, looking for problems, most often it is a typo or piece of logic that doesn’t match up. But the relationship between computer bugs and living bugs does continue, the bug tracking software bugzilla uses a cartoon bug as its logo.
Memcached Memory Management
Tags: memorymanagement
Published: 2020-10-05 10:51:35

---
title: Memcached Memory Management
published: true
date: 2015-07-07 00:00:00 UTC
tags: MemoryManagement
canonical_url: 
---

The  memcached is one of the most popular open source on-memory key-value caching systems. I will briefly talk about the design of memory management of memcached. Chunk and Slab This is the struct declaration of slabclass\_t. Each slab class contains the same size of chunk, but…

   
[Read On](https://www.loginradius.com/engineering/blog/memcach-memory-management/)
Kali Linux 2.0 Release Day Scheduled
Published: 2023-08-21 21:18:08

---
title: Kali Linux 2.0 Release Day Scheduled
published: true
date: 2015-07-06 00:00:00 UTC
tags: 
canonical_url: https://www.kali.org/blog/kali-linux-2-release-day-scheduled/
---

We’ve been awfully quiet lately, which usually means something is brewing below the surface. In the past few months we’ve been working feverishly on our next generation of Kali Linux and we’re really happy with how it’s looking so far. There’s a lot of new features and interesting new aspects to this updated version, however we’ll keep our mouths shut until we’re done with the release. We won’t leave you completely hanging though…here’s a small teaser of things to come!

<iframe src="https://www.kali.org/blog/kali-linux-2-release-day-scheduled/https://player.vimeo.com/video/132329259?dnt=1" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="vimeo video" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

## Kali 2.0 Dojo at Black Hat & DEF CON Las Vegas, 2015

If you’re heading down to Black Hat Vegas 2015, join our free [Kali 2.0 Dojo workshop](https://www.offsec.com/kali-linux/kali-dojo-bhusa-2015/), where we will be showcasing some of the most awesome features in Kali 2.0. We are currently working to bring everyone a surprise appearance at DEF CON as well. Unleash the Kraken!
HTML5 Limitation in Internet Explorer
Tags: java, maven, eclipse
Published: 2020-10-05 10:51:43

---
title: HTML5 Limitation in Internet Explorer
published: true
date: 2015-06-30 00:00:00 UTC
tags: Java,Maven,Eclipse
canonical_url: 
---

HTML 5 is the latest and greatest web technology, although it has some issues in some browsers which don’t have native support for the new HTML5 elements. If you want to support some of the older browsers which may still be in use such as IE8 and lower then you are going to have…

   
[Read On](https://www.loginradius.com/engineering/blog/html5-limitation-in-internet-explorer/)
Quick Tip: When Testing with Moq, Try Lambdas for More Flexible Tests
Tags: unittesting, mocking, csharp, dotnet
Published: 2018-01-12 15:01:58

---
title: "Quick Tip: When Testing with Moq, Try Lambdas for More Flexible Tests"
published: true
tags: unit testing, mocking, csharp, dotnet
canonical_url: https://SeanKilleen.com/2015/06/Moq-Using-Lambdas/
---

Mocks are invaluable to the art of testing. For those who are unfamiliar, mocks are essentially a way to fake a component and have it do exactly what you want it to do (e.g. a validator that always fails, or a method that always returns `1` when given a certain parameter).

While I’m pretty library-agnostic<sup id="fnref:1"><a href="#fn:1">1</a></sup>, I happen to be pretty familiar with [Moq](https://github.com/Moq/moq4) and so it’s the one that I use most often.

I showed a tip to a developer recently and it struck me that it might be worth sharing with a wider audience.

A big challenge for tests is to keep them specific enough that they accurately capture what you’re trying to do, but flexible enough that the smallest of changes won’t break them. I prefer readability of each test over re-usability, but nobody likes fixing 20 tests with one minor change.

I see a lot of folks do things along the lines of the following:

```
var mockLogger = new Mock<ILogger>();
var myClass = New MyClass(mockLogger.Object);

mockLogger.Verify(x=> x.Warning("Setting 'mySetting' has no value; using default of 1");
```

Now, this is all well and good. However, what if the default value changes? Or the name of the setting? The test is too brittle; it will fail easily.

However, when using Moq, it allows you to use a lambda to specify things _about_ a string, rather than the whole string itself:

```
mockLogger.Verify(x=> x.Warning(It.Is<string>(str => 
     str.Contains("Setting") && 
     str.Contains("has no value") && 
     str.Contains("using default"))));
```

This maintains the essence of the test, while at the same time fortifying it against things that might reasonably change. It’s slightly more verbose, but I don’t think that takes away from it much.

Have a different way of approaching mocks, mocking, or unit tests? I’d love to hear from you in the comments.

1. 

I prefer _concepts_ over _libraries_. If a developer understands what mocking is at is core, a library change should never phase them, though they should be able to express trade-offs.&nbsp;↩

[Quick Tip: When Testing with Moq, Try Lambdas for More Flexible Tests](https://SeanKilleen.com/2015/06/Moq-Using-Lambdas/) was originally published by Sean Killeen at [SeanKilleen.com](https://SeanKilleen.com) on June 28, 2015.
What is an API
Tags: api, postman
Published: 2020-10-05 10:52:11

---
title: What is an API
published: true
date: 2015-06-23 00:00:00 UTC
tags: API,Postman
canonical_url: 
---

An API is an acronym for Application Programming Interface. API's include various tools, protocols, and routines. API's are used as a way for applications to communicate with various systems. But what does this mean? Well let me explain what they are with some examples. I am…

   
[Read On](https://www.loginradius.com/engineering/blog/what-is-an-api/)
Fathers Day
Published: 2022-05-18 21:00:11

---
title: Fathers Day
published: true
date: 2015-06-21 20:00:45 UTC
tags: 
canonical_url: https://www.funkysi1701.com/posts/2015/fathers-day/
---

In the UK today is Fathers Day. Happy Fathers Day Dad!

I thought I might talk about how he encouraged my interest in technology, especially as in about 8 weeks I will become a parent and will have someone to encourage and inspire.

I am going to sound really old but when I was born there was no internet, no mobile phones and computers more often appeared in sci-fi than in your home.

The first computer I remember us owning was a Lynx. A quick google reveals there were a number of different models, I have no idea what we had but here is what I found.

![](https://storageaccountblog9f5d.blob.core.windows.net/blazor/wp-content/uploads/2015/06/PRODPIC-2926.jpg?resize=300%2C185&ssl=1)

In March 1983 the Lynx 48K was released, in September this was upgraded to 96K. In December 1983 a new Lynx was released with 128K. To put these numbers in perspective on my desktop is an image file that is 123K! The CPU in this computer was rated at between 4 and 6Mhz. (Modern PCs have CPUs around the 1.5Ghz or 1500Mhz)

The Lynx we had, didn’t have a disk drive or a mouse. Programs were loaded from audio tapes (Audio tape was a form of data storage that came before CDs where data was stored on magnetic tape, most often used for music) The tapes we had would often get stuck and data wouldn’t load. The answer to this was to fast-forward/rewind the tape or hit the tape on your leg. For some reason this is a memory I still have of my dad hitting a tape on his leg to get a game or something else to load on the lynx. We also had a joystick for playing some of the games. I believe we also had an early thermal printer.

My memory of the Lynx is in black and white. The reason for this is that the Lynx was connected to an old black and white TV, it was a special treat when we connected the main colour TV to the Lynx.

We had a wide range of games for the Lynx, I can remember Jet Set Willy, and Diggerman. But there were also programs which my father had created. The Lynx had a form of BASIC where you can write you own programs and my father spent many hours writing programs for me and my sister. (We actually never realized this at the time)

With that as my introduction to computers is it any wonder that I do what I do now? Now what should I do for my child to encourage them in a similar way?

As a family we never owned a games console. Not sure if this was a financial or moral choice but it is something I will have to think about. I want my child to be knowledgeable about computers and able to compete in the competitive job market, but I also want them to know about science and nature and to enjoy their childhood. Lots of technology choices to make over the next few years.
50th Blog Post
Published: 2022-08-26 07:14:24

---
title: 50th Blog Post
published: true
date: 2015-06-17 20:00:45 UTC
tags: 
canonical_url: https://www.funkysi1701.com/posts/2015/50th-blog-post/
---

WOW! I have reached the milestone of 50 blog posts.

![](https://storageaccountblog9f5d.blob.core.windows.net/blazor/wp-content/uploads/2015/06/top-50-2012.jpg)

I have tried to blog at least every week and I have learnt a lot. I have talked about my work, technology, things I have learnt, things I want to do and many more things. It is too soon to tell if my blog is going to be a success, but I think I am starting to find my ‘blog’ voice and I intend to keep on blogging.

To celebrate here are some of my highlights.

1. [User Groups and F#](https://www.funkysi1701.com/2015/05/30/user-groups-and-f/) By far my most popular blog post. I talk about my first visit to the Leeds Sharp group and an introduction to the F# language.

2. [Monitoring Screens](http://www.funkysi1701.com/2015/03/25/monitoring-screens/) I talk about creating a big screen of vital monitoring information.

3. [Ten Forward Episode #135](http://www.funkysi1701.com/2015/02/13/ten-forward-episode-135-anti-firbob-is-back-or-simons-desert-island-trek/) – Simon’s Desert Island Trek My appearance on the Ten Forward Podcast

4. [Building something with a Raspberry Pi](http://www.funkysi1701.com/2015/04/05/building-something-with-a-raspberry-pi/) I blog about getting a Raspberry Pi to play around with

5. [Improving your Blog](http://www.funkysi1701.com/2015/02/23/improving-your-blog/) John Sonmez tries to help my blog improve

6. [Javascript progress](http://www.funkysi1701.com/2015/01/16/javascript-progress/) About learning javascript

7. [The Raspberry Pi Adventure Starts](http://www.funkysi1701.com/2015/04/11/the-raspberry-pi-adventure-starts/) I get a Raspberry Pi and start building something with it

8. [Weakest Database Design](http://www.funkysi1701.com/2015/04/21/weakest-database-design/) I talk about database design

9. [Trying Windows 10](http://www.funkysi1701.com/2015/05/17/trying-windows-10/) I talk about my experience with the latest windows operating system

10. [Laziness](http://www.funkysi1701.com/2015/02/04/laziness/) I talk about the extreme ways IT Professionals go to be more lazy
Requirement Gathering
Published: 2022-08-26 07:14:38

---
title: Requirement Gathering
published: true
date: 2015-06-16 20:00:45 UTC
tags: 
canonical_url: https://www.funkysi1701.com/posts/2015/requirement-gathering/
---

 **Why is it so hard to find out exactly what is needed when designing changes to a system?**

![](https://storageaccountblog9f5d.blob.core.windows.net/blazor/wp-content/uploads/2015/06/Requirements-Gathering-User-Experience-UX-Project-Cartoon.jpg)

When adding functionality to databases I always like to dive in and start adding extra columns and new tables. But at some point you need to find out what is needed.

The process of gathering requirements that I have followed goes something like this.

My boss tells me that we need a system to solve x problem. This is the broad overview of what is needed.

Next I need to find out specifically how the system is being used and what things need adding. Discussing the specifics with my boss often results in a high level of confusion. I always try to speak with the users that will be using this system on a daily basis. If I create something that isn’t liked people will avoid using it and it won’t solve the original problem so I always think it is very important to speak to the day to day user.

After I have an idea of what is needed, I build something. Once I have something that sort of works, I will try and demonstrate this to the user to gather feedback. This feedback is invaluable as it will often reveal if I am going in the right direction and reveal missing requirements that need to be incorporated in the finished solution.

I will often repeat the last stage a few times especially if there is a big change needed, once I am happy I will demonstrate to my boss before deploying the solution.

After deployment there is often a period of fixing issues and gathering feedback before I can consider the project finished.

This whole process is very time consuming as there is a period of changes being tweaked back and forth following feedback. A better way is to gather a detailed specification of what is needed and work towards delivering that.
Installing Node.js on a Raspberry Pi
Tags: raspberrypi, javascript, node
Published: 2015-05-15 21:37:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Installing Node.js on a Raspberry Pi
slug: installing-nodejs-on-a-raspberry-pi
date: 2015-05-15 21:37
tags: raspberrypi, javascript, nodejs
---

Raspbian is based on of Debian Wheezy, so things are a little different than the standard Ubuntu 14.04 installs. Remember to always read a script before you curl it to bash.

    curl -sLS https://apt.adafruit.com/add | sudo bash
    sudo apt-get install node

Now check it's running okay...
    
    pi@raspberrypi ~ $ node -v
    v0.12.0
    
Ok so it's a little behind but still on 0.12.X.
Styling Radio and Check buttons with CSS
Tags: css
Published: 2020-10-05 10:52:33

---
title: Styling Radio and Check buttons with CSS
published: true
date: 2015-06-16 00:00:00 UTC
tags: CSS
canonical_url: 
---

Let's face it, at some point you look at a radio or a checkbox button and you're like... this looks like something that starts with an "s" and ends with a "hit". I'm here to stop you from saying that word and go on with your life without worrying about those ugly things. We're…

   
[Read On](https://www.loginradius.com/engineering/blog/styling-radio-and-check-buttons-with-css/)