Skip to content

Instantly share code, notes, and snippets.

[ec2-user@ip-XXXXXX chef]$ bundle install
Fetching gem metadata from https://rubygems.org/.......
Resolving dependencies...
Using rake 10.1.1
Using i18n 0.6.11
Using multi_json 1.10.1
Using activesupport 3.2.19
Using builder 3.2.2
Using ffi 1.9.6
Using libyajl2 1.1.0
[ec2-user@ip-XXXXXX chef]$ sudo gem uninstall chef
ERROR: While executing gem ... (Gem::InstallError)
cannot uninstall, check `gem list -d chef`
[ec2-user@ip-XXXXXX chef]$ sudo gem uninstall chef -v 12.0.0.alpha.2
ERROR: While executing gem ... (Gem::InstallError)
cannot uninstall, check `gem list -d chef`
[ec2-user@ip-XXXXXX chef]$ gem list -d chef
*** LOCAL GEMS ***
class ParkingLot
def initialize(spaces)
# How do I access these on the instance?
@spaces = spaces
@cars = Array.new
end
def park(car)
if @cars.length < @spaces
@cars.push(car)
FROM centos:centos6
RUN rpm -Uvh /home/ec2-user/epel-release-6-8.noarch.rpm
RUN yum install -y npm
COPY /src
RUN cd /src; npm install
EXPOSE 8080
CMD ["node", "/src/index.js"]
[root@centos-vbox docker]# docker build -t root/centos-node-hello .
Uploading context 16.38 kB
Uploading context
Step 0 : FROM centos:centos6
---> 68edf809afe7
Step 1 : RUN rpm -Uvh /root/docker/epel-release-7-2.noarch.rpm
---> Running in 549d7532db26
/bin/sh: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
2014/10/20 22:40:49 The command [/bin/sh -c rpm -Uvh /root/docker/epel-release-7-2.noarch.rpm] returned a non-zero code: 127
[root@centos-vbox docker]# docker run -ti --rm centos:centos6 /bin/sh
/bin/sh: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
[root@centos-vbox docker]# docker run -ti --rm centos:centos7 /bin/sh
/bin/sh: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: Permission denied
[root@ip-172-31-19-101 docker]# docker build -t root/centos-node-hello .
Sending build context to Docker daemon 2.56 kB
Sending build context to Docker daemon
Step 0 : FROM centos:centos6
Pulling repository centos
68edf809afe7: Download complete
511136ea3c5a: Download complete
5b12ef8fd570: Download complete
---> 68edf809afe7
Step 1 : MAINTAINER mistermocha <[email protected]>
class BigStorageClass(object):
'''Class that will represent a large data blob that contains lots of smaller child objects'''
def lookup_something(self, **kwargs):
some_data = self.do_something_with(kwargs)
return some_data
class SmallChildObject(object):
'''Instantiation of this class needs to look up something in an instance of the BigStorageClass. Clearly,
I don't want to make BigStorageClass a child of SmallChildObject. Is there a way to pass in the *name* of
the BigStorageClass instance as a string and get the instance?'''
domain_counts={}
for url in urls:
# prime the dict if the domain isn't there
if not domain_counts.get(domain):
domain_counts = {}
# split_your_url does not exist
domain, path = split_your_url(url)
package main
import (
"fmt"
)
func sqrt(x float64) float64 {
y := 0.0
z := 1.0