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
docker run --rm -v ~/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register \ | |
--non-interactive \ | |
--executor "shell" \ | |
--docker-image alpine:latest \ | |
--url "https://gitlab.com/" \ | |
--registration-token "" \ | |
--description "docker-runner" \ | |
--tag-list "develop" \ | |
--run-untagged="true" \ | |
--locked="false" \ |
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
curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz | |
mkdir -p ~/gcloud \ | |
&& tar -C ~/gcloud -xvf /tmp/google-cloud-sdk.tar.gz \ | |
&& ~/gcloud/google-cloud-sdk/install.sh -q; | |
brew install kubernetes-cli | |
gcloud components install docker-credential-gcr -q |
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
kubectl get po -a --all-namespaces -o json | jq '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) | "kubectl delete po \(.metadata.name) -n \(.metadata.namespace)"' | xargs -n 1 bash -c |
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
var counter = 0; | |
var mensagens = document.getElementsByClassName("message-in"); | |
var quantidadeMsg = mensagens.length | |
var i = setInterval(function(){ | |
window.InputEvent = window.Event || window.InputEvent; | |
var d = new Date(); | |
var event = new InputEvent('input', {bubbles: true}); | |
var textbox = document.querySelector('#main > footer > div.block-compose > div.input-container > div.pluggable-input.pluggable-input-compose > div.pluggable-input-body.copyable-text.selectable-text'); |
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
app.get('/dollarRate', function(request, response) { | |
var from = "USD" | |
var to = "BRL" | |
var url = "http://query.yahooapis.com/v1/public/yql?q=select%20rate%2Cname%20from%20csv%20where%20url%3D'http%3A%2F%2Fdownload.finance.yahoo.com%2Fd%2Fquotes%3Fs%3DUSDBRL%253DX%26f%3Dl1n'%20and%20columns%3D'rate%2Cname'&format=json" | |
http.get(url, function(res){ | |
var body = ''; |
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
/* | |
This program was built under the Mac OS X Yosemite version 10.10.1 | |
and g++ compiler described as follows: | |
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn) | |
Target: x86_64-apple-darwin14.0.0 | |
Thread model: posix | |
It was tested, compiled and fully functional on Mac by command line. |
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
'''Given a function which produces a random integer in the range 1 to 5, | |
write a function which produces a random integer in the range 1 to 7.''' | |
import random | |
# Produces a random integer in the range 1 to 5 | |
def random_int15(): | |
return random.choice(range(1,6)) | |
# Produces a random integer in the range 1 to 7 using the previous function |
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
# UDPPingerServer.py | |
# We will need the following module to generate randomized lost packets import random | |
from socket import * | |
# Create a UDP socket | |
# Notice the use of SOCK_DGRAM for UDP packets | |
import random | |
serverSocket = socket(AF_INET, SOCK_DGRAM) # Assign IP address and port number to socket | |
serverSocket.bind(('', 12000)) | |
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
# CSC 333 -- Homework 4 -- Stack machine interpreter | |
# Pedro Victor | |
# Time-stamp: <2014-10-21 21:04:52 shade> | |
# Your job is to complete the 'runvm' function. Don't change any of | |
# the other code. I will test your program using the 'run' function, | |
# which calls 'runvm' to do the heavy lifting. | |
# | |
# This code simulates a simple stack VM (virtual machine). Programs | |
# are written in a compact string form that is then compiled into a |
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
set MAX_N 200 | |
set MIN_VALUE -2147483648 | |
set MAX_VALUE 2147483647 | |
proc read_data {} { | |
# Open file in read mode | |
set input [open "ripoff.in" r] | |
# read the file content |
NewerOlder