Skip to content

Instantly share code, notes, and snippets.

View kgrvamsi's full-sized avatar
🎯
Focusing

Vamsi Kotipalli kgrvamsi

🎯
Focusing
  • Amazon (AWS)
  • Austin,TX
View GitHub Profile
@kgrvamsi
kgrvamsi / .tmux.conf
Last active August 29, 2015 14:17 — forked from naoya/.tmux.conf
# $Id: screen-keys.conf,v 1.7 2010-07-31 11:39:13 nicm Exp $
#
# By Nicholas Marriott. Public domain.
#
# This configuration file binds many of the common GNU screen key bindings to
# appropriate tmux key bindings. Note that for some key bindings there is no
# tmux analogue and also that this set omits binding some commands available in
# tmux but not in screen.
#
# Note this is only a selection of key bindings and they are in addition to the
func readLine(path string) {
inFile, _ := os.Open(path)
defer inFile.Close()
scanner := bufio.NewScanner(inFile)
scanner.Split(bufio.ScanLines)
for scanner.Scan() {
fmt.Println(scanner.Text())
}
}

Types

type Vertex struct {
    Lat, Long float64
}

Maps

@kgrvamsi
kgrvamsi / cpus.sh
Last active August 29, 2015 14:25 — forked from jj1bdx/cpus.sh
Number of CPUs with getconf(1)
#!/bin/sh
# Originally from:
# https://github.com/blankpage/e5UNIXBuilder/blob/master/build-akili.sh
# Linux and similar...
CPUS=`getconf _NPROCESSORS_ONLN 2>/dev/null`
# FreeBSD and similar...
[ -z "$CPUS" ] && CPUS=`getconf NPROCESSORS_ONLN`
# Solaris and similar...
[ -z "$CPUS" ] && CPUS=`ksh93 -c 'getconf NPROCESSORS_ONLN'`
@kgrvamsi
kgrvamsi / coreinfo
Last active August 29, 2015 14:25 — forked from stedolan/coreinfo
Prints number of cores, CPU topology and cache topology/size on Linux machines
#!/bin/bash
unshared () {
grep '^[0-9]\+$' "$1" > /dev/null
}
for cpu in $(ls -d /sys/devices/system/cpu/cpu[0-9]* | sort -t u -k 3 -n); do
echo "${cpu##*/}: [Package #$(cat $cpu/topology/physical_package_id), Core #$(cat $cpu/topology/core_id)]"
if ! unshared $cpu/topology/core_siblings_list; then
echo " same package as $(cat $cpu/topology/core_siblings_list)"
@kgrvamsi
kgrvamsi / go_scp.go
Last active August 29, 2015 14:27 — forked from jedy/go_scp.go
an example of scp in golang
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"fmt"
"golang.org/x/crypto/ssh"
)
const privateKey = `content of id_rsa`
@kgrvamsi
kgrvamsi / cloud-init
Last active September 14, 2015 09:52
Cloud init Theory and Tutorials
Cloud Init is one of the automated configuration tool that does the automation of services at the boot up
##############
# Reference URLS
###############
http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/doc/examples/cloud-config.txt
http://cloudinit.readthedocs.org/en/latest/topics/examples.html
###############
@kgrvamsi
kgrvamsi / ovs-vsctl
Last active December 29, 2023 07:01
Ovs Tutorials and theory
Ovs-- Open Virtual Switch
#########################
#################################
# Debian Installation of OVS #
#################################
apt-get update
apt-get install openvswitch-controller openvswitch-switch openvswitch-datapath-source
@kgrvamsi
kgrvamsi / supervisor
Created September 15, 2015 08:22
Supervisor Theory and Tutorials
Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems.
@kgrvamsi
kgrvamsi / openstack-installation
Last active September 29, 2015 09:06
Openstack Installation and theory
##############################
# Openstack Installation on Os- {Redhat,Fedora,Centos}
##############################
# Redhat
subscription-manager repos --enable rhel-7-server-optional-rpms
subscription-manager repos --enable rhel-7-server-extras-rpms
yum update all