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
## Syntax highlighting of HTML with mixed-ins, for the editor Nano. | |
## | |
syntax "html" "\.(html|mak)$" | |
magic "HTML document text" | |
color brightblue start="<" end=">" | |
color red "&[^;[[:space:]]]*;" | |
# AngularJS and similar | |
color brightwhite start="\{\{" end="\}\}" | |
color green "ng-[^>\"\ \=]*" | |
color green start="ng-[^>\"\ \=]*\=\"" end="\"" |
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
#!/usr/bin/env python2 | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |
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
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../core-icons/iconsets/av-icons.html"> | |
<link rel="import" href="../paper-fab/paper-fab.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<polymer-element name="my-element"> | |
<template> |
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
func BindHexEncodedField(field *[]byte) func(string, []string, binding.Errors) binding.Errors { | |
return func(fieldName string, formVals []string, errs binding.Errors) binding.Errors { | |
var err error | |
*field, err = hex.DecodeString(formVals[0]) | |
if err != nil { | |
errs.Add([]string{fieldName}, binding.DeserializationError, err.Error()) | |
} | |
return errs | |
} | |
} |
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 smtplib | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.base import MIMEBase | |
from email.mime.text import MIMEText | |
from email.header import Header | |
from email.Utils import COMMASPACE, formatdate | |
from email import Encoders | |
try: | |
import turbomail |
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
#!/usr/bin/env python | |
# | |
# fakemail (Python version) | |
# | |
# $Id: fakemail.py,v 1.4 2011/06/09 16:57:10 ashtong Exp $ | |
import asyncore | |
import getopt | |
import os |
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 csv | |
__all__ = ['read_csv_file'] | |
def unicode_csv_reader(utf8_data, dialect=csv.excel, **kwargs): | |
csv_reader = csv.reader(utf8_data, dialect=dialect, **kwargs) | |
for row in csv_reader: | |
yield [unicode(cell, 'utf-8', errors='ignore') for cell in row] | |
def read_csv_file(filename): |
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
#!/usr/bin/env python | |
# The output geneally looks like this: | |
# | |
# $ ./serialization.py | |
# Dumping: | |
# json: 6.40960884094 | |
# simplejson: 6.82945179939 | |
# cjson: 2.23045802116 | |
# ujson: 0.806604146957 |
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
#!/bin/bash | |
# | |
# Backup script that tries to utilize all available disc spindles and cores. | |
# For every target archive ("sink") create a file "sink.list" | |
# which contains what to backup ("sources") linewise. | |
# (Prefer plzip to xz if you have the former at hand.) | |
# | |
# wrapper to: tar sort xargs xz | |
# | |
# run: ./backup.sh run *.list |
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
[Unit] | |
Description=newrelic-sysmond | |
After=docker.service | |
[Service] | |
ProtectHome=true | |
ProtectSystem=full | |
PIDFile=/run/newrelic-sysmond.pid | |
ExecStartPre=-/bin/bash -c "[[ -x /opt/sbin/nrsysmond ]] || (mkdir -p /opt/sbin; docker pull newrelic/nrsysmond:latest && rsync -au $(docker inspect newrelic/nrsysmond:latest | jq -r '.[0].GraphDriver.Data.UpperDir // .[0].GraphDriver.Data.RootDir')/usr/sbin/nrsysmond /opt/sbin/)" |
OlderNewer