Updated notebook to v3.

This commit is contained in:
Donne Martin 2015-06-03 13:45:42 -04:00
parent 84014940d9
commit c71f9d379a

View File

@ -1,12 +1,4 @@
{ {
"metadata": {
"name": "",
"signature": "sha256:7cdf1e36fef9e69cd9007eb0c5945e4d6440b31108bfddd6f19aa71d0d1a06ab"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [ "cells": [
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -40,13 +32,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!df -h" "!df -h"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -57,13 +50,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!du -h ./" "!du -h ./"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -74,13 +68,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!du -sh ../" "!du -sh ../"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -91,13 +86,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!du -csh ./" "!du -csh ./"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -115,13 +111,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!wc -l < file.txt" "!wc -l < file.txt"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -132,13 +129,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!grep -c \".\" file.txt" "!grep -c \".\" file.txt"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -149,13 +147,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!split -l 20 file.txt new" "!split -l 20 file.txt new"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -166,13 +165,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!split -l 802 -a 1 file.csv dir/part-user-csv.tbl-" "!split -l 802 -a 1 file.csv dir/part-user-csv.tbl-"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -185,18 +185,19 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"List number of files matching \u201c.txt\":" "List number of files matching “.txt\":"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!ls -1 | grep .txt | wc -l" "!ls -1 | grep .txt | wc -l"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -207,13 +208,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!cat * | grep -c \"foo\" folder/part*" "!cat * | grep -c \"foo\" folder/part*"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -224,13 +226,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"!sed -i '/Important Lines: /d\u2019 original_file" "collapsed": false
], },
"language": "python", "outputs": [],
"metadata": {}, "source": [
"outputs": [] "!sed -i '/Important Lines: /d original_file"
]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -241,8 +244,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Compress zip\n", "# Compress zip\n",
"!zip -r archive_name.zip folder_to_compress\n", "!zip -r archive_name.zip folder_to_compress\n",
"\n", "\n",
@ -269,10 +276,7 @@
"\n", "\n",
"# Uncompress all tar.gz in current directory to another directory\n", "# Uncompress all tar.gz in current directory to another directory\n",
"!for i in *.tar.gz; do echo working on $i; tar xvzf $i -C directory/ ; done" "!for i in *.tar.gz; do echo working on $i; tar xvzf $i -C directory/ ; done"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -283,8 +287,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Display the curl output:\n", "# Display the curl output:\n",
"!curl donnemartin.com\n", "!curl donnemartin.com\n",
"\n", "\n",
@ -308,10 +316,7 @@
"\n", "\n",
"# Authenticate -u\n", "# Authenticate -u\n",
"!curl -u username:password url" "!curl -u username:password url"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -322,8 +327,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Display sorted info about processes\n", "# Display sorted info about processes\n",
"!top\n", "!top\n",
"\n", "\n",
@ -338,10 +347,7 @@
"\n", "\n",
"# Display running processes as a tree\n", "# Display running processes as a tree\n",
"!pstree" "!pstree"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -359,16 +365,17 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"export PS1='\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\W\\[\\033[00m\\]\\$ '\n", "export PS1='\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\W\\[\\033[00m\\]\\$ '\n",
"export CLICOLOR=1\n", "export CLICOLOR=1\n",
"export LSCOLORS=ExFxBxDxCxegedabagacad\n", "export LSCOLORS=ExFxBxDxCxegedabagacad\n",
"alias ls='ls -GFh'" "alias ls='ls -GFh'"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -379,13 +386,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!source ~/.bash_profile" "!source ~/.bash_profile"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -396,8 +404,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"Normal mode: esc\n", "Normal mode: esc\n",
"\n", "\n",
"Basic movement: h, j, k, l\n", "Basic movement: h, j, k, l\n",
@ -427,10 +439,7 @@
"\n", "\n",
"Quit without saving changes: q!\n", "Quit without saving changes: q!\n",
"Write the current file and quit: :wq" "Write the current file and quit: :wq"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -441,13 +450,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!vimtutor" "!vimtutor"
], ]
"language": "python",
"metadata": {},
"outputs": []
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -458,20 +468,39 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"collapsed": false, "execution_count": null,
"input": [ "metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!cd ~\n", "!cd ~\n",
"!vim .vimrc\n", "!vim .vimrc\n",
"# Add the following to ~/.vimrc\n", "# Add the following to ~/.vimrc\n",
"syntax on\n", "syntax on\n",
":wq" ":wq"
],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
] ]
}
],
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
} }