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
[hudson-rhsm] | |
name=Red Hat Subscription Manager for Enterprise Linux 6 - $basearch | |
baseurl=http://hudson.rhq.lab.eng.bos.redhat.com:8080/hudson/job/subscription-manager_master/lastSuccessfulBuild/artifact/rpms/$basearch/ | |
enabled=1 | |
gpgcheck=0 | |
http_caching=packages |
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
(def my-json "[\"zero\" \"first\" \"second\" {\"name\": \"third\" \"value\": [100 20 30]}]") | |
(-> (json/read-json myjson true) (nth 3) :value (->> (apply +))) | |
;; -> 150 |
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
;;get all the names of the organizations | |
(->> (httpclient/get "http://f14-1.usersys.redhat.com:3000/api/organizations" | |
{:accept :json :basic-auth ["admin" "admin"]}) | |
:body | |
json/read-json | |
(map #(-> :organization % :name))) | |
;; result |
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
public static JSONObject getOwnerOfConsumerId(String server, String port, String prefix, String authenticator, String authenticatorPassword, String consumerId) throws JSONException, Exception { | |
JSONObject jsonOwner = null; | |
JSONObject jsonConsumer = new JSONObject(CandlepinTasks.getResourceUsingRESTfulAPI(server, port, prefix, authenticator, authenticatorPassword,"/consumers/"+consumerId)); | |
JSONObject jsonOwner_ = (JSONObject) jsonConsumer.getJSONObject("owner"); | |
// Warning: this authenticator, authenticatorPassword needs to be superAdmin | |
jsonOwner = new JSONObject(CandlepinTasks.getResourceUsingRESTfulAPI(server, port, prefix, authenticator, authenticatorPassword,jsonOwner_.getString("href"))); | |
return jsonOwner; | |
} | |
static public String getResourceUsingRESTfulAPI(String server, String port, String prefix, String authenticator, String password, String path) throws Exception { |
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
[root@host ~]# irb | |
irb(main):001:0> require "/usr/lib64/ruby/site_ruby/1.8/powerpc64-linux/shadow.so" #varies by platform - check 'rpm -ql ruby-shadow' for real location. | |
=> true | |
irb(main):004:0> Shadow::Passwd.getspent() | |
=> #<struct Struct::PasswdEntry sp_namp="root", sp_pwdp="$1$s9SM/aIM$ATv5Gcjkd2b/G/rkddVTq0", sp_lstchg=15095, sp_min=0, sp_max=99999, sp_warn=7, sp_inact=-1, sp_expire=-1, sp_flag=-1> | |
(execute getspent() repeatedly, should give a new user entry each time. | |
irb(main):009:0> Shadow::Passwd.setspent() | |
=> nil |
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
(defn ^{Test {:dataProvider "mydata"}} | |
myfn [_ onearg] | |
(println (str "called with " onearg))) | |
(defn ^{DataProvider {:name "mydata"}} mydp [_] | |
(to-array-2d [[1] ["hi"] [3] [nil]])) | |
(gen-class-testng) |
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
(defproject kalpana "1.0.0-SNAPSHOT" | |
:description "Kalpana automation" | |
:aot [#"^kalpana.tests"] | |
:dependencies [[org.clojure/clojure "1.2.0"] | |
[org.clojure/clojure-contrib "1.2.0"] | |
[webui-framework "1.0.2-SNAPSHOT"] | |
[test_clj.testng "1.0.1-SNAPSHOT"] | |
[error.handler "1.1.0-SNAPSHOT"] | |
[inflections "0.4"] | |
[clj-http "0.1.1"]] |
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
(defn random-facts [] | |
(let [rand (java.util.Random.) | |
rand-255 #(.nextInt rand 255) | |
splice (fn [sep coll] (apply str (interpose sep coll))) | |
ip-prefix (splice "." (repeatedly 3 rand-255 )) | |
mac (splice ":" (repeatedly 6 #(Long/toHexString (rand-255))))] { | |
"dmi.bios.runtime_size" "128 KB", | |
"lscpu.cpu_op-mode(s)" "64-bit", | |
"uname.sysname" "Linux", | |
"distribution.name" "Fedora", |
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
[katello-devel] | |
name=Katello Devel - $basearch | |
baseurl=http://hudson.rhq.lab.eng.bos.redhat.com:8080/hudson/job/katello-build/lastSuccessfulBuild/artifact/rpms/fedora-$releasever/$basearch/ | |
enabled=1 | |
gpgcheck=0 | |
metadata_expire=120 |
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
[katello-gems-devel] | |
name=Katello Ruby Gems - $basearch | |
baseurl=http://hudson.rhq.lab.eng.bos.redhat.com:8080/hudson/job/katello-gems/lastSuccessfulBuild/artifact/rpms/fedora-$releasever/$basearch/ | |
enabled=1 | |
gpgcheck=0 | |
http_caching=packages |