My Openshift Cheatsheet
Openshift build secrets for cloning git repos using SSH Keys
- To create ssh secret:
oc create secret generic sshsecret \
--from-file=ssh-privatekey=$HOME/.ssh/id_rsa
# install aws cli first and configure it with credentials and default region | |
# the script will iterate over all regions of AWS | |
for region in `aws ec2 describe-regions --output text | cut -f4` | |
do | |
echo -e "\nListing Instances in region:'$region'..." | |
aws ec2 describe-instances --query "Reservations[*].Instances[*].{IP:PublicIpAddress,ID:InstanceId,Type:InstanceType,State:State.Name,Name:Tags[0].Value}" --output=table --region $region | |
done |
oc create secret generic sshsecret \
--from-file=ssh-privatekey=$HOME/.ssh/id_rsa
{0: 'tench, Tinca tinca', | |
1: 'goldfish, Carassius auratus', | |
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias', | |
3: 'tiger shark, Galeocerdo cuvieri', | |
4: 'hammerhead, hammerhead shark', | |
5: 'electric ray, crampfish, numbfish, torpedo', | |
6: 'stingray', | |
7: 'cock', | |
8: 'hen', | |
9: 'ostrich, Struthio camelus', |
Note: The table headings (positive/negative) are not necessarily meaningful.
Positive | Negative |
---|---|
acquire |
release |
add |
remove (e.g. an item), subtract (arithmetic) |
advance |
retreat |
allocate |
deallocate (correct), free (common) |
allow |
deny |
sudo su
apt-get update && apt-get install -y libvirt-dev ruby-all-dev apparmor-utils
curl -O -L https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5_x86_64.deb
dpkg -i vagrant_1.6.5_x86_64.deb
aa-complain /usr/lib/libvirt/virt-aa-helper # workaround
exit
#!/bin/bash | |
# options: | |
# remove stopped containers and untagged images | |
# $ dkcleanup | |
# remove all stopped|running containers and untagged images | |
# $ dkcleanup --reset | |
# remove containers|images|tags matching {repository|image|repository\image|tag|image:tag} | |
# pattern and untagged images | |
# $ dkcleanup --purge {image} |
There exists common confusion about terminal colors. This is what we have right now:
def is_prime? n
(2...n).all? { |i| n % i != 0 }
end
def sexy_primes n
file_to_disk = './tmp/large_disk.vdi' | |
Vagrant::Config.run do |config| | |
config.vm.box = 'base' | |
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024] | |
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk] | |
end |
#!/bin/bash | |
if [ "$1" != "report" ]; then | |
echo "Usage:" >&2 | |
script="`basename $0`" | |
echo " nohup $script report > /var/log/memcache-stats.log &" >&2 | |
exit 1 | |
fi | |
GRAPHITE_SERVER=localhost |