Skip to content

Instantly share code, notes, and snippets.

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

Istvan l1x

🏠
Working from home
View GitHub Profile
// Match all nodes with FQDN ending in example.com
function(doc) {
if(doc.attributes.fqdn) {
var prefix = doc.attributes.fqdn.match(/^.*example.com$/);
if(prefix) {
emit(prefix, null);
}
}
}
@l1x
l1x / initial.sh
Created February 7, 2012 23:11
CentOS 6.2 x64
yum update -y
#services running after the default install
#btw who the fuck thinks that anybody need these?!
#[root@centos62 ~]# chkconfig | egrep ':on' | sed s-^-#-
#auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
#fcoe 0:off 1:off 2:on 3:on 4:on 5:on 6:off
#ip6tables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
#iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
#iscsi 0:off 1:off 2:off 3:on 4:on 5:on 6:off
@l1x
l1x / gist:1776447
Created February 9, 2012 01:56
chef error
# knife cookbook download SZOP
Downloading SZOP cookbook version 0.0.1
Downloading resources
Downloading providers
Downloading recipes
ERROR: EOFError: end of file reached
#to trigger this:
#go to
# cd /var/lib/chef/cookbook_index/
@l1x
l1x / gist:1777345
Created February 9, 2012 04:38
kallistec.error
# tail -f /var/log/chef/server.log | grep -i szop
merb : chef-server (api) : worker (port 4000) ~ Params: {"controller"=>"cookbooks", "action"=>"show_versions", "cookbook_name"=>"SZOP"}
merb : chef-server (api) : worker (port 4000) ~ Params: {"controller"=>"cookbooks", "action"=>"show", "cookbook_name"=>"SZOP", "cookbook_version"=>"0.0.1"}
merb : chef-server (api) : worker (port 4000) ~ Params: {"controller"=>"cookbooks", "action"=>"show_versions", "cookbook_name"=>"SZOP"}
merb : chef-server (api) : worker (port 4000) ~ Params: {"controller"=>"cookbooks", "action"=>"show", "cookbook_name"=>"SZOP", "cookbook_version"=>"0.0.1"}
merb : chef-server (api) : worker (port 4000) ~ Params: {"controller"=>"cookbooks", "action"=>"show_file", "cookbook_name"=>"SZOP", "cookbook_version"=>"0.0.1", "checksum"=>"77713ea742f128c4ba6e4346022fa186"}
@l1x
l1x / gist:1784127
Created February 9, 2012 23:09
chef-server API
# diff cookbooks.rb /usr/local/lib/ruby/gems/1.9.1/gems/chef-server-api-0.10.8/app/controllers/cookbooks.rb
144a145
> if File.exist?(filename)
145a147,150
> else
> raise NotFound, "File with checksum #{checksum} not found in the repository"
> end
>
@l1x
l1x / props.json
Created February 17, 2012 08:33
curl -sX GET http://127.0.0.1:8091/buckets/dev_mon/props | python -mjson.tool
{
"props": {
"allow_mult": false,
"basic_quorum": false,
"big_vclock": 50,
"chash_keyfun": {
"fun": "chash_std_keyfun",
"mod": "riak_core_util"
},
"dw": "quorum",
@l1x
l1x / map-high.json
Created February 17, 2012 09:02
map-high.json
{
"inputs": "goog",
"query": [
{
"map": {
"language": "javascript",
"source": "function(value,keyData,arg){ var data = Riak.mapValuesJson(value)[0]; return [data.High];}"
}
},
{
@l1x
l1x / dhclient-p2p1.leases
Created February 18, 2012 05:45
DHCP dhcp-lease-time
# /var/lib/dhclient/dhclient-p2p1.leases
lease {
interface "p2p1";
fixed-address 10.0.2.15;
filename "fedi003.pxe";
option subnet-mask 255.255.255.0;
option dhcp-lease-time 86400;
option routers 10.0.2.2;
option dhcp-message-type 5;
option dhcp-server-identifier 10.0.2.2;
@l1x
l1x / build.txt
Created February 18, 2012 06:11
riak build time on SSD
[l1x@fedi003 riak]$ time make all >/dev/null
real 0m53.961s
user 0m53.172s
sys 0m5.466s
riak-1.1.0rc2
@l1x
l1x / riak.txt
Created February 18, 2012 07:05
performing few basic tasks
$ time for i in {1..8}; do dev$i/bin/riak start ; done
real 0m13.603s
user 0m4.061s
sys 0m0.809s
$ time for i in {1..8}; do dev$i/bin/riak stop ; done
real 0m17.431s
user 0m0.960s