Skip to content

Instantly share code, notes, and snippets.

View achanda's full-sized avatar
🏠
Working from home

Abhishek Chanda achanda

🏠
Working from home
View GitHub Profile
fn main () {
println!("{}", hg(1,8,3,4));
}
fn hg(a: i64, b: i64, c: i64, z: i64) -> i64 {
let mut j = 10;
loop {
let snp1 = inner_hg(a,b,c,z,j+1);
let sn = inner_hg(a,b,c,z,j);
if (((snp1 - sn).abs() / sn) as f64) < 0.001f64 {
# There can only be a single job definition per file.
# Create a job with ID and Name 'example'
job "example" {
# Run the job in the global region, which is the default.
# region = "global"
# Specify the datacenters within the region this job can run in.
datacenters = ["dc1"]
# Service type jobs optimize for long-lived services. This is

Keybase proof

I hereby claim:

  • I am achanda on github.
  • I am achanda (https://keybase.io/achanda) on keybase.
  • I have a public key whose fingerprint is ED99 4AC8 2AFA 05F6 F766 7C52 D845 C1C2 91D0 6A0C

To claim this, I am signing this object:

@achanda
achanda / magnum.conf
Created June 21, 2016 21:43
Magnum config
[DEFAULT]
#
# From magnum
#
# Directory where the magnum python module is installed. (string value)
#pybasedir = /Users/Abhishek/src/openstack/magnum/magnum
# Directory where magnum binaries are installed. (string value)
[pipeline:main]
pipeline = cors request_id authtoken api_v1
[app:api_v1]
paste.app_factory = magnum.api.app:app_factory
[filter:authtoken]
acl_public_routes = /, /v1
paste.filter_factory = magnum.api.middleware.auth_token:AuthTokenMiddleware.factory
{
"context_is_admin": "role:admin",
"admin_or_owner": "is_admin:True or project_id:%(project_id)s",
"default": "rule:admin_or_owner",
"admin_api": "rule:context_is_admin",
"admin_or_user": "is_admin:True or user_id:%(user_id)s",
"bay:create": "rule:default",
"bay:delete": "rule:default",
"bay:detail": "rule:default",
@achanda
achanda / local.conf
Created June 29, 2016 19:15
Magnum devstack
[[local|localrc]]
# Modify to your environment
FLOATING_RANGE=192.168.1.224/27
PUBLIC_NETWORK_GATEWAY=192.168.1.225
PUBLIC_INTERFACE=eth1
RECLONE=yes
# Credentials
ADMIN_PASSWORD=password
DATABASE_PASSWORD=password
@achanda
achanda / netns.c
Created September 13, 2016 05:19
Net namespace demo
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <sched.h>
#include <sys/wait.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#define STACKSIZE (1024*1024)
# Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@achanda
achanda / # python3 - 2017-01-17_15-25-24.txt
Created March 8, 2017 12:04
python3 on macOS 10.12.3 - Homebrew build logs
Homebrew build logs for python3 on macOS 10.12.3
Build date: 2017-01-17 15:25:24