Skip to content

Instantly share code, notes, and snippets.

View 0xIslamTaha's full-sized avatar
🤩
code with love ... test with imagination

Islam Taha 0xIslamTaha

🤩
code with love ... test with imagination
View GitHub Profile
@0xIslamTaha
0xIslamTaha / install_golang.sh
Last active November 3, 2016 23:58 — forked from jniltinho/install_golang.sh
Install Golang on Linux
#!/bin/bash
## Install Golang 1.6.2 64Bits on Linux (Debian|Ubuntu|OpenSUSE|CentOS)
## http://www.linuxpro.com.br/2015/06/golang-aula-1-instalacao-da-linguagem-no-linux.html
## Run as root (sudo su)
## Thank's **Bruno Albuquerque bga at bug-br.org.br**
GO_URL="https://storage.googleapis.com/golang"
GO_FILE="go1.6.2.linux-amd64.tar.gz"
@0xIslamTaha
0xIslamTaha / pastebinPost.py
Last active March 22, 2017 09:19
pastebin python post text
import requests
USERNAME = ''
PASSWORD = ''
API_DEV_KEY = ''
def get_api_user_key():
global USERNAME, PASSWORD, API_DEV_KEY
data = {'api_dev_key': API_DEV_KEY,

Description

Members of a campaign should see lesson list when they navigate to campaign in portal

Test Scenarios:

- Scenario #1:
    - As an admin, Create new campaign (NEW_CAMPAIGN)
    - As an admin, Add a lesson to it. (Add a BROWSER lesson to NEW_CAMPAIGN)
    - As an admin, Create a new user (TEST_USER)
    - As an admin, Add the user to the campaign. (Add TEST_USER to NEW_CAMPAIGN)
  • Login as TEST_USER, should succed

0-db Block Driver Testing

Here is a steps to test a 0-db block driver.

Scenario #1:

  • Option: Deploy an ubuntu vm
  • Build qemu from our repo
apt-get update

Ways to fire a simple servers:

python2 -m SimpleHTTPServer 80
python3 -m http.server 80
php -S 0.0.0.0:8000
apt-get install webfs && service webfs start  # start the webfs server 8000

busybox httpd --help # show available options && busybox httpd -p 127.0.0.1:8080 -h /var/www/  # start start httpd && pkill busybox  # to stop busybo httpd
import itertools
items = [['ubuntu', 'zero-os'],
[512, 1024, 2048, 4096, 8192],
[10, 50, 100, 200],
['btrfs', 'ext4', 'ext3', 'ext2'],
['hdd', 'ssd']]
results = list(itertools.product(*items))
In [25]: gw_data = {
...: 'nodeId': '525400000521',
...: 'hostname': 'mygw',
...: 'domain': 'lan',
...: 'nodeRobot': 'main',
...: 'networks': [{
...: 'name': 'private',
...: 'type': 'zerotier',
...: 'public': False,
...: 'id': '8850338390729392',
import requests
from bs4 import BeautifulSoup
FARMER_UNDER_MONITOR = ['mazraa', 'xtremx']
FARMER_RESULTS = {}
for famerer in FARMER_UNDER_MONITOR:
nodes_info = {}
for page_no in range(1000):
page_url = "https://capacity.threefoldtoken.com/?cru=0&page={}&country=0&sru=0&farmer={}&mru=0&hru=0".format(page_no, famerer)
In [61]: robot.services.names
Out[61]:
{'newWorker2': robot://main/github.com/zero-os/0-templates/zerotier_client/0.0.1?name=newWorker2&guid=0d03ed00-092e-45d3-b6a3-9acc7a007f00,
'vm001': robot://main/github.com/jumpscale/digital_me/vm/0.0.1?name=vm001&guid=cf0d9edf-e263-4978-a3b0-5bbf1c0d6e8c}
In [62]: robot.services.find_or_create('github.com/zero-os/0-templates/zerotier_client/0.0.1', 'myZTClient', {'token':'MyuDhfUYxCkc8eCH8cA4bt4WMgR6saWT'})
---------------------------------------------------------------------------
ServiceNotFoundError Traceback (most recent call last)
/opt/code/github/zero-os/0-robot/zerorobot/dsl/ZeroRobotManager.py in find_or_create(self, template_uid, service_name, data, public)
203 try:
In [90]: samir = j.clients.zrobot.robots['samir']
In [91]: samir.templates.uids
Out[91]:
{github.com/zero-os/0-templates/alerta/0.0.1: <JumpScale9Zrobot.clients.zerorobot.client.Template.Template at 0x7f149a2e0898>,
github.com/zero-os/0-templates/ardb/0.0.1: <JumpScale9Zrobot.clients.zerorobot.client.Template.Template at 0x7f149a2e0e10>,
github.com/zero-os/0-templates/ardb_cluster/0.0.1: <JumpScale9Zrobot.clients.zerorobot.client.Template.Template at 0x7f149a2e0ac8>,
github.com/zero-os/0-templates/container/0.0.1: <JumpScale9Zrobot.clients.zerorobot.client.Template.Template at 0x7f149a2e0828>,
github.com/zero-os/0-templates/erp_registeration/0.0.1: <JumpScale9Zrobot.clients.zerorobot.client.Template.Template at 0x7f149a2e00f0>,
github.com/zero-os/0-templates/gateway/0.0.1: <JumpScale9Zrobot.clients.zerorobot.client.Template.Template at 0x7f149a2e01d0>,