Use this so you can SSH into a VM you just made.
On the HOST
For Virtual Box:
Put Network Settings from NAT
to Bridged Adapter
the Host VM.
To start headless : Hold shift down and clic start button
On the server you will be SSH'ing into:
def _sequential_ints(self, item_vals): | |
prev = 0 | |
result = False | |
item_vals.sort() | |
for i in item_vals: | |
if prev > 0: | |
if i - prev != 1: | |
break | |
prev = i | |
else: |
def _sequential_ints(self, item_vals): | |
return len(item_vals) == len(set(item_vals)) == max(item_vals) - min(item_vals) + 1 | |
""" | |
len(item_vals) returns the number of items in the list. | |
len(set(item_vals)) returns the unique number of items in the list | |
If those == then we know there are no dupes in the list. | |
Lastly, if there are no dupes and the max value minus the min value (+1) | |
equals the len(item_vals), then we know that each int is sequential and that there are no duplicates. |
go get code.google.com/p/go.talks/present | |
go get code.google.com/p/go.tools/cmd/present | |
cd ~/go/src/code.google.com/p/go.talks/2014 | |
present hellogophers.slide | |
/* Open your web browser and visit http://127.0.0.1:3999/ */ | |
/* Open up the various .slide files to get an idea of how to format your presentation */ |
// http://play.golang.org/p/YxTFqTxBPv | |
package main | |
import ( | |
"crypto/hmac" | |
"crypto/rand" | |
"crypto/sha512" | |
"encoding/base64" | |
"encoding/json" |
Use this so you can SSH into a VM you just made.
On the HOST
For Virtual Box:
Put Network Settings from NAT
to Bridged Adapter
the Host VM.
To start headless : Hold shift down and clic start button
On the server you will be SSH'ing into:
sudo apt-get update
# Fetches the list of available updates
sudo apt-get dist-upgrade
# for additional major updates/upgrades
sudo apt-get upgrade
#to load any updates.
From terminal, first run:
sudo aptitude install build-essential
Then do the normal redis install as mentioned on their website.
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
I hereby claim:
To claim this, I am signing this object:
package main | |
import ( | |
"time" | |
"github.com/hybridgroup/gobot" | |
"github.com/hybridgroup/gobot/platforms/sphero" | |
) | |
func main() { |
func ProcessText(text string, items []TextLengthItem) string { | |
firstParts := []string{"This text is %v characters in length.", "Text is %v characters long.", "Text is %v characters in length."} | |
result_template := "%v %v" | |
textLength := len(text) + 2 | |
for _, firstPart := range firstParts { | |
for _, item := range items { | |
length_sentence := fmt.Sprintf(firstPart, item.Text) | |
if textLength+len(length_sentence) == item.Value { | |
return fmt.Sprintf(result_template, text, length_sentence) | |
} |