Recent Pads - Page 3

Total pad count: 577
created 149 days, 16 hours ago
sqlite3-remove-and-rename-some-columns

BEGIN TRANSACTION;

ALTER TABLE User RENAME TO temp_User;

CREATE TABLE "User" (
        id CHAR(32),
        name VARCHAR(64) NOT NULL,
... view all 106 lines

created 154 days, 14 hours ago
simple-python-selenium-client

#cat source-me.sh
#export JUNIT_HOME="$HOME/jars"
#export PATH="$PATH:$JUNIT_HOME"
#export CLASSPATH="$CLASSPATH:$JUNIT_HOME/junit-4.12.jar:$JUNIT_HOME/hamcrest-all-1.3.jar:$JUNIT_HOME/selenium-java-2.53.1.jar:$JUNIT_HOME/selenium-server-standalone-2.53.1.jar"

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
... view all 32 lines

created 156 days, 20 hours ago
ddb8178d-5273-451e-9541-7767e1354e81

[root@ip-10-13-37-7 specs]# kubectl get nodes
NAME              STATUS    AGE       VERSION
ip-10-13-37-133   Ready     14d       v1.6.2
ip-10-13-37-135   Ready     14d       v1.6.2
ip-10-13-37-136   Ready     14d       v1.6.2
ip-10-13-37-142   Ready     14d       v1.6.2
ip-10-13-37-148   Ready     14d       v1.6.2
... view all 113 lines

created 162 days, 10 hours ago
docker-swarm-on-aws-running-selenium-grid

# firewall (secrity groups) required the following for swarm docker overlay networking:
# Port 7946 TCP/UDP for container network discovery.
# Port 4789 UDP for the container overlay network.
# As a quick hack I allowed all TCP and UDP between minions (including master)

### yum install docker on all hosts ###
salt -G 'role:k8s-master' cmd.run 'yum install -y docker'
... view all 85 lines

created 162 days, 19 hours ago
81eb2c17-540f-4f2c-b05d-a79f4cddb378

07:57:31.915 INFO - Executing: [new session: Capabilities [{browserName=chrome, javascriptEnabled=true, version=, platform=ANY}]])
07:57:31.917 INFO - Creating a new session for Capabilities [{browserName=chrome, javascriptEnabled=true, version=, platform=ANY}]
Starting ChromeDriver 2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3) on port 13598
Only local connections are allowed.
11/05/2017 07:57:32 idle keyboard:   turning X autorepeat back on.
07:57:32.426 INFO - Done: [new session: Capabilities [{browserName=chrome, javascriptEnabled=true, version=, platform=ANY}]]
07:57:32.989 INFO - Executing: [get: https://linkpeek.com])
... view all 28 lines

created 164 days, 15 hours ago
c7fc2c77-dfb1-4af1-8468-c5a3f7d542fb

# on a single server, open firewall to 4444 and 5900 and then run this on:
docker run -d -p 4444:4444 --name selenium-hub selenium/hub:2.53.1
docker run -d -P -p 5900:5900 --privileged -v /dev/shm:/dev/shm --link selenium-hub:hub selenium/node-chrome-debug:2.53.1

# verify.
curl 127.0.0.1:4444/grid/console

... view all 13 lines

created 167 days, 10 hours ago
parse-url-overrides-refactor

def parse_url_overrides(kw):
    """Parse special arguments passed when generating urls.

    The supplied dictionary is mutated when we pop arguments.
    Returns a 6-tuple of the format:

      ``(app_url, scheme, host, port, qs, anchor)``.
... view all 27 lines

created 167 days, 14 hours ago
pyramid-route-url-safe-kwargs

>>> test_data = {'_anchor' : None, 'slug' : 'tester-fester'}
>>>
>>> def remove_keys_with_value_of_none(kwargs):
...     copy_kwargs = kwargs.copy()
...     for key, value in kwargs.items():
...         if value is None:
...             del copy_kwargs[key]
... view all 11 lines

created 172 days, 11 hours ago
china-kubernetes

[root@ip-10-13-37-7 ~]# kubeadm init
[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
[init] Using Kubernetes version: v1.6.0
[init] Using Authorization mode: RBAC
[preflight] Running pre-flight checks
[preflight] WARNING: hostname "ip-10-13-37-7" could not be reached
[preflight] WARNING: hostname "ip-10-13-37-7" lookup ip-10-13-37-7 on 10.13.37.2:53: no such host
... view all 31 lines

created 172 days, 14 hours ago
a0511f22-bd0a-4a2d-84d2-d1335785455f

curl -sSL http://k8s.oss-cn-shanghai.aliyuncs.com/kube/rpm/kubectl-1.5.1.x86_64.rpm -o /tmp/kubectl-1.5.1.x86_64.rpm 
curl -sSL http://k8s.oss-cn-shanghai.aliyuncs.com/kube/rpm/kubelet-1.5.1.x86_64.rpm -o /tmp/kubelet-1.5.1.x86_64.rpm 
curl -sSL http://k8s.oss-cn-shanghai.aliyuncs.com/kube/rpm/kubernetes-cni-0.3.0.1-1.07a8a2.x86_64.rpm -o /tmp/kubernetes-cni-0.3.0.1-1.07a8a2.x86_64.rpm 
curl -sSL http://k8s.oss-cn-shanghai.aliyuncs.com/kube/rpm/kubeadm-1.6.0-0.alpha.0.2074.a092d8e0f95f52.x86_64.rpm -o /tmp/kubeadm-1.6.0-0.alpha.0.2074.a092d8e0f95f52.x86_64.rpm 

rpm -ivh /tmp/kubectl-1.5.1.x86_64.rpm /tmp/kubelet-1.5.1.x86_64.rpm kubernetes-cni-0.3.0.1-1.07a8a2.x86_64.rpm  /tmp/kubeadm-1.6.0-0.alpha.0.2074.a092d8e0f95f52.x86_64.rpm 

... view all 28 lines

created 175 days, 11 hours ago
aws-sns-slurp-py

from argparse import ArgumentParser

import boto3

from botocore.exceptions import ClientError

from time import sleep
... view all 102 lines

created 178 days, 14 hours ago
selenium-debug-on-kubernetes

kubectl run selenium-hub-debug --image selenium/hub:2.53.1 --port 4444
deployment "selenium-hub-debug" created

kubectl expose deployment selenium-hub-debug --type=NodePort
service "selenium-hub-debug" exposed

kubectl run selenium-node-chrome-debug --image selenium/node-chrome:2.53.1 --env="HUB_PORT_4444_TCP_ADDR=selenium-hub-debug" --env="HUB_PORT_4444_TCP_PORT=4444" --port 5900
... view all 18 lines

created 178 days, 18 hours ago
simple_grid_testpy

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

import sys

driver = webdriver.Remote(
   command_executor='http://192.168.99.101:30107/wd/hub',
... view all 13 lines

created 183 days, 15 hours ago
ee1cc4ab-4d3a-4739-9640-4dda58269466

docker run -d \
  --env HUB_PORT_4444_TCP_ADDR='10.13.37.7' \
  --env HUB_PORT_4444_TCP_PORT='4444' \
  selenium/node-chrome:2.53.1
... view all 5 lines

created 185 days, 14 hours ago
kubernetes-yum-repo-mirror-for-china

Setup Japan Kubernetes Yum Mirror
========================================

# needed if you have a stale base image.
yum update

# install packages needed to run a yum mirror.
... view all 95 lines

created 193 days, 9 hours ago
128b1213-44f5-4ec0-b22e-e41196ce8189

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

import sys

driver = webdriver.Remote(
   command_executor='http://mobk8s-selenium-hub-1044777639.us-west-2.elb.amazonaws.com/wd/hub',
... view all 13 lines

created 193 days, 10 hours ago
9e9b1b91-5e5f-4206-8789-9c96c6828a6b

[root@ip-192-168-21-119 ~]# cat /etc/systemd/system/kubelet.service.d/10-kubeadm.conf | grep dns
Environment="KUBELET_DNS_ARGS=--cluster-dns=10.96.0.10 --cluster-domain=cluster.local"

[root@ip-192-168-21-119 ~]# kubectl get services --namespace=kube-system
NAME       CLUSTER-IP   EXTERNAL-IP   PORT(S)         AGE
kube-dns   10.96.0.10   <none>        53/UDP,53/TCP   5d

... view all 136 lines

created 198 days, 10 hours ago
363ec006-7b83-460d-8b79-f5bafa1ac162

[root@ip-192-168-21-119 ~]# kubectl get pods
NAME                                    READY     STATUS    RESTARTS   AGE
hello-minikube-938614450-wx4db          1/1       Running   0          3h
selenium-hub-773264544-127tt            1/1       Running   0          3h
selenium-node-chrome-2397256556-c1xnc   1/1       Running   0          35m

[root@ip-192-168-21-119 ~]# kubectl get services
... view all 37 lines

created 199 days, 12 hours ago
86cca0df-4769-411b-9dab-94d2c35370b5

[root@ip-192-168-21-119 salt]# kubeadm init
[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
[init] Using Kubernetes version: v1.6.0
[init] Using Authorization mode: RBAC
[preflight] Running pre-flight checks
[certificates] Generated CA certificate and key.
[certificates] Generated API server certificate and key.
... view all 18 lines

created 200 days, 16 hours ago
585b4d4a-96b6-483b-9efc-5d34624142a7

ip-192-168-21-103.us-west-2.compute.internal:
----------
          ID: pkg-core
    Function: pkg.installed
        Name: python
      Result: True
     Comment: Package python is already installed
... view all 962 lines

pages 1 2 3 4 5 .. 29