Skip to content

Instantly share code, notes, and snippets.

sP, cP := net.Pipe()
sCfg := &tls.Config{
Certificates: []tls.Certificate{serverCert},
RootCAs: roots,
ClientAuth: tls.RequireAndVerifyClientCert,
ClientCAs: roots,
InsecureSkipVerify: false,
}
@madhusudancs
madhusudancs / 0_reuse_code.js
Created February 17, 2016 17:45
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
$(document).ready(function(){
/* look for all checkboes that have a class 'chk' attached to it and check if it was checked */
$(".chk").change(function() {
$.get("/SpringTest/make", getCheckedElements(), searchResultUpdate, 'json');
});
});
var searchResultUpdate = function( data ) {
$(".result").html( data ); // Replace this with whatever search results HTML updating code you want.
}
<!DOCTYPE html>
<html>
<head>
<title></title>
<!-- Obtain Bootstrap style sheet from CDN (online service) so it doesn't have to be on my machine -->
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet" media="screen">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.10/angular.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
# Copyright 2014 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
- name: CreateProposalRevisionForAllProposals
mapper:
input_reader: mapreduce.input_readers.DatastoreKeyInputReader
handler: summerofcode.mapreduce.create_revision_model.process
params:
- name: entity_kind
value: summerofcode.models.proposal.Proposal
...
from django import forms as djangoforms
from django.utils import translation
...
...
...
class ModelForm(djangoforms.ModelForm):
"""Django ModelForm class which uses our implementation of BoundField.
~ 127$ netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6012 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6013 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:41152 0.0.0.0:* LISTEN
tcp 0 0 10.1.0.1:54310 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3142 0.0.0.0:* LISTEN
@madhusudancs
madhusudancs / gist:5988916
Created July 13, 2013 00:56
Network stats
~ 127$ nstat
#kernel
IpInReceives 2218 0.0
IpForwDatagrams 1144 0.0
IpInDelivers 1074 0.0
IpOutRequests 1860 0.0
TcpActiveOpens 52 0.0
TcpAttemptFails 50 0.0
TcpInSegs 1033 0.0
TcpOutSegs 676 0.0
-------------------------------------------------------------------------------
Test set: edu.uci.ics.asterix.installer.test.AsterixLifecycleIT
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 15.903 sec <<< FAILURE!
edu.uci.ics.asterix.installer.test.AsterixLifecycleIT Time elapsed: 0 sec <<< ERROR!
java.lang.Exception: Unable to start Zookeeper Service. This could be because of the following reasons.
1) Managix is incorrectly configured. Please run /lv_tmp/scratch/mcheelan/betafixes-asterixdb/asterix-installer/target/asterix-installer-0.0.6-SNAPSHOT-binary-assembly/bin/managix validate to run a validation test and correct the errors reported.
2) If validation in (1) is successful, ensure that java_home parameter is set correctly in Managix configuration (/lv_tmp/scratch/mcheelan/betafixes-asterixdb/asterix-installer/target/asterix-installer-0.0.6-SNAPSHOT-binary-assembly/conf/managix-conf.xml)
at edu.uci