Showing posts with label google. Show all posts
Showing posts with label google. Show all posts

Tuesday, July 17, 2012

how to host your Public YUM (or any) Repo

almost an year ago came up the simple idea of getting a really simple static-content (html,css,js,...) website on public portal hosted by Google AppEngine for free upto a daily revived usage scheme: http://gae-flat-web.appspot.com/

few days back I was just playing around custom yum repos and thought why not get up one of my own for public usage with RPMs served for either my projects or other non-available rpms, and what I came up with is: http://yum-my.appspot.com/flat_web/index.htm

it's nothing fascinating but just a re-mixed usage of project created from gae-flat-web.

you can access base skeleton of this re-mixed gae-yum-my (the easy way to host your yum repo online) at https://github.com/abhishekkr/gae-yum-my which also has rpm served for gae-flat-web.

now to see how you could get one too~

First Task, register a new portal on Google AppEngine (it's free for reasonable limited usage)using your Google Account. Say, your appengine portal is name MY-YUM-MY.

Now the fun begins.

cloned the starter kit
$ git clone
enter the cloned repo
$ cd gae-yum-my
to actually change your application name in app.yaml
$ sed -i 's/yum-my/MY-YUM-MY/g' app.yaml
create the required linux distro, release branch
$ mkdir yummy/<distro><releasever>/<basearch>
copy all required RPMs in that distro, release branch
$ cp <ALL_MY_RPMS_of__DISTRO_ReleaseVer_BaseArch> yummy/<distro><releasever>/<basearch>/
prepare yum-repo-listing using createrepo command
$ createrepo yummy/<distro><releasever>/<basearch>/ 
now, place a file 'flat_web/yum-my-el6<or-whichever>.repo' with content 
[yum-my-<distro><releasever>-<basearch>] 
name=MY-YUM-MY 
baseurl=http://MY-YUM-MY.appspot.com/yummy/<distro>$releasever/$basearch 
enabled=1 
gpgcheck=0

and can link this file on your 'flat_web/index.htm' homepage 

 to host: 
$ <google_appengine_path>/appcfg.py update <MY-YUM-MY_path>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

now you yum repo has a homepage at http://MY-YUM-MY.appspot.com

and placing tthe *.repo file above with hinted content will get the RPMs added to you repo accessible.

Wednesday, June 6, 2012

Get Set Go Lang ~ part#1

Get Set GO Lang
part# 1
_________________________

What Is Go Lang?
(in case you just came here while curious web surfing)


Go is an OpenSource programming platform developed by Google (and contributors) to be expressive and efficient at the same point.
It's distributed under BSD-style License
It's a concurrency favoring, statically typed, compiler-based language. Though it declares to be giving ease like dynamically typed interpreted code.
_________________________

On your mark, Get Set GO
(getting started with the quick boost usage)

To directly start playing with Go Lang, visit http://play.golang.org/,
where you can directly type/paste in your go-lang code in an online editor and run to get output.

Just a small ++HelluvaWorld code-piece
package main 
import ("fmt"
        "time"
        "os"
        "math" )
func main() {
  fmt.Println("Today is ", time.Now().Weekday())
  fmt.Println("env as ", os.Environ())


  fmt.Println("A Pi on Ceil looks like ",
               math.Ceil(math.Pi), 
      " and a Pie on Floor looks like", 
      math.Floor(math.Pi))
}
[] Installing it for local & full-flown development practice http://golang.org/doc/install would guide you getting 'go' working on your Linux, FreeBSD, OSX & Win platforms.
_________________________

Rewind before the Start Line and take your First Leap
(first useful step to starting use of Go Lang)

[] quickie at variables and constants, a look at GO's declaration style
// var used to declare variable with type at end
var a, b, c int
// direct initialization doesn't require providing type
var x, y, z = 1, true, "yes"
// constants just require a 'const' keyword
const newconst = 10
func tellvar() {
a, b, c = newconst + 1, newconst + 2, newconst + 3
// inside a function, even := construct
// could be used to assign and not use 'var'
clang, java, ruby := "dRitchie", "jGosling", "Matz"
fmt.Println(a, b, c, x, y, z, clang, ruby, java)
}
now, you also know '//' is to comment as in C/C++ and more.

[] mobilizing functions
just an emulation of 'math' libraries 'pow' method (also a look at using for loop)
package main 
import "fmt" 
func pow(x int, y int) int {
  a := 1
  for i := 0; i < y; i++ {
    a = a * x
  }
  return a
}
 
func main() {
  fmt.Println( "2 to the power of 5 is ", pow(2, 5) )
}

[] some function parameters style, the pow above is same as
func pow(x, y int) int { ... }

[] function returning multiple values
dream come true of how a function can return any number of values (also use of if condition)
func plusminus(a, b int) (int, int) { 
     if a > b {return a+b, a-b} 
     return a+b, b-a
}
  or could be like
func plusminus(a, b int) (plus, minus int) { 
     plus = a + b 
    if a > b {   
                   minus = a - b  
     } else {    
       minus = b - a  
     }   
     return
   }

usage:
plus, minus := plusminus(1, 2)
fmt.Println("Plus: ", plus,
            "\nMinus: ", minus)

[] more to go..... in more to come


_________________________

Shops to Go
(other fine links to Go, until next part of this tutorial comes)
_________________________

Wednesday, June 22, 2011

Host Your Site on Google AppEngine in 7 Easy Steps

Project/Example Site: http://gae-flat-web.appspot.com



Host Your Site on Google AppEngine in 7 Easy Steps:
  1.  Register any $App at Google ApEngine using your Gmail Account
    {as if $App is you Application Name giving you url like $App.appspot.com}

  2.  Download the Python Script 'flat.py' provided on this site or from repo
  3.  Execute #python flat.py $App
  4.  It will created required structure in a dir $App
  5.  Copy all your static site to $App/flat_web/*
  6.  Download "Google AppEngine Python SDK"
  7.  Update this $App using Google AppEngine SDK as
        #python appcfg.py update $Path_to_App

[[ Your own Static Content Website served by Google AppEngine ]]

 It's GitHub Repository: https://github.com/abhishekkr/gae-flat-web