This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
HOST_SCREEN_RC_FILES_DIR="SCREEN_RC_FILES" | |
MAIN_RC_FILE="mainscreenrc" | |
LOG_DIR="LOGS" | |
TOOL_HOMEDIR=$(pwd) | |
TASKS_DIR="REMOTE_TASKS" | |
USAGE="usage is: $(basename $0) <Task DIRECTORY>\ne.g. $(basename $0) INSTALL_APPS | |
or |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// This program will act like egrep -f patternfile textfile. But it will also print a delimeter ======= after each section of successfull match | |
import ( | |
"bufio" | |
"fmt" | |
"io" | |
"log" | |
"os" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/perl | |
$str = "This is a test | |
Will it work | |
lets see | |
"; | |
if ($str =~ m!^This.+test$!) | |
{ | |
print "matched\n" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# As perl one liners: | |
$ cat data | perl -w -e '$/=""; while(<>) { m!^This.+file$!m and print }' | |
This is a test file | |
Will it work | |
lets see | |
# DEFAULT BEHAVIOUR | |
$ cat data | perl -w -e '$/=""; while(<>) { m!(^This.+file)! and print "$1\n" or print "NOMATCH\n" }' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> pattern = re.compile(r'\w+') | |
>>> pattern.findall('This is a test') | |
['This', 'is', 'a', 'test'] | |
>>> pattern = re.compile(r'(\w+)') | |
>>> pattern.findall('This is a test') | |
['This', 'is', 'a', 'test'] | |
>>> pattern = re.compile(r'\W+') | |
>>> pattern.split("This is a test") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/rand" | |
"errors" | |
"flag" | |
"fmt" | |
"gopkg.in/goose.v1/client" | |
"gopkg.in/goose.v1/glance" | |
"gopkg.in/goose.v1/identity" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/rand" | |
"errors" | |
"flag" | |
"fmt" | |
"github.com/rackspace/gophercloud" | |
"github.com/rackspace/gophercloud/openstack" | |
"github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/rand" | |
"flag" | |
"fmt" | |
"github.com/rackspace/gophercloud" | |
"github.com/rackspace/gophercloud/openstack" | |
"github.com/rackspace/gophercloud/openstack/compute/v2/flavors" | |
"github.com/rackspace/gophercloud/openstack/compute/v2/images" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heat_template_version: 2015-10-15 | |
description: Apache Web server installation template. | |
parameters: | |
flavor_name: | |
type: string | |
description: Instance type for server | |
default: m1.small |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OuterClass { | |
private String outerClassPrivateInstanceVar = "outerClassPrivateInstanceVar"; | |
public static String outerClassPublicStaticVar = "outerClassPublicStaticVar"; | |
public String outerClassPublicInstanceVar = "outerClassPublicInstanceVar"; | |
void outerClassInstanceMethod() { | |
System.out.println("Inside outerClassInstanceMethod."); | |
} | |
static void outerClassStaticMethod() { |
OlderNewer