Skip to content

Instantly share code, notes, and snippets.

View tk421's full-sized avatar

Ruben Rubio Rey tk421

View GitHub Profile
@tk421
tk421 / login_request_example.py
Last active January 14, 2021 23:50
Skydesks API V2 Python Example
#!/usr/bin/env python3
import requests
import logging
logging.basicConfig(level=logging.DEBUG)
token = "my_secret_token"
subscription_id = "25399"
data = {"server_name": "ICMarkets-Demo04", "account_number" : "44140905", "account_password" : "my_secret_password", "callback_url": "https://test-skydesks.free.beeceptor.com/"}
public string TourPackageEnquiry(string Occasion, string DepartingFrom, string TravellingTo, string DepartingDate, string ReturningDate, int NoofAdults, int NoofChild, int NoofInfants, int NoOfNights, string CustomerCommunicationMode, string Name, string HomeOfNo, string MobileNo, string Preferedcallbacktime, string Email, string AdditionalComments, int FromWebsite, int FromMarketingMedium, string Dealrefference, string Howdidknow, string DealUrl, double FromPrice)
{
//int EnquiryTypeId = 6;
string GeneratingRefferenceNo = string.Empty;
string RefferenceNoNew = string.Empty;
string FinalRef = "";
string recv_email = Email;
string[] split_email = recv_email.Split('@');
string email_domain_name = split_email[1].ToString();
@tk421
tk421 / aliases.py
Created November 7, 2015 03:52 — forked from sampsyo/aliases.py
hack for argparse adding subcommand aliases
#!/usr/bin/env python
"""Aliases for argparse positional arguments."""
import argparse
class AliasedSubParsersAction(argparse._SubParsersAction):
class _AliasedPseudoAction(argparse.Action):
def __init__(self, name, aliases, help):
@tk421
tk421 / azure.macfile
Last active October 19, 2015 00:29
Create and provision Windows Servers Automatically
# Create and provision Windows Servers Automatically
# http://blog.manageacloud.com/entry/azure-provision-windows-automatically
# You need azure xplat-cli installed and logged in before running this macfile
mac: 0.9.19
description: Azure Example
name: azure_demo # Infrastructure name
version: 1.1 # Infrastructure version
@tk421
tk421 / gist:0e91e8834604265de1cd
Last active August 29, 2015 14:24
Template to create auto scaling group and load balancer at AWS
mac: 0.7.1
description: Scaled and Load-Balanced Application
name: demo
version: '1.0'
roles:
app:
instance create:
# application configuration defined at https://manageacloud.com/configuration/demo_application
configuration: demo_application
@tk421
tk421 / gist:7c0f33294d329dd12ce2
Created February 17, 2015 22:23
JClouds destroying gce
final String POLL_PERIOD_TWENTY_SECONDS = String.valueOf(SECONDS.toMillis(20));
Properties overrides = new Properties();
overrides.setProperty(ComputeServiceProperties.POLL_INITIAL_PERIOD, POLL_PERIOD_TWENTY_SECONDS);
overrides.setProperty(ComputeServiceProperties.POLL_MAX_PERIOD, POLL_PERIOD_TWENTY_SECONDS);
Iterable<Module> modules = ImmutableSet.<Module> of(new SshjSshClientModule(), new SLF4JLoggingModule());
ComputeServiceContext context = ContextBuilder.newBuilder("google-compute-engine")
.credentials("valid user", "valid password")
.modules(modules)
.overrides(overrides)