Skip to content

Instantly share code, notes, and snippets.

Created November 18, 2015 09:42
Show Gist options
  • Save anonymous/a863d7b493c4b09733ec to your computer and use it in GitHub Desktop.
Save anonymous/a863d7b493c4b09733ec to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# PHP is a great language"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<?php\r\n",
"header(\"HTTP/1.1 418\");\r\n",
"print 123;\r\n",
"exit;\r\n"
]
}
],
"source": [
"!cat t1.php"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<?php\r\n",
"// header(\"HTTP/1.1 418\");\r\n",
"header(\"HTTP/1.1 418 I'm a teapot\");\r\n",
"print 123;\r\n",
"exit;\r\n"
]
}
],
"source": [
"!cat t2.php"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[' % Total % Received % Xferd Average Speed Time Time Time Current', ' Dload Upload Total Spent Left Speed', '', ' 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0', ' 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0', ' 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0', 'HTTP/1.1 500 Internal Server Error', 'Date: Wed, 18 Nov 2015 09:41:17 GMT', 'Server: Apache/2.4.16 (Unix) PHP/5.5.28', 'X-Content-Type-Options: nosniff', 'X-Powered-By: PHP/5.5.28', 'Content-Type: text/html', '']\n"
]
}
],
"source": [
"out = !curl -I http://d8.dev/t1.php\n",
"print out"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[' % Total % Received % Xferd Average Speed Time Time Time Current', ' Dload Upload Total Spent Left Speed', '', ' 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0', ' 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0', \"HTTP/1.1 418 I'm a teapot\", 'Date: Wed, 18 Nov 2015 09:41:36 GMT', 'Server: Apache/2.4.16 (Unix) PHP/5.5.28', 'X-Content-Type-Options: nosniff', 'X-Powered-By: PHP/5.5.28', 'Content-Type: text/html', '']\n"
]
}
],
"source": [
"out = !curl -I http://d8.dev/t2.php\n",
"print out"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.10"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment