Friday 31 July 2015

How to Virtualise Linux

The latest issue of Linux User & Developer is one of our biggest yet, packed with projects, reviews, tutorials for developers and home users, and more essential Linux wisdom besides. You can order a copy here if you haven’t picked yours up yet, or you can join our subscribers and save 30% off the cover price.

How to Virtualise Linux

In our virtualisation feature we walk you through the process of creating and using virtual machines with VirtualBox, KVM and QEMU, so you’re covered whether you’re running up VMs from a headless server in your office, testing your new ARM software from a Fedora laptop, or keeping a copy of Windows 7 alive on your home machine for some Steam gaming.

How to Virtualise Linux

Combining the Raspberry Pi, Arduino, a neat interface called Heimcontrol and a bunch of sensors, in this piece we show you how to upgrade your home with automation to take care of your plugged-in appliances, your lights, your household temperature and a video doorbell. It’s great fun and a perfect weekend project.

And that’s not all – here’s a few of the other highlights this month:

  • Meizu MX4 Ubuntu Edition hands-on
  • Program your own shell – final part
  • Build a Raspberry Pi Glove – final part
  • Learn to debug Linux software
  • Banana Pro tested
  • Mageia 5 reviewed
  • NGINX on AWS
  • Twitter API with Django
  • Hybrid SSD + HDD setups

Don’t forget to grab your free assets from FileSilo, too!



from Linux User & Developer - the Linux and FOSS mag for a GNU generation http://ift.tt/1I6Urp5
via IFTTT

LEGO Smart Home

Pi far_b (1 of 1)

We spoke to Bhavana Srinivas and Geremy Cohen from PubNub about their LEGO Smart Home model, a proof of concept project that shows how you can use the Raspberry Pi with communication platform PubNub in order to automate your household electronics and other Internet of Things devices. You can read the full piece in the latest issue.

Tell us about PubNub and your LEGO Smart Home.

PubNub is a global data stream network. What this means is that, using the PubNub software, you can talk between devices in real-time. And, going beyond that, we provide an infrastructure as well, so you can scale and build real-time applications. The simplest case is when you have two mobile phones talking to each other – using any kind of instant messaging or a commercial app that requires stocks to be updated in real-time, for example, or any kind of home automation – that kind of real-time messaging is brought to you PubNub. Since we have 14 data centres all over the world, your data gets replicated and we’re able to communicate between devices in less than a quarter of a second.

The Internet of Things was picking up at PubNub last year, so we decided to have some cool demos to show how you can integrate PubNub as a software for any kind of home automation that you build out. We were building two projects at the same time – one with the Arduino Uno and the other with the Raspberry Pi, both to show home automation itself. So with this project, the Raspberry Pi Model B+ would be the brain behind the whole project, powering the different embedded sensors, the stepper motor to control the door, and we used PubNub as a glue to talk between these different devices.

DSC00235I didn’t build this myself – it was actually another engineer here called Geremy who built it over Christmas. We were going to have the software component, which is PubNub, and then on a mobile phone you could control all the devices in your house; the devices being the seven embedded LEDs – used to simulate things like a stove, a fireplace, a barbecue station and lights within the house – and then we had a stepper motor to open and close the door, and a couple of sensors like temperature, humidity, etc, to measure those different values within the house. So what you can do with this demo is open this dashboard on your phone, typically an app, and the moment you instruct it to switch on the light or open the door, it will reflect immediately on the house. You can get the state of the house continuously, in terms of the voltage or the temperature, the pressure, so that’s a typical home automation system.

How does messaging between different PubNub-connected devices work?

So PubNub provides real-time communication between any two devices. What happens is that one device is publishing on a particular channel and then another device is subscribing to that same channel, and that’s how the message is transmitted from the first device to the second. All you need with PubNub is the publisher key, the subscriber key and then the channel name, and when two devices are using the same set of parameters – the same pub and sub keys – and when one publisher is on that channel, the other receives it on the same channel. On a very basic level, that’s how PubNub works.

How much of the software setup was specific to this project – was there a lot of work involved to get PubNub talking to the Pi?

So how it works with PubNub is that we have 70+ SDKs, which means we support that many platforms or devices – so if you’re using an iOS device then you can use our iOS SDK, or there’s our Python and Java SDKs, and so on. For the Raspberry Pi we chose to use our Python SDK. PubNub provides very easy-to-use APIs, so if you wanted to send out a message then it would be as simple as pubnub.publish and to receive a message it would be pubnub.subscribe, so the SDKs are already built out, but there was a little bit of tweaking for it to fit this particular home automation model.

DSC00241Geremy had to build out two parts: the phone or browser app, which is the dashboard that you see, and then the Python scripts running on the Raspberry Pi itself. So for the dashboard he typically used JavaScript and then Android or iOS, depending on the phone application, and then for the Raspberry Pi itself he used Python – Jeremy just had to write a couple of scripts that basically said, ‘When I receive a JSON message from my phone saying to switch on LED 1, do so at source.’ So the logic for the home automation had to be written in Python, but the software and the documentation already exists.

How easy would it be for people to recreate your LEGO Smart Home model for themselves?

It’s super easy. We are actually creating tutorials as well – we’re done with the temperature sensor, the humidity sensor, etc, and we just have a little bit of tweaking to do for the lights – so they’re going to be smaller follow-ups to the same video and blog that we’ve posted already. So it’s super easy to create and is meant for the hacker community, like a weekend or holiday project where you can just sit and build this whole thing in a couple of days. There’s a free tier in PubNub where we provide a sandbox account you can use for this, wherein you’re given publish and subscribe keys and you can go crazy. There’s a limit on the number of messages you can send but that’s way more than what you would need for a free tier. Everything’s open, so you can see it on our website, and it’s free up to 20 devices.

Pi close_b (1 of 1)And how straightforward would it be to scale up this project and use it for real home automation, with things like Philips Hues and Sonos speakers?

We have an intern who recently built out the Hue light bulbs with the Raspberry Pi in about half an hour; it wasn’t a big deal at all. PubNub is just plug-and-play – you build out all this software, put it on your hardware, and you don’t have to worry about which network you’re on, you don’t have to configure the routers or firewalls, any of that stuff. It’s very easy to scale with PubNub itself because we’re global – even if you get up to millions of users, irrespective of where you are in the world you still receive the message in less than a quarter of a second.

Scaling up

Interested in building a full-size home automation system with the Raspberry Pi? Grab a copy of the new issue – Liam Fraser explains how to remotely control lights and plug sockets, monitor the temperature and set up a video doorbell for your home, all connected through a tweaked Heimcontrol interface.

lud_155



from Linux User & Developer - the Linux and FOSS mag for a GNU generation http://ift.tt/1KEKyQB
via IFTTT

Wednesday 29 July 2015

Liked on YouTube: Hackers Remotely Kill a Jeep on the Highway—With Me in It

Hackers Remotely Kill a Jeep on the Highway—With Me in It
Two hackers have developed a tool that can hijack a Jeep over the internet. WIRED senior writer Andy Greenberg takes the SUV for a spin on the highway while the hackers attack it from miles away. Still haven’t subscribed to WIRED on YouTube? ►► http://wrd.cm/15fP7B7 CONNECT WITH WIRED Web: http://wired.com Twitter: https://twitter.com/WIRED Facebook: http://ift.tt/1dBz3Oa Pinterest: http://ift.tt/1JeJD7O Google+: http://ift.tt/1Ch4gR7 Instagram: http://ift.tt/1lUgynY Tumblr: http://WIRED.tumblr.com Want even more? Subscribe to The Scene: http://bit.ly/subthescene ABOUT WIRED WIRED is where tomorrow is realized. Through thought-provoking stories and videos, WIRED explores the future of business, innovation, and culture. Hackers Remotely Kill a Jeep on the Highway—With Me in It Executive Producer: Editor in Chief - Scott Dadich Consulting Producer: Creative Director - Billy Sorrentino and Editorial Director - Robert Capps Producer: Senior Producer - Sean Patrick Farrell Post Supervisor: Nurie Mohamed
via YouTube http://youtu.be/MK0SrxBC1xs

Hackers Remotely Kill a Jeep on the Highway—With Me in It

Polarization Camera Views the Invisible

Light polarization is an interesting phenomenon that is extremely useful in many situations… but human eyes are blind to detecting any polarization. Luckily, [David] has built a polarization-sensitive camera using a Raspberry Pi and a few off-the-shelf components that allows anyone to view polarization. [David] lists the applications as:

A polarimetric imager to detect invisible pollutants, locate landmines, identify cancerous tissues, and maybe even observe cloaked UFOs!

The build uses a standard Raspberry Pi 2 and a 5 megapixel camera which sits behind a software-controlled electro-optic polarization modulator that was scavenged from an auto-darkening welding mask. The mask is essentially a specialized LCD screen, which is easily electronically controlled. [David] whipped up some scripts on the Pi that control the screen, which is how the camera is able to view various polarizations of light. Since the polarization modulator is software-controlled, light from essentially any angle can be analyzed in any way via the computer.

There is a huge amount of information about this project on the project site, as well as on the project’s official blog. There have been other projects that use polarized light for specific applications, but this is the first we’ve seen of a software-controlled polarizing camera intended for general use that could be made by pretty much anyone.

The 2015 Hackaday Prize is sponsored by:


Filed under: digital cameras hacks, Raspberry Pi

from Hackaday » Raspberry Pi http://ift.tt/1SdOHBX
Taken From http://www.hackaday.com

Polarization Camera Views the Invisible

Light polarization is an interesting phenomenon that is extremely useful in many situations… but human eyes are blind to detecting any polarization. Luckily, [David] has built a polarization-sensitive camera using a Raspberry Pi and a few off-the-shelf components that allows anyone to view polarization. [David] lists the applications as:

A polarimetric imager to detect invisible pollutants, locate landmines, identify cancerous tissues, and maybe even observe cloaked UFOs!

The build uses a standard Raspberry Pi 2 and a 5 megapixel camera which sits behind a software-controlled electro-optic polarization modulator that was scavenged from an auto-darkening welding mask. The mask is essentially a specialized LCD screen, which is easily electronically controlled. [David] whipped up some scripts on the Pi that control the screen, which is how the camera is able to view various polarizations of light. Since the polarization modulator is software-controlled, light from essentially any angle can be analyzed in any way via the computer.

There is a huge amount of information about this project on the project site, as well as on the project’s official blog. There have been other projects that use polarized light for specific applications, but this is the first we’ve seen of a software-controlled polarizing camera intended for general use that could be made by pretty much anyone.

The 2015 Hackaday Prize is sponsored by:


Filed under: digital cameras hacks, Raspberry Pi

from Hackaday » raspberry pi http://ift.tt/1SdOHBX
via Hack a Day

Tuesday 28 July 2015

3D Mouse Drives Robot Arm

You’ve built the perfect robotic arm. How do you drive it? If you are [angrymop] you interface a 3D mouse from 3DConnexion via a few microcontroller boards. The Spacenavigator mouse is a staple anywhere professional CAD people are working, and it looks like it is a natural fit for a robot arm.

According to [angrymop], the Raspberry Pi can read the mouse’s commands via /dev/hidraw (that’s the raw human interface device). Each motion generates two lines of output. Each line has a unique identifying byte and values corresponding to the axis positions.

The Raspberry Pi then uses an SPI interface to talk to an ARM microcontroller and that drives the servos. The arm (the robot arm, not the processor) itself is well done, made from Lego Technic parts and common RC servos. Not that this is the most amazing thing we’ve ever seen built from Technic, but it is still pretty impressive.

You have to wonder if other 3D controllers might be useful for controlling robot arms or how the Spacenavigator would do controlling a bigger, more capable arm. Then again, maybe this arm would be the right size to build something inspired by Escher.


Filed under: ARM, Raspberry Pi, robots hacks

from Hackaday » raspberry pi http://ift.tt/1JNTj7X
via Hack a Day

3D Mouse Drives Robot Arm

You’ve built the perfect robotic arm. How do you drive it? If you are [angrymop] you interface a 3D mouse from 3DConnexion via a few microcontroller boards. The Spacenavigator mouse is a staple anywhere professional CAD people are working, and it looks like it is a natural fit for a robot arm.

According to [angrymop], the Raspberry Pi can read the mouse’s commands via /dev/hidraw (that’s the raw human interface device). Each motion generates two lines of output. Each line has a unique identifying byte and values corresponding to the axis positions.

The Raspberry Pi then uses an SPI interface to talk to an ARM microcontroller and that drives the servos. The arm (the robot arm, not the processor) itself is well done, made from Lego Technic parts and common RC servos. Not that this is the most amazing thing we’ve ever seen built from Technic, but it is still pretty impressive.

You have to wonder if other 3D controllers might be useful for controlling robot arms or how the Spacenavigator would do controlling a bigger, more capable arm. Then again, maybe this arm would be the right size to build something inspired by Escher.


Filed under: ARM, Raspberry Pi, robots hacks

from Hackaday » Raspberry Pi http://ift.tt/1JNTj7X
Taken From http://www.hackaday.com

Friday 24 July 2015

Liked on YouTube: Furze's Invention show - Freezer wave

Furze's Invention show - Freezer wave
In this episode of "Furze's Invention Show" I've created an entry from the ODDKA Odd Invention Challenge of which I was a judge. The Freezerwave idea has also been mentioned in a few of the comments of previous invention shows so thanks for ideas there have been some great ones. So want to cool as well as heat well this is a hint of what such a device could be like as although this does work its more of a work in progress. More info on the comp in link below but this is a great example of how your ideas could be made a reality just by posting in the comments so get thinking i've had some great ideas from people already. http://ift.tt/1zJSyMs If you have an idea for an invention you would like me to make then either put it in the comments or send me a message then it could be your invention on the table. To see all other episodes click on link below for full playlist. http://www.youtube.com/playlist?list=PLGjbAdaOBLBm0srtohPiOw5uyhyC0frBL
via YouTube http://youtu.be/MHm3fHVZitI

Furze's Invention show - Freezer wave

Making the High Voltage Ejector Bed

Learn everything about UAVs with The Drones Book

Drones are becoming more commonplace as a fun and exciting hobby that everyone can join in with. Where do you start though? What drone should you get, how can you use it and what are the limits of what you can do with one?

Look no further than The Drones Book, your complete guide to everything to do with quadcopters, UAVs or whatever you want to call them. It has information on every aspect of the drone experience, from what to buy, where to buy it and plenty of fun tutorials on how to use it. Want to race drones? It’s got it. Deliver packages Amazon style? That’s in there as well. There’s also a couple articles from us here at Linux User & Developer on how to hack your drone, allowing you to control it with python.

You can get The Drones Book now in stores and online at the Imagine Shop.



from Linux User & Developer - the Linux and FOSS mag for a GNU generation http://ift.tt/1ImnczA
via IFTTT

DDR-ing a Simon Game with a Raspberry Pi

Since 1998 we’ve been privileged to partake in an arcade game known as Dance Dance Revolution, but before that, way back in the 70’s, was the Simon game. It’s essentially a memory game that asks the player to remember a series of lights and sounds. [Uberdam] decided to get the best of both worlds and mixed the two together creating this giant foot controlled Simon game. (English translation.)

The wood platform that serves as the base of the project was fitted with four capacitive sensors, each one representing a “color” on the Simon game. When a player stomps on a color, a capacitive sensor sends a signal to a relay which in turn notifies the Raspberry Pi brain of the input. The Pi also takes care of showing the player the sequence of colored squares that must be stepped on, and keeps track of a player’s progress on a projector.

This is a pretty good way of showing how a small, tiny computer like the Raspberry Pi can have applications in niche environments while also being a pretty fun game. We all remember Simon as being frustrating, and we can only imagine how jumping around on a wooden box would make it even more exciting. Now, who can build a robot that can beat this version of Simon?


Filed under: Raspberry Pi

from Hackaday » Raspberry Pi http://ift.tt/1LGZcYT
Taken From http://www.hackaday.com

DDR-ing a Simon Game with a Raspberry Pi

Since 1998 we’ve been privileged to partake in an arcade game known as Dance Dance Revolution, but before that, way back in the 70’s, was the Simon game. It’s essentially a memory game that asks the player to remember a series of lights and sounds. [Uberdam] decided to get the best of both worlds and mixed the two together creating this giant foot controlled Simon game. (English translation.)

The wood platform that serves as the base of the project was fitted with four capacitive sensors, each one representing a “color” on the Simon game. When a player stomps on a color, a capacitive sensor sends a signal to a relay which in turn notifies the Raspberry Pi brain of the input. The Pi also takes care of showing the player the sequence of colored squares that must be stepped on, and keeps track of a player’s progress on a projector.

This is a pretty good way of showing how a small, tiny computer like the Raspberry Pi can have applications in niche environments while also being a pretty fun game. We all remember Simon as being frustrating, and we can only imagine how jumping around on a wooden box would make it even more exciting. Now, who can build a robot that can beat this version of Simon?


Filed under: Raspberry Pi

from Hackaday » raspberry pi http://ift.tt/1LGZcYT
via Hack a Day

Thursday 23 July 2015

Another IoT Platform in the (Blue)Mix

Many major companies (Intel, Oracle, Atmel, and IBM, for example) are competing to be the standard interconnect fabric for the Internet of Things. As a developer, it is hard to cut through the marketing hype and decide which platform is the best for you and your application. Luckily, there’s a plethora of projects on the web that showcase these frameworks. These project sites are an easy way to evaluate the strengths and weaknesses of IoT frameworks in practical applications without having to develop prototypes yourself.

[diyhacking], for example, posted a demo of using IBM’s Bluemix along with a Raspberry Pi, to do some simple home automation tasks. The project hardware is modest, using a PIR motion sensor and a relay to control an AC load. However, that’s good because it lets you focus on the Bluemix tools. The example client and server software is less than 200 lines of Python.

Bluemix looks like it has good integration with the Raspberry Pi and features a simulator so you can work without real hardware for development. Bluemix does offer a free plan (with limits), but the fee options may be a turn off to some IoT hackers.

It was surprising, though, to see a home automation relay (which, presumably, is carrying wall current) put on a solderless breadboard. Although there’s nothing wrong with that in theory, it is often a bad idea in practice.

That still won’t stop you from comparing this project to Thingspeak or any of the other platforms out there.


Filed under: Raspberry Pi

from Hackaday » Raspberry Pi http://ift.tt/1HVBGTm
Taken From http://www.hackaday.com

Another IoT Platform in the (Blue)Mix

Many major companies (Intel, Oracle, Atmel, and IBM, for example) are competing to be the standard interconnect fabric for the Internet of Things. As a developer, it is hard to cut through the marketing hype and decide which platform is the best for you and your application. Luckily, there’s a plethora of projects on the web that showcase these frameworks. These project sites are an easy way to evaluate the strengths and weaknesses of IoT frameworks in practical applications without having to develop prototypes yourself.

[diyhacking], for example, posted a demo of using IBM’s Bluemix along with a Raspberry Pi, to do some simple home automation tasks. The project hardware is modest, using a PIR motion sensor and a relay to control an AC load. However, that’s good because it lets you focus on the Bluemix tools. The example client and server software is less than 200 lines of Python.

Bluemix looks like it has good integration with the Raspberry Pi and features a simulator so you can work without real hardware for development. Bluemix does offer a free plan (with limits), but the fee options may be a turn off to some IoT hackers.

It was surprising, though, to see a home automation relay (which, presumably, is carrying wall current) put on a solderless breadboard. Although there’s nothing wrong with that in theory, it is often a bad idea in practice.

That still won’t stop you from comparing this project to Thingspeak or any of the other platforms out there.


Filed under: Raspberry Pi

from Hackaday » raspberry pi http://ift.tt/1HVBGTm
via Hack a Day

Liked on YouTube: Making the High Voltage Ejector Bed

Making the High Voltage Ejector Bed
So i got asked to make the ultimate alarm clock to celebrate Taylors of Harragate “High Voltage” coffee and as you viewers have been asking for a bed that fires you out in the morning the match was made so here we go. Part 2 out next Thursday the 30th of july Find out more about “high Voltage” Coffee here http://ift.tt/1uQbg3f The music is by 7DAZE and you can find out more about them here http://ift.tt/1ejrjjy Don’t forget to Subscribe as there is always more great videos to come.
via YouTube http://youtu.be/tg_STsy86Fw

Real Crime magazine, out now!

Wednesday 22 July 2015

Train Times to CLI

trainscli

View train times in real-time in your console
Alter WKI for the station code of your location station and it should print the times for you.
i've forked this from mattshirtliffe/trainscli
altered it only slightly to remove an error from BS moaning about the type of data to parse and removed whitespace on print out.

Train times print out in the command line using python.

Python RSS feed to CLI

python_rss_to_cli

Reads an RSS feed and outputs it to the CLI
Currently set to read the liverpool echo sports news.



Magic Mirror

Magic Mirror

Original Readme Info

The super magic interface of my personal Magic Mirror. More information about this project can be found on my blog.
Runs as a php script on a web server with basically no external dependencies.
Modify js/config.js to change some general variables (language, wather location, compliments, news feed RSS) and calendar.php to add your own ICS calendar.

My Addtions

Edit trains.js to edit the train journey you will need to know.

Main Changes

Jquery on google CDN.
Weather icons on CDN.
JS updated to show icons for weather with CDN.
Removed unsused code for dishwasher
Added train times from National Rail.
No cache of page.
Git ver check delayed by 3 mins to save pulling on device and log files.
W3C Validation fails only due to one DIV

To Do:

Ideas required.... let me know what you want.

Liked on YouTube: EEVblog #716 - Raspberry Pi 2 Xenon Flash Problem Explained

EEVblog #716 - Raspberry Pi 2 Xenon Flash Problem Explained
Dave investigates and explains the Raspberry Pi 2 Xenon flash problem. Where the Pi2 will reset and lockup when a photo is taken of it from a Xenon flash camera. How and why is the photoelectric effect responsible? UPDATE: I have tried a UV filter in front of the flash and the problem remains. NCP6343 Switchmode converter: http://ift.tt/1Vuk7mK Forum: http://ift.tt/1Mv2JK6 EEVblog Main Web Site: http://www.eevblog.com The 2nd EEVblog Channel: http://www.youtube.com/EEVblog2 Support the EEVblog through Patreon! http://ift.tt/Zyxr10 EEVblog Amazon Store (Dave gets a cut): http://ift.tt/184n0Up Donations: http://ift.tt/184mZzR Projects: http://ift.tt/184mZzS Electronics Info Wiki: http://ift.tt/184mZzT
via YouTube http://youtu.be/SrDfRCi1UV0

Liked on YouTube: Raspberry Pi B+ Cluster (Super Computer) Part 1

Raspberry Pi B+ Cluster (Super Computer) Part 1
GeauxRobot Raspberry Pi B+ Stackable Case: http://goo.gl/F1LAc8 Raspberry Pi B+ http://goo.gl/tDMraE SanDisk 8GB microSD http://goo.gl/21Sro2 NETGEAR 5-Port Switch http://goo.gl/Ds5csd Anker [3-Pack] Premium 3ft Micro USB http://goo.gl/w8DT6V Amazon USB Hub http://goo.gl/hWYhoN Belkin RJ45 CAT 5e 3ft Cable http://goo.gl/dEOOLc Brought to you by http://ift.tt/1abnRW0 Google Plus: http://ift.tt/1LWxsPV Twitter: https://twitter.com/rasimmuratovic Facebook: http://ift.tt/1C2rkNQ Instagram: http://ift.tt/1LWxsPX My Loot Crate Link: http://ift.tt/1LWxsPY
via YouTube http://youtu.be/JtX9lVDsqzg

Liked on YouTube: Just Bought A Raspberry Pi? 11 Things You Need To Know

Just Bought A Raspberry Pi? 11 Things You Need To Know
In this video, we explain everything you might need to know if you've just bought a Raspberry Pi, or are thinking of buying one. You might also want to download our Unofficial Guide to the Raspberry Pi: http://ift.tt/Zv70Hw Check out the full post at MakeUseOf: http://ift.tt/1kNQNWr
via YouTube http://youtu.be/vw2nTpLFof8

Thursday 16 July 2015

Liked on YouTube: Ben Heck’s Raspberry Pi Media Center

Ben Heck’s Raspberry Pi Media Center
In this episode Ben and Felix work together to build a Raspberry Pi media streamer that can be used with a television and a server. Win a Raspberry Pi Media Center Kit at - http://ift.tt/1g7mKT1 Learn more about Raspberry Pi Projects at - http://ift.tt/1oAI4dP Like the Ben Heck Show at http://ift.tt/1rcCbzL
via YouTube http://youtu.be/P7m6HTV7ysM

Liked on YouTube: Raspberry Pi 2 - Review!

Raspberry Pi 2 - Review!
The Raspberry Pi 2 is a remarkable, powerful little machine that is highly hackable and can run multiple OS'! Check out our full review! http://ift.tt/17iRMe6 Get it here! http://ift.tt/19Hxo7Z - StarterKit Talk about Android in our forums: http://ift.tt/1kU1B18 Subscribe to our YouTube channel: http://www.youtube.com/subscription_center?add_user=androidauthority ---------------------------------------------------- Stay connected to Android Authority: - http://ift.tt/lZ4kEL - http://ift.tt/1s9HkgA - http://ift.tt/1tw4yKf - http://twitter.com/androidauth/ - http://ift.tt/1s9HkwZ Follow the Team: Josh Vergara: http://ift.tt/1f8WlpY Joe Hindy: http://ift.tt/18ner8G Lanh Nguyen: http://ift.tt/1hN3VqL Jayce Broda: http://ift.tt/1hp6V1S Kevin Nether: http://ift.tt/1cBQHgC Gary Sims: http://ift.tt/1rE1gu2 Ash Tailor: http://ift.tt/1xBxdzY
via YouTube http://youtu.be/ya9WSphlCF4

Ben Heck’s Raspberry Pi Media Center

Raspberry Pi 2 - Review!

View train times in real-time in your console

View train times in real-time in your console


trainscli

View train times in real-time in your console
Alter WKI for the station code of your location station and it should print the times for you.
i've forked this from mattshirtliffe/trainscli
altered it only slightly to remove an error from BS moaning about the type of data to parse and removed whitespace on print out.




PHP - Convert UTC to BST

Convert UTC to GMT Date PHP
123
$date = "2015-05-31";
$d=strtotime($date);
$newdate = date('d-m-Y',$d);

Grab large image from pic.twitter.com in php

123456789101112131415161718192021222324252627282930313233343536
<?php
// Defining the basic scraping function
function scrape_between($data, $start, $end){
$data = stristr($data, $start); // Stripping all data from before $start
$data = substr($data, strlen($start)); // Stripping $start
$stop = stripos($data, $end); // Getting the position of the $end of the data to scrape
$data = substr($data, 0, $stop); // Stripping all data from after and including the $end of the data to scrape
return $data; // Returning the scraped data from the function
}
function curl($url) {
// Assigning cURL options to an array
$options = Array(
CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data
CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers
CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers
CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out
CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries
CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow
CURLOPT_USERAGENT => "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8", // Setting the useragent
CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function
);
$ch = curl_init(); // Initialising cURL
curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options
$data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable
curl_close($ch); // Closing cURL
return $data; // Returning the data from the function
}
$scraped_page = curl("pic.twitter.com/mhSJp6qkmP");
$scraped_data = scrape_between($scraped_page, '<meta property="og:image" content="', ':large">');
echo $scraped_data;
?>

Change text inside a mysql colum

Replace Word with another word using MYSQL
123
To find a string in a certain field and replace it with another string:
 
update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');

Amazon

Donate

Donate Towards More Raspberry PI's for Projects