Skip to content

Instantly share code, notes, and snippets.

View sbose78's full-sized avatar
🎯
Focusing

Shoubhik Bose sbose78

🎯
Focusing
View GitHub Profile
kind: List
items:
-
apiVersion: v1
kind: Pod
metadata:
name: mydevpod
annotations:
org.eclipse.che.container.main.machine_name: go-runtime
org.eclipse.che.container.main1.machine_name: db
@startuml
actor client
participant "GitHub" as gh
participant "Jenkins Proxy" as bs
participant "Auth Service" as auth
participant "OSO Proxy" as osoproxy
participant "Jenkins" as jenkins
participant "user namespace" as uns
participant "Analytics service" as as
@sbose78
sbose78 / workspace-config.json
Created September 3, 2018 15:45
fabric8-auth in Che
{
"projects": [],
"commands": [],
"environments": {
"default": {
"recipe": {
"contentType": "text/x-yaml",
"type": "openshift",
"content": "kind: List\nitems:\n - \n apiVersion: v1\n kind: Pod\n metadata:\n name: any123123\n annotations:\n org.eclipse.che.container.main.machine_name: m1\n org.eclipse.che.container.main1.machine_name: m2\n spec:\n containers:\n - \n image: eclipse/ubuntu_go\n name: main\n ports:\n - \n containerPort: 8080\n protocol: TCP\n resources:\n limits:\n memory: 3072Mi\n - \n image: 'registry.centos.org/postgresql/postgresql:9.6'\n name: main1\n env:\n - \n name: POSTGRESQL_ADMIN_PASSWORD\n value: mysecretpassword\n ports:\n - \n containerPort: 5432\n protocol: TCP\n resources:\n limits:\n memory: 3072Mi\n"
},
type OrganizationService interface{
CreateOrganization(...)
ListOrganization(...)
}
type OrganizationServiceImpl struct{
organizationModelService OrganizationModelService
}
func NewOrganizationServiceImpl( m organizationModelService ) OrganizationServiceImpl{
@sbose78
sbose78 / iptables.txt
Created February 11, 2018 12:59
iptables
# Generated by iptables-save v1.4.21 on Sun Feb 11 07:53:09 2018
*filter
:INPUT ACCEPT [1244:91569]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [63565:78684068]
-A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i eth0 -p icmp -j ACCEPT
-A INPUT -i eth0 -j DROP
-A FORWARD -s 192.168.56.0/24 -d 143.215.130.30/32 -j ACCEPT
getIteration(iteration: any): Observable<IterationModel> {
if (Object.keys(iteration).length) {
let iterationLink = iteration.data.links.self;
return this.http.get(iterationLink)
.map(iterationresp => iterationresp.json().data)
.catch((error: Error | any) => {
this.notifyError('Error getting iteration data.', error);
return Observable.throw(new Error(error.message));
});
} else {
it('Ensure APILocatorService is injectable', function() {
TestBed.configureTestingModule({
declarations: [TestAPILocatorServiceComponent],
providers: [ApiLocatorService, Fabric8UIConfig, ProviderService]
});
var fixture = TestBed.createComponent(TestAPILocatorServiceComponent);
var comp = fixture.componentInstance;
expect(comp.apilocator).toBeTruthy();
});
addCollaborators(spaceId: string, users: User[]): Observable<Response> {
let url = this.spacesUrl + "/" + spaceId + '/collaborators';
let payload = JSON.stringify({ data: users });
return this.http
.post(url, payload, { headers: this.headers })
.catch((error) => {
return this.handleError(error);
});
}
func createClient(ctx context.Context, config tenantConfig) (*tenant.Client, error) {
u, err := url.Parse(config.GetTenantServiceURL())
if err != nil {
return nil, err
}
c := tenant.New(client.HTTPClientDoer(http.DefaultClient))
c.Host = u.Host
c.Scheme = u.Scheme
c.SetJWTSigner(goasupport.NewForwardSigner(ctx))
func RegisterAsKnownURL(name, urlRegex string) {
compiledRegex := regexp.MustCompile(urlRegex)
groupNames := compiledRegex.SubexpNames()
knownURLLock.Lock()
defer knownURLLock.Unlock()
knownURLs[name] = KnownURL{
URLRegex: urlRegex,
compiledRegex: regexp.MustCompile(urlRegex),
groupNamesInRegex: groupNames,
}