This file contains 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
zpool get all zones | |
NAME PROPERTY VALUE SOURCE | |
zones size 2.72T - | |
zones capacity 42% - | |
zones altroot - default | |
zones health ONLINE - | |
zones guid 1181797254408314611 default | |
zones version - default | |
zones bootfs - default | |
zones delegation on default |
This file contains 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
# For a bunch of Python files | |
vim -c "bufdo! set eventignore-=Syntax| %s/original/replacement/gce" *.py | |
# if you want to save as you go | |
vim -c "bufdo! set eventignore-=Syntax| %s/original/replacement/gce | update" *.py | |
# Breaking it down: | |
# bufdo! -> so that it doesn't complain about erroring | |
# set eventignore-=Syntax -> so that every buffer gets syntax highlighting | |
# /gce -> optional, global search in the line with confirmation and eating up the errors |
This file contains 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
# ideally we would have output like: | |
$ python process.py | |
this is an stderr line | |
this is an stdout line | |
this is an stderr line | |
this is an stdout line |
This file contains 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
# app name: ayni | |
# this works, inheriting from it, committing and re-using the database | |
# | |
# ayni model __init__.py file doesn't have anything odd and can be found: | |
# https://github.com/alfredodeza/ayni/blob/master/ayni/models/__init__.py | |
# | |
import os | |
from unittest import TestCase | |
from pecan import set_config | |
from pecan.testing import load_test_app |
This file contains 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 random | |
class Markov(object): | |
def __init__(self, open_file): | |
self.cache = {} | |
self.open_file = open_file | |
self.words = self.file_to_words() | |
self.word_size = len(self.words) |
This file contains 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
# create the new rpm directory | |
mkdir rpm-hammer | |
cd rpm-hammer | |
# make the directories for the distros we need for x86_64 | |
mkdir -p el6/x86_64/ | |
mkdir -p el7/x86_64/ | |
mkdir -p fc20/x86_64/ | |
mkdir -p rhel6/x86_64/ | |
mkdir -p rhel7/x86_64/ |
This file contains 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
var els=document.getElementsByTagName('input'); for(var x = 0; x < els.length; x++) { if(els[x].type.toLowerCase() == 'password' ) { var test = els[x].type = 'text'; } } |
This file contains 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 testrunner import describe, it, before, after | |
import MyClass | |
with describe("My class can add"): | |
with before: | |
c = MyClass() | |
with after: | |
"clean up goes here" |
This file contains 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
@echo off | |
rem Windows Driver script for Konira | |
setlocal | |
rem Use a full path to Python (relative to this script) as the standard Python | |
rem install does not put python.exe on the PATH... | |
rem %~dp0 is the directory of this script | |
python "%~dp0konira" %* |
This file contains 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
# The web server: | |
import SimpleHTTPServer | |
import SocketServer | |
PORT = 8000 | |
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler | |
httpd = SocketServer.TCPServer(("", PORT), Handler) |
OlderNewer