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
package main | |
import "code.google.com/p/go-tour/pic" | |
func imageFun(x, y int) uint8 { | |
return uint8(x) ^ uint8(y) | |
} | |
func Pic(dx, dy int) [][]uint8 { | |
image := make([][]uint8, dx) |
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
package main | |
import ( | |
"code.google.com/p/go-tour/wc" | |
"strings" | |
) | |
func WordCount(s string) map[string]int { | |
counts := make(map[string]int) | |
splitStrings := strings.Split(s, " ") |
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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func newtAppx(x float64, appx float64) float64 { | |
return appx - ((math.Pow(appx, 2.0) - x) / (2 * appx)) | |
} |
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
export search="Find string" | |
export replace="Replace string" | |
grep -l -R $search app spec lib | xargs sed -i -e "s/$search/$replace/g" | |
find . -name "*-e" | xargs rm |
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
(ns pallet.crate.lein | |
(:require [pallet.action.remote-file :as remote-file])) | |
(def default-install-path "/usr/local/bin") | |
(def script-url "https://raw.github.com/technomancy/leiningen/stable/bin/lein") | |
(defn- install-script | |
[session install-path] | |
(-> session | |
(remote-file/remote-file |
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
(def cassandra-conf "conf/cassandra/cassandra.yaml") | |
(def cassandra-yaml-defaults | |
{:cluster-name "My Cluster" | |
:initial-token "0" | |
:partitioner :random | |
:data-file-directories ["/var/lib/cassandra/data"] | |
:commit-log-dir "/var/lib/cassandra/commitlog" | |
:saved-caches-dir "/var/lib/cassandra/saved_caches" | |
:seeds ["127.0.0.1"] |
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
09:25:54.391 [clojure-agent-send-off-pool-0] INFO pallet.execute - Output: 192.168.56.106 | |
- retrieves files from the web | |
i whiptail - Displays user-friendly dialog boxes from s | |
i whois - an intelligent whois client | |
i A x-ttcidfont-conf - TrueType and CID fonts configuration for X | |
i A x11-common - X Window System (X.Org) infrastructure | |
i A x11proto-core-dev - X11 core wire protocol and auxiliary heade | |
i A x11proto-input-dev - X11 Input extension wire protocol | |
i A x11proto-kb-dev - X11 XKB extension wire protocol | |
i A xauth - X authentication utility |
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
remote-file tmp-dir/nginx-0.7.65.tar.gz... | |
md5sum: tmp-dir/nginx-0.7.65.tar.gz: No such file or directory | |
tmp-dir/nginx-0.7.65.tar.gz.new: No such file or directory | |
mv: cannot stat `tmp-dir/nginx-0.7.65.tar.gz.new': No such file or directory | |
mv: cannot stat `tmp-dir/nginx-0.7.65.tar.gz.new': No such file or directory |
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
require 'rubygems' | |
require 'wirble' | |
#require 'interactive_editor' | |
Wirble.init | |
Wirble.colorize | |
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER') | |
require 'logger' | |
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT) | |
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
user@192.168.56.105's password: | |
Linux ubuntu 2.6.35-22-server #35-Ubuntu SMP Sat Oct 16 22:02:33 UTC 2010 x86_64 GNU/Linux | |
Ubuntu 10.10 | |
Welcome to the Ubuntu Server! | |
* Documentation: http://www.ubuntu.com/server/doc | |
System information as of Sat Mar 31 10:59:28 PDT 2012 | |
System load: 0.0 Processes: 71 |