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
| # -*- coding: utf-8 -*- | |
| # pipes.py - Command-piping syntax for generators/coroutines in Python. | |
| """ | |
| pipes.py - Command-piping syntax for generators/coroutines in Python. | |
| Example: | |
| >>> from pipes import * | |
| >>> chain1 = counter(5) | adder(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
| This gist contains two files for simple indexing of PDF files. | |
| == requirements == | |
| First you need to install Solr (which requires a Java JDK): Download a tar or zipfile at http://www.apache.org/dyn/closer.cgi/lucene/solr/ and unpack it to a directory of your choice. Go into this directory and start solr running in jetty by: | |
| $ cd example | |
| $ java -jar start.jar | |
| Then locate your browser to http://localhost:8983/solr/ |
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
| # vim: ft=sh:ts=4:sw=4:autoindent:expandtab: | |
| # Author: Avishai Ish-Shalom <avishai@fewbytes.com> | |
| # We need to specify GNU sed for OS X, BSDs, etc. | |
| if [[ "$(uname -s)" == "Darwin" ]]; then | |
| SED=gsed | |
| else | |
| SED=sed | |
| fi |
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
| # knife.rb config snippet to make knife ssh command use your own login | |
| # instead of hard-coded `root', `ubuntu' or other name. Tries to get | |
| # login for your domain from ~/.ssh/config and if it's not found | |
| # there, uses your local login. | |
| require 'net/ssh' | |
| require 'etc' | |
| knife[:ssh_user] = | |
| Net::SSH::Config.for('some.host.inside.your.domain')[:user] || |
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
| #!/bin/sh | |
| # | |
| # chkconfig: 35 99 99 | |
| # description: Node.js /home/nodejs/sample/app.js | |
| # | |
| . /etc/rc.d/init.d/functions | |
| # Creamos un fichero PID para monit | |
| SCRIPT="$(basename $0)" |
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
| 0 - Read http://blog.databigbang.com/running-your-own-anonymous-rotating-proxies/ | |
| 1 - Install monit, haproxy, tor and delegated. | |
| 2 - Setup your environment in the setup.rb file | |
| 3 - Just run > ruby setup.rb | |
| 4 - ........... | |
| 5 - PROFIT! > http://www.southparkstudios.com/clips/151040/the-underpants-business |
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 | |
| #-*- coding: utf-8 -*- | |
| import os | |
| import time | |
| import random | |
| ncols = 26 | |
| nrows = 20 | |
| def cls(): |
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
| var child = require('child_process'), | |
| util = require('util'), | |
| netstat = child.spawn('netstat', ['-nb']), | |
| out = '' | |
| netstat.stdout.on('data', function(data) { | |
| out += data | |
| }) | |
| netstat.stderr.on('data', function(data) { | |
| console.log('err: ' + data) |
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
| Variables | |
| ========== | |
| predefined variables : | |
| - inventory_hostname (fqdn) (normally the same as ansible.fqdn) | |
| - inventory_hostname_short | |
| To know the return codes returned by ansible modules, just use plain ansible -vvv to see them : | |
| ansible -i ~/ansible/arrfab.net/hosts/hosts.cfg -vvv -m copy -a 'src=files/sysinfo dest=/etc/sysinfo' tungstene.arrfab.net | |
| tungstene.arrfab.net | success >> { | |
| "changed": true, |
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
| $ redis-cli | |
| > config set stop-writes-on-bgsave-error no |
OlderNewer