This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import paramiko | |
| cmd = "sudo /etc/init.d/mediatomb restart" | |
| ssh = paramiko.SSHClient() | |
| ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
| ssh.connect('microwave', username='matt') | |
| stdin, stdout, stderr = ssh.exec_command(cmd) | |
| print stdout.readlines() | |
| ssh.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Seen at: http://github.com/strcat/dotfiles/ and in grml. | |
| # Robust replacement for global aliases, and you can edit them too. | |
| # requires extended globbing. | |
| typeset -A abbrevs | |
| abbrevs=('...' '../..' | |
| '....' '../../..' | |
| 'BG' '& exit' | |
| 'C' '| wc -l' | |
| 'G' '|& grep --color=auto' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>commands</key> | |
| <array> | |
| <dict> | |
| <key>argument</key> | |
| <dict> | |
| <key>beforeRunningCommand</key> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>commands</key> | |
| <array> | |
| <dict> | |
| <key>argument</key> | |
| <dict> | |
| <key>beforeRunningCommand</key> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # Add comments to the end of lines | |
| # Set `save` to `nothing` | |
| # Set `input` to `selected text` or `line` | |
| # Set `output` to `replace selected text` | |
| import sys, os | |
| comment_char = os.environ.get('TM_COMMENT_START', '#') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from IPython.ColorANSI import TermColors | |
| colors = TermColors() | |
| print 'IPython Colors:' | |
| for color in dir(colors): | |
| if not color.startswith('_'): | |
| print getattr(colors, color), color | |
| print colors.Blue, 'blue', colors.Red, 'green' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| t = -pi:0.1:pi; | |
| plot(t, sin(t)./t, t, cos(t), 'linewidth', 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| plot(-pi:0.1:pi, sin(-pi:0.1:pi)./-pi:0.1:pi, -pi:0.1:pi, cos(-pi:0.1:pi), 'linewidth', 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| from enthought.traits.api import * | |
| from enthought.traits.ui.api import * | |
| from enthought.chaco.api import * | |
| from enthought.enable.component_editor import ComponentEditor | |
| from enthought.chaco.chaco_plot_editor import ChacoPlotItem | |
| from numpy import arange | |
| from numpy import sin, cos, pi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| from enthought.traits.api \ | |
| import HasTraits, Array, Range, Float, Enum, on_trait_change, Property | |
| from enthought.traits.ui.api import View, Item | |
| from enthought.chaco.chaco_plot_editor import ChacoPlotItem | |
| from numpy import arange | |
| from numpy import sin,pi | |
| class Data(HasTraits): |