sakuric 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (407) hide show
  1. data/CHANGELOG +13 -0
  2. data/Gemfile +22 -0
  3. data/Gemfile.lock +60 -0
  4. data/HISTORY.yml +13 -0
  5. data/INSTALL +5 -0
  6. data/LICENSE +1 -0
  7. data/Makefile +19 -0
  8. data/Manifest +405 -0
  9. data/README.md +72 -0
  10. data/Rakefile +4 -0
  11. data/TODO +3 -0
  12. data/VERSION +1 -0
  13. data/bashrc +30 -0
  14. data/bashrc.d/00-functions.include +7 -0
  15. data/bashrc.d/01-sakura_checks.include +15 -0
  16. data/bashrc.d/02-uname.include +11 -0
  17. data/bashrc.d/80-ruby.include +4 -0
  18. data/bashrc.d/99-dirs.include +11 -0
  19. data/bashrc.d/aliases.include +20 -0
  20. data/bashrc.d/common.include +7 -0
  21. data/bashrc.d/local.d/README +1 -0
  22. data/bashrc.d/local.d/nothing.include +0 -0
  23. data/bashrc.d/uname.d/Darwin +6 -0
  24. data/bashrc.d/uname.d/Linux +0 -0
  25. data/bashrc.local.sample +11 -0
  26. data/bin/10 +7 -0
  27. data/bin/10times +7 -0
  28. data/bin/1every +22 -0
  29. data/bin/1everyN +22 -0
  30. data/bin/1suN +22 -0
  31. data/bin/2 +5 -0
  32. data/bin/act +24 -0
  33. data/bin/amarelo +2 -0
  34. data/bin/arancio +4 -0
  35. data/bin/arcobaleno +10 -0
  36. data/bin/bianco +3 -0
  37. data/bin/black +2 -0
  38. data/bin/brew-install +3 -0
  39. data/bin/cache +50 -0
  40. data/bin/cache3 +50 -0
  41. data/bin/cheorae +4 -0
  42. data/bin/colorastdouterr +37 -0
  43. data/bin/cp2desktop +3 -0
  44. data/bin/create-git-repo.sh +24 -0
  45. data/bin/csoe +37 -0
  46. data/bin/data +3 -0
  47. data/bin/derive +90 -0
  48. data/bin/dimmi +31 -0
  49. data/bin/dimmiora +4 -0
  50. data/bin/doppioni +48 -0
  51. data/bin/du- +9 -0
  52. data/bin/duplicates +48 -0
  53. data/bin/echodo +7 -0
  54. data/bin/ensure_line_present +82 -0
  55. data/bin/epoch2date +5 -0
  56. data/bin/fanout +100 -0
  57. data/bin/find-broken-symlink +26 -0
  58. data/bin/find-duplicates +48 -0
  59. data/bin/find-special-chars-within-filenames +12 -0
  60. data/bin/fix-terminal +5 -0
  61. data/bin/gce-create-centos-instance +5 -0
  62. data/bin/gce-create-custom-image +8 -0
  63. data/bin/gce-curl-get-instances-for-project +7 -0
  64. data/bin/gce-get-token +3 -0
  65. data/bin/gce-getproject-metadata +35 -0
  66. data/bin/gce-public-ip +4 -0
  67. data/bin/gcutil-fetch +36 -0
  68. data/bin/giallo +2 -0
  69. data/bin/git-clone-in-non-empty-dir +21 -0
  70. data/bin/git-ignore +3 -0
  71. data/bin/git-repos +98 -0
  72. data/bin/git-repos.py +99 -0
  73. data/bin/gitinfo +2 -0
  74. data/bin/google-spreadsheet-cat +40 -0
  75. data/bin/google_ips +5 -0
  76. data/bin/gray +3 -0
  77. data/bin/green +2 -0
  78. data/bin/grigio +3 -0
  79. data/bin/gsutil-debug-bucket +12 -0
  80. data/bin/gsutil-get-oauth2-token +4 -0
  81. data/bin/gugol-image +74 -0
  82. data/bin/hamachi-ubuntu-install +17 -0
  83. data/bin/head-1^-1 +5 -0
  84. data/bin/ifdownup +13 -0
  85. data/bin/immature/ok2 +25 -0
  86. data/bin/immature/twice-still-broken +9 -0
  87. data/bin/install-gic-repo +13 -0
  88. data/bin/install-sakura-on-debian-latest +6 -0
  89. data/bin/iphoto_big_files.sh +37 -0
  90. data/bin/itunes +140 -0
  91. data/bin/jason-xpath.rb +54 -0
  92. data/bin/jsawk +1128 -0
  93. data/bin/json-xpath.rb +54 -0
  94. data/bin/keepup +13 -0
  95. data/bin/lsof-top10 +3 -0
  96. data/bin/minicook +218 -0
  97. data/bin/mv2. +2 -0
  98. data/bin/mv2desktop +2 -0
  99. data/bin/mv2dropbox +2 -0
  100. data/bin/mv2here +2 -0
  101. data/bin/mvto +39 -0
  102. data/bin/nero +2 -0
  103. data/bin/never_as_root +18 -0
  104. data/bin/not +16 -0
  105. data/bin/ok +42 -0
  106. data/bin/orange +4 -0
  107. data/bin/pink +2 -0
  108. data/bin/polygen-dell +7 -0
  109. data/bin/polygen-heanet +6 -0
  110. data/bin/polygen-labs +4 -0
  111. data/bin/print_key_val +4 -0
  112. data/bin/rainbow +10 -0
  113. data/bin/recipe +19 -0
  114. data/bin/red +2 -0
  115. data/bin/remember-command +140 -0
  116. data/bin/remember-command.rb +140 -0
  117. data/bin/richelp +99 -0
  118. data/bin/ricorda-comando +140 -0
  119. data/bin/rosa +2 -0
  120. data/bin/rosso +2 -0
  121. data/bin/run-parts.sh +50 -0
  122. data/bin/sakura-check-version +48 -0
  123. data/bin/sakura-init.DRAFT +5 -0
  124. data/bin/sakura-version +2 -0
  125. data/bin/sano +5 -0
  126. data/bin/sbianca +3 -0
  127. data/bin/sblua +2 -0
  128. data/bin/setterm-reset +5 -0
  129. data/bin/sgialla +2 -0
  130. data/bin/sgrigia +2 -0
  131. data/bin/split +37 -0
  132. data/bin/split.rb +37 -0
  133. data/bin/srosa +1 -0
  134. data/bin/srossa +2 -0
  135. data/bin/strip-white-spaces +2 -0
  136. data/bin/stty-sane +5 -0
  137. data/bin/sudo^-1 +18 -0
  138. data/bin/sverda +6 -0
  139. data/bin/swift-saio-install.sh +336 -0
  140. data/bin/synergyc +0 -0
  141. data/bin/synergys +0 -0
  142. data/bin/syracuse.pl +29 -0
  143. data/bin/tail-n+2 +5 -0
  144. data/bin/tellme +31 -0
  145. data/bin/tellme-time +4 -0
  146. data/bin/timeout3 +91 -0
  147. data/bin/top5 +4 -0
  148. data/bin/trim +4 -0
  149. data/bin/trova-broken-symlink +26 -0
  150. data/bin/twice +5 -0
  151. data/bin/twice.rb +5 -0
  152. data/bin/ubuntu-install-hamachi64 +17 -0
  153. data/bin/ultimo +5 -0
  154. data/bin/upload.py +2380 -0
  155. data/bin/usleep +0 -0
  156. data/bin/varia +90 -0
  157. data/bin/verde +2 -0
  158. data/bin/vermelho +2 -0
  159. data/bin/vim-whereveritis +5 -0
  160. data/bin/viola +1 -0
  161. data/bin/virsh-list-all-vms.py +21 -0
  162. data/bin/virtualbox-manage +41 -0
  163. data/bin/weekend +12 -0
  164. data/bin/whattimeisit +4 -0
  165. data/bin/whereis-ip +5 -0
  166. data/bin/white +3 -0
  167. data/bin/whitefy +3 -0
  168. data/bin/yellow +2 -0
  169. data/bin/yellowfy +2 -0
  170. data/bin/zombies +25 -0
  171. data/docz/polygen/dell.grm +100 -0
  172. data/docz/polygen/frati.grm +85 -0
  173. data/docz/polygen/heanet.grm +54 -0
  174. data/docz/richelp/gcompute.yml +52 -0
  175. data/docz/richelp/gcutil.yml +52 -0
  176. data/docz/richelp/gmail.yml +2 -0
  177. data/docz/richelp/ruby.yml +81 -0
  178. data/docz/richelp/sakura.yml +20 -0
  179. data/docz/richelp/sql.yml +12 -0
  180. data/docz/richelp/ubuntu.yml +22 -0
  181. data/docz/richelp/yaml.yml +39 -0
  182. data/docz/richelp/yml.yml +39 -0
  183. data/etc/sakura/devel.yml +36 -0
  184. data/etc/synergy.conf.example +37 -0
  185. data/images/color-sample.png +0 -0
  186. data/images/google.jpg +0 -0
  187. data/images/icons/toilet.png +0 -0
  188. data/images/sakura.jpg +0 -0
  189. data/images/sakura2.jpg +0 -0
  190. data/init.rb +5 -0
  191. data/lib/classes/arrays.rb +246 -0
  192. data/lib/classes/debug_ric.rb +196 -0
  193. data/lib/classes/fake_data.rb +8 -0
  194. data/lib/classes/ric_debug.rb +0 -0
  195. data/lib/classes/ricconf.rb +110 -0
  196. data/lib/classes/richelp.rb +70 -0
  197. data/lib/classes/strings.rb +284 -0
  198. data/lib/facter/google_compute_engine.rb +10 -0
  199. data/lib/recipes/20120411-puppet-rump-palladius.recipe +2 -0
  200. data/lib/recipes/20120726-skype.ubuntu.recipe +16 -0
  201. data/lib/recipes/20130206-puppet3.ubuntu.recipe +32 -0
  202. data/lib/recipes/20130206-redis.linux.recipe +17 -0
  203. data/lib/recipes/20130208-vanilla.linux.recipe +37 -0
  204. data/lib/recipes/Makefile +4 -0
  205. data/lib/recipes/README.md +29 -0
  206. data/lib/recipes/scripts/redis.sh +14 -0
  207. data/lib/ric.rb +156 -0
  208. data/lib/ric_colors.rb +313 -0
  209. data/lib/ric_strings.rb +285 -0
  210. data/lib/sonice-players/itunes_mac.rb +43 -0
  211. data/lib/sonice-players/itunes_win.rb +47 -0
  212. data/lib/sonice-players/mpd.rb +45 -0
  213. data/lib/sonice-players/rhythmbox.rb +38 -0
  214. data/profile +1 -0
  215. data/sakuric.gemspec +40 -0
  216. data/sbin/install-sakura-on-debian +25 -0
  217. data/sbin/make-install.sh +10 -0
  218. data/sbin/mate-createsymlink +4 -0
  219. data/sounds/0.ogg +0 -0
  220. data/sounds/0.wav +0 -0
  221. data/sounds/01.ogg +0 -0
  222. data/sounds/02.ogg +0 -0
  223. data/sounds/03.ogg +0 -0
  224. data/sounds/08.ogg +0 -0
  225. data/sounds/09.ogg +0 -0
  226. data/sounds/1.ogg +0 -0
  227. data/sounds/1.wav +0 -0
  228. data/sounds/10.ogg +0 -0
  229. data/sounds/100.ogg +0 -0
  230. data/sounds/11.ogg +0 -0
  231. data/sounds/12.ogg +0 -0
  232. data/sounds/13.ogg +0 -0
  233. data/sounds/14.ogg +0 -0
  234. data/sounds/15.ogg +0 -0
  235. data/sounds/16.ogg +0 -0
  236. data/sounds/17.ogg +0 -0
  237. data/sounds/18.ogg +0 -0
  238. data/sounds/19.ogg +0 -0
  239. data/sounds/2.ogg +0 -0
  240. data/sounds/2.wav +0 -0
  241. data/sounds/20.ogg +0 -0
  242. data/sounds/21.ogg +0 -0
  243. data/sounds/22.ogg +0 -0
  244. data/sounds/23.ogg +0 -0
  245. data/sounds/24.ogg +0 -0
  246. data/sounds/26.ogg +0 -0
  247. data/sounds/3.ogg +0 -0
  248. data/sounds/3.wav +0 -0
  249. data/sounds/30.ogg +0 -0
  250. data/sounds/34.ogg +0 -0
  251. data/sounds/4.ogg +0 -0
  252. data/sounds/4.wav +0 -0
  253. data/sounds/40.ogg +0 -0
  254. data/sounds/42.ogg +0 -0
  255. data/sounds/45.ogg +0 -0
  256. data/sounds/47.ogg +0 -0
  257. data/sounds/5.ogg +0 -0
  258. data/sounds/5.wav +0 -0
  259. data/sounds/50.ogg +0 -0
  260. data/sounds/6.ogg +0 -0
  261. data/sounds/6.wav +0 -0
  262. data/sounds/60.ogg +0 -0
  263. data/sounds/7.ogg +0 -0
  264. data/sounds/7.wav +0 -0
  265. data/sounds/70.ogg +0 -0
  266. data/sounds/8.ogg +0 -0
  267. data/sounds/8.wav +0 -0
  268. data/sounds/80.ogg +0 -0
  269. data/sounds/9.ogg +0 -0
  270. data/sounds/9.wav +0 -0
  271. data/sounds/90.ogg +0 -0
  272. data/sounds/a.ogg +0 -0
  273. data/sounds/aaahhh.ogg +0 -0
  274. data/sounds/abologna.ogg +0 -0
  275. data/sounds/adargenta.ogg +0 -0
  276. data/sounds/alzatiecammina.ogg +0 -0
  277. data/sounds/apache.ogg +0 -0
  278. data/sounds/attenzione.ogg +0 -0
  279. data/sounds/awesome.m4a +0 -0
  280. data/sounds/bazinga.mp3 +0 -0
  281. data/sounds/bazinga.ogg +0 -0
  282. data/sounds/bela regaz.wav +0 -0
  283. data/sounds/benvenuti.wav +0 -0
  284. data/sounds/benvenuti2.wav +0 -0
  285. data/sounds/bergonz.ogg +0 -0
  286. data/sounds/boh.ogg +0 -0
  287. data/sounds/buahah.ogg +0 -0
  288. data/sounds/buonasera.ogg +0 -0
  289. data/sounds/buongiorno.ogg +0 -0
  290. data/sounds/burp.ogg +0 -0
  291. data/sounds/carlo.ogg +0 -0
  292. data/sounds/cena.ogg +0 -0
  293. data/sounds/che figata.m4a +0 -0
  294. data/sounds/che figlio di puttana.m4a +0 -0
  295. data/sounds/che.ogg +0 -0
  296. data/sounds/ciao.ogg +0 -0
  297. data/sounds/ciao.wav +0 -0
  298. data/sounds/da.ogg +0 -0
  299. data/sounds/davide.ogg +0 -0
  300. data/sounds/demone.ogg +0 -0
  301. data/sounds/dhcp.ogg +0 -0
  302. data/sounds/dinuovo.ogg +0 -0
  303. data/sounds/dns.ogg +0 -0
  304. data/sounds/dopo.ogg +0 -0
  305. data/sounds/e'.ogg +0 -0
  306. data/sounds/eattivo.ogg +0 -0
  307. data/sounds/ee.ogg +0 -0
  308. data/sounds/ehi.ogg +0 -0
  309. data/sounds/eoragiu.ogg +0 -0
  310. data/sounds/eorasu.ogg +0 -0
  311. data/sounds/eripartita.ogg +0 -0
  312. data/sounds/estato.ogg +0 -0
  313. data/sounds/estatoriavviato.ogg +0 -0
  314. data/sounds/fratro.ogg +0 -0
  315. data/sounds/frozenbubble.ogg +0 -0
  316. data/sounds/funziona.ogg +0 -0
  317. data/sounds/go raibh mile maith agaibh.m4a +0 -0
  318. data/sounds/grazie.ogg +0 -0
  319. data/sounds/h1.ogg +0 -0
  320. data/sounds/hainuovaposta.ogg +0 -0
  321. data/sounds/hogiamangiato.ogg +0 -0
  322. data/sounds/host.ogg +0 -0
  323. data/sounds/il.ogg +0 -0
  324. data/sounds/ilcomputer.ogg +0 -0
  325. data/sounds/ilnumerodaleiselezionatoe.ogg +0 -0
  326. data/sounds/ilprocesso.ogg +0 -0
  327. data/sounds/ilprogramma.ogg +0 -0
  328. data/sounds/ilservizio.ogg +0 -0
  329. data/sounds/imap.ogg +0 -0
  330. data/sounds/imieisuperpoterimidiconoche.ogg +0 -0
  331. data/sounds/infunzione.ogg +0 -0
  332. data/sounds/inpunto.ogg +0 -0
  333. data/sounds/ipmon.ogg +0 -0
  334. data/sounds/laconnessioneadinternet.ogg +0 -0
  335. data/sounds/lastampante.ogg +0 -0
  336. data/sounds/lazzaron.ogg +0 -0
  337. data/sounds/ldap.ogg +0 -0
  338. data/sounds/linterfaccia.ogg +0 -0
  339. data/sounds/lucilla.ogg +0 -0
  340. data/sounds/ma vaffanculo.m4a +0 -0
  341. data/sounds/majjal.wav +0 -0
  342. data/sounds/mamma.ogg +0 -0
  343. data/sounds/mauro.ogg +0 -0
  344. data/sounds/max.ogg +0 -0
  345. data/sounds/meerda.wav +0 -0
  346. data/sounds/meno.ogg +0 -0
  347. data/sounds/merda clo.wav +0 -0
  348. data/sounds/mezza.ogg +0 -0
  349. data/sounds/mila.ogg +0 -0
  350. data/sounds/mille.ogg +0 -0
  351. data/sounds/minuti.ogg +0 -0
  352. data/sounds/named.ogg +0 -0
  353. data/sounds/no.ogg +0 -0
  354. data/sounds/nohofame.ogg +0 -0
  355. data/sounds/nonfunziona.ogg +0 -0
  356. data/sounds/nonriescoatrovare.ogg +0 -0
  357. data/sounds/nonsarebbeoradilavorare.ogg +0 -0
  358. data/sounds/nonstalavorando.ogg +0 -0
  359. data/sounds/numero.wav +0 -0
  360. data/sounds/ooohhh.ogg +0 -0
  361. data/sounds/pinger.ogg +0 -0
  362. data/sounds/pocofa.ogg +0 -0
  363. data/sounds/pop3.ogg +0 -0
  364. data/sounds/porca puttana.m4a +0 -0
  365. data/sounds/porcapupazza.ogg +0 -0
  366. data/sounds/ppp.ogg +0 -0
  367. data/sounds/pranzo.ogg +0 -0
  368. data/sounds/prego.ogg +0 -0
  369. data/sounds/prima.ogg +0 -0
  370. data/sounds/qualcosamidice.ogg +0 -0
  371. data/sounds/raggiungibile.ogg +0 -0
  372. data/sounds/riccardo.ogg +0 -0
  373. data/sounds/salsa ridge.wav +0 -0
  374. data/sounds/scusa.ogg +0 -0
  375. data/sounds/seriously man.m4a +0 -0
  376. data/sounds/si.ogg +0 -0
  377. data/sounds/sito porno con sonoro.wav +0 -0
  378. data/sounds/socmel.wav +0 -0
  379. data/sounds/sono.ogg +0 -0
  380. data/sounds/sonoacasa.ogg +0 -0
  381. data/sounds/sonole.ogg +0 -0
  382. data/sounds/sputo.ogg +0 -0
  383. data/sounds/ssh.ogg +0 -0
  384. data/sounds/stagiocando.ogg +0 -0
  385. data/sounds/statospento.ogg +0 -0
  386. data/sounds/stopaiodipalle.ogg +0 -0
  387. data/sounds/thesedicks.wav +0 -0
  388. data/sounds/tornatosu.ogg +0 -0
  389. data/sounds/trapoco.ogg +0 -0
  390. data/sounds/trequarti.ogg +0 -0
  391. data/sounds/tutti.ogg +0 -0
  392. data/sounds/una.ogg +0 -0
  393. data/sounds/unquarto.ogg +0 -0
  394. data/sounds/virgola.ogg +0 -0
  395. data/sources/c/usleep.c +50 -0
  396. data/spec/my_first_spec.rb +6 -0
  397. data/tasks/sakuric-gem.rake +21 -0
  398. data/tasks/testing.rake +15 -0
  399. data/templates/bashrc.inject +10 -0
  400. data/templates/happy_christmas.ascii_art +5 -0
  401. data/test/roodi.sh +10 -0
  402. data/test/test_mini_failing.rb +3 -0
  403. data/test/test_mini_ok.rb +3 -0
  404. data/test/test_ruby_syntax.sh +12 -0
  405. data/third-party/jsawk/README.markdown +437 -0
  406. data/third-party/jsawk/jsawk +1128 -0
  407. metadata +835 -0
@@ -0,0 +1,10 @@
1
+
2
+ # Riccardo Carlesso
3
+ # So far, iot checks this one: /usr/share/google/safe_format_and_mount
4
+
5
+ Facter.add("is_google_vm") do
6
+ setcode do
7
+ File.exists? '/usr/share/google/safe_format_and_mount'
8
+ end
9
+ end
10
+
@@ -0,0 +1,2 @@
1
+ # TODO
2
+ TODO: bar
@@ -0,0 +1,16 @@
1
+ prechecks:
2
+ prerequisites:
3
+ facter: # needs that facter by KEY equals VALUE
4
+ lsbdistid: Ubuntuzzz
5
+ description: This try to install skype on Ubuntu!
6
+ name: skype
7
+ install:
8
+ here: |
9
+ sudo apt-add-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
10
+ sudo apt-get update && sudo apt-get install skype
11
+ test:
12
+ here:
13
+ installed on ubuntu: dpkg -l | egrep '^ii skype'
14
+ uninstall:
15
+ here:
16
+ sudo apt-get remove skype
@@ -0,0 +1,32 @@
1
+ date: 20130206
2
+ description: |
3
+ installs Puppet3 on Ubuntu Lucid
4
+ and tries to autodetect distro. It is tested on Lucid and Precise
5
+ Puppet 3 is a super cool version of Puppet with nifty new features.
6
+ It can also deploy modules automagically.
7
+ name: puppet-v3
8
+ url: http://projects.puppetlabs.com/projects/1/wiki/Puppet_Ubuntu
9
+ prerequisites:
10
+ facter:
11
+ lsbdistid: Ubuntu
12
+ here:
13
+ distro is Ubuntu: 'facter lsbdistid | egrep ^Ubuntu$'
14
+ modules:
15
+ - vanilla
16
+ install:
17
+ here: |
18
+ echo -e "deb http://apt.puppetlabs.com/ {{facter|lsbdistcodename}} main\ndeb-src http://apt.puppetlabs.com/ {{facter|lsbdistcodename}} main" >> /etc/apt/sources.list.d/minicook-puppet.list
19
+ apt-key adv --keyserver keyserver.ubuntu.com --recv 4BD6EC30
20
+ apt-get update
21
+ apt-get install puppet # For the puppet client
22
+ test:
23
+ here:
24
+ puppet version 3: - puppet --version | egrep ^3\.
25
+ uninstall:
26
+ here: |
27
+ rm /etc/apt/sources.list.d/minicook-puppet.list
28
+ apt-get update
29
+ apt-get remove puppet # For the puppet client
30
+ test:
31
+ here:
32
+ either no puppet or puppet with version 2: which puppet || puppet --version | egrep ^2\.
@@ -0,0 +1,17 @@
1
+ ##########################################################
2
+ # this recipe installs redis on a generic linux machine
3
+ ##########################################################
4
+ date: 20130208
5
+ description: installs Redix on any Linux Machine
6
+ name: redis-from-sources
7
+ url: "http://redis.io/download"
8
+ prerequisites:
9
+ facter:
10
+ lsbdistid: Ubuntu
11
+ kernel: Linux
12
+ code:
13
+ file: sh scripts/redis.sh
14
+ tests:
15
+ here:
16
+ process working: 'ps aux | grep redis'
17
+ file exists: '[ -f redis-*/src/redis-server ]'
@@ -0,0 +1,37 @@
1
+ #############
2
+ # Created with 'minicook generate'
3
+ #############
4
+ date: 20130206
5
+ description: |
6
+ installs Vanilla Riccardo package
7
+ name: ric-vanilla
8
+ version: 0.9
9
+ #url: not yet
10
+ prerequisites:
11
+ #facter:
12
+ # lsbdistid: Ubuntu
13
+ #here:
14
+ # distro is Ubuntu: 'facter lsbdistid | egrep ^Ubuntu$'
15
+ #modules:
16
+ #- vanilla
17
+ packages:
18
+ - rubygems
19
+ - git
20
+ file:
21
+ - /usr/bin/gem
22
+ - /usr/bin/git
23
+ install:
24
+ here: |
25
+ touch /root/vanilla-minicook-installed.touch
26
+ gem install ric
27
+ gems:
28
+ - ric
29
+ test:
30
+ here:
31
+ vanilla touch file: test -f /root/vanilla-minicook-installed.touch
32
+ uninstall:
33
+ here: |
34
+ rm /root/vanilla-minicook-installed.touch
35
+ test:
36
+ here:
37
+ vanilla touch file: 'test ! -f /root/vanilla-minicook-installed.touch'
@@ -0,0 +1,4 @@
1
+
2
+ test:
3
+ ymltest *.recipe
4
+
@@ -0,0 +1,29 @@
1
+
2
+ Welcome to MiniCook
3
+ -------------------
4
+
5
+ Welcoem to MiniCook, a small/agile version of Chef/Puppet-like Config Management systems.
6
+
7
+
8
+ Ideas
9
+ =====
10
+
11
+ A recipe should give you a way to install code, and test the code.
12
+ As simple as that. It should have prerequisites, and post-requisites (test for correct installation).
13
+ It should also have a means to uninstall it CLEANLY. swho better than the installer knows how to uninstall?
14
+
15
+ Install
16
+ =======
17
+
18
+ This requires facter
19
+
20
+ $ sudo gem install facter
21
+ $ git clone https://github.com/palladius/sakura/
22
+ $ sakura/bin/minicook list
23
+ $ sakura/bin/minicook apply puppet3
24
+
25
+ TODO
26
+ ----
27
+
28
+ Implement the system which USES these recipes :)
29
+
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+
3
+ #URL: http://redis.io/download
4
+
5
+ wget http://redis.googlecode.com/files/redis-2.6.9.tar.gz
6
+ tar xzf redis-2.6.9.tar.gz
7
+ cd redis-2.6.9
8
+ make
9
+
10
+ # start server
11
+ src/redis-server &
12
+
13
+ echo 'set foo riccardobar' | rc/redis-cli
14
+ echo get foo| rc/redis-cli > /root/redis-get-foo.out
@@ -0,0 +1,156 @@
1
+ #!/usr/bin/env ruby -W0
2
+
3
+ =begin
4
+
5
+ Welcome to Riccardo Carlesso first (private) library..
6
+
7
+ =end
8
+
9
+ # was: 'SVNRIC'
10
+ $SAKURADIR = File.expand_path(ENV['SAKURADIR'] || '~/git/sakura/')
11
+
12
+ $git_conf = {
13
+ #:svn_id => "$Id$",
14
+ :ver => '0.10.02',
15
+ :use_ric_gem => false
16
+ }
17
+ #$git_conf[:svn_last_rev] = $git_conf[:svn_id].split(' ')[2]
18
+ $RICLIB_VERSION = $git_conf[:ver] # now dry { }"0.9.009"
19
+
20
+ #NON VA in alcune macchine! Nescio cur! require 'rubygems' # necessary for other gems
21
+ require 'digest/md5'
22
+ require 'digest/sha1'
23
+ require 'net/smtp'
24
+ require "socket"
25
+ require 'yaml'
26
+
27
+ if $git_conf[:use_ric_gem] # slow but cool
28
+ require 'rubygems'
29
+ require 'ric'
30
+ else
31
+ require "#{$SAKURADIR}/lib/ric_colors.rb"
32
+ end
33
+
34
+ ################################################################################
35
+ # Riccardo Ruby LIBRARY
36
+ #
37
+ # TO INCLUDE THIS FILE, just paste this:
38
+ #
39
+ # require "$SAKURADIR/lib/ric.rb"
40
+ #
41
+ ################################################################################
42
+
43
+ #module Carlesso
44
+ ################################################################################
45
+ # Configuratione... see _init
46
+ # @tags: obsolete, ric, r, lib, gem, init, loader
47
+ # @description: try instead
48
+ ################################################################################
49
+
50
+ # conf files into auto/ dir (mi son rotto di aggiungerli qui uno a uno!)
51
+ def _get_auto_files(subdir)
52
+ absolute_dir = "#{$SAKURADIR}/lib/#{subdir}"
53
+ Dir.new(absolute_dir).select{|f| f.match( /\.rb$/ )}.map{|x| subdir + File.basename(x,'.rb') }
54
+ end
55
+
56
+ def reload_doesnt_work_properly!(first_time=false,enable_debug=false)
57
+ puts "[#{$$}] reload_doesnt_work_properly!(#{$0},#{first_time},#{enable_debug},#{$RELOADED_ONCE}) being called" if $RELOAD_DEBUG
58
+ $RELOADED_ONCE += 1
59
+ npass = $RICLIB['nreloaded']
60
+ if npass > 3
61
+ puts "[ERR] More than first pass: quitting checcacchio!"
62
+ #return
63
+ end
64
+ debug_on("reload_doesnt_work_properly called with debug enabled!") if enable_debug
65
+ str = "Reloaded Riclibs v#{$RICLIB_VERSION} -- per la #{$RICLIB['nreloaded']} a volta"
66
+ first_time = false if $RICLIB['nreloaded'] > 1
67
+ modules_to_be_included = $RIC_LIB_MODULES + _get_auto_files("classes/")
68
+ modules_to_be_included.each{ |cls|
69
+ was_necessary = require "#{$SAKURADIR}/lib/#{cls}.rb"
70
+ deb "Pass[#{npass}] Loading: #{cls} (necessary: #{was_necessary})" rescue puts("nil #{$!}")
71
+ }
72
+ end
73
+
74
+
75
+ =begin
76
+ Sto qui inizializza TUTTO cazzo, ho detto TUTTO, non voglio codice qui fuori!
77
+ # puo' esser chiamato piu' volte...
78
+
79
+ $RELOAD_DEBUG serve a debuggare il tutto.
80
+ =end
81
+ def _init(explaination='no explaination given')
82
+ #debug_off
83
+ $RELOAD_DEBUG = false #
84
+ deb "pre init '#{explaination}'" if $RELOAD_DEBUG
85
+ $SCRIPT_BEGUN = Time.now
86
+ $SVN_ID = "$Id$".split[3] # .quote non ancora def azz!
87
+ $USER = 'riccardo'
88
+ $INIT_DEBUG = false # dice se debuggare la mia intera infrastruttura o no...
89
+ $RELOADED_ONCE = 0 # aiuta a capuire quante volte includo sta cazo di lib! Sempre 2!!!
90
+ $RIC_LIB_MODULES = %w{ classes/debug_ric } # to be explicitly included in this order.
91
+ $HOME = File.expand_path('~')
92
+ $DEBUG ||= false
93
+ $PROG = File.basename($0)
94
+
95
+ ################################################################################
96
+ # Path to riccardo's Library... Library stuff
97
+ $LOAD_PATH << './lib'
98
+ $LOAD_PATH << "#{$SAKURADIR}/lib/"
99
+ # BEWARE: ORDER *IS* RELEVANT!
100
+ $RICLIB = Hash.new unless defined?($RICLIB)
101
+ $RICLIB['VERSION'] = $RICLIB_VERSION
102
+ $RICLIB['libs'] ||= []
103
+ $RICLIB['nreloaded'] ||= 0
104
+ $RICLIB['nreloaded'] += 1
105
+ $RICLIB['help'] =<<-BURIDONE
106
+ Questa libreria contiene tutto il mio sapere enciclopedico, ovvero nozionistico. :P
107
+ ho finalmente risolto il baco della doppia inclusion (cribsio, files includeva questo!)
108
+ BURIDONE
109
+ reload_doesnt_work_properly!(true)
110
+ $CONF = RicConf.new
111
+ $SVN_ID="$Id$".split[3].quote rescue "No SVN Id causa migrazione!"
112
+ pyellow( riclib_info ) if debug?
113
+
114
+ puts "post init delle #{Time.now}" if $RELOAD_DEBUG
115
+ end
116
+
117
+ =begin
118
+ This wants to be a magic configuration loader who looks for configuration automatically in many places, like:
119
+
120
+ - ./.CONFNAME.yml
121
+ - ~/.CONFNAME.yml
122
+ - .CONFNAME/conf.yml
123
+
124
+ Loads a YAML file looked upon in common places and returns a hash with appropriate values, or an exception
125
+ and maybe a nice explaination..
126
+ =end
127
+ def load_auto_conf_migrated_to_ric_gem(confname, opts={})
128
+ dirs = opts.fetch :dirs, ['.', '~', '/etc/']
129
+ file_patterns = opts.fetch :file_patterns, [".#{confname}.yml", "#{confname}/conf.yml"]
130
+ sample_hash = opts.fetch :sample_hash, { 'load_auto_conf' => "please add an :sample_hash to me" , :anyway => "I'm in #{__FILE__}"}
131
+ verbose = opts.fetch :verbose, true
132
+ puts "load_auto_conf('#{confname}') start.." if verbose
133
+ dirs.each{|d|
134
+ dir = File.expand_path(d)
135
+ deb "DIR: #{dir}"
136
+ file_patterns.each{|fp|
137
+ # if YML exists return the load..
138
+ file = "#{dir}/#{fp}"
139
+ deb " - FILE: #{file}"
140
+ if File.exists?(file)
141
+ puts "Found! #{green file}"
142
+ yaml = YAML.load( File.read(file) )
143
+ deb "load_auto_conf('#{confname}') found: #{green yaml}"
144
+ return yaml
145
+ end
146
+ }
147
+ }
148
+ puts "Conf not found. Try this:\n---------------------------\n$ cat > ~/#{file_patterns.first}\n#{yellow "#Creatd by ric.rb:load_auto_conf()\n" +sample_hash.to_yaml}\n---------------------------\n"
149
+ raise "LoadAutoConf: configuration not found for '#{confname}'!"
150
+ return sample_hash
151
+ end
152
+
153
+ ## CALL THE INIT! YAY!
154
+ _init("inizializzo alle #{Time.now}")
155
+
156
+ #end /module Carlesso
@@ -0,0 +1,313 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # PLease forgive me this is going to be obsoleted soon
4
+
5
+ module RicColorsObsolete
6
+
7
+ $debug_pad_colors = nil # try: [ '(',')']
8
+ $colors_active = false
9
+
10
+ $color_db = [
11
+ %w{ normal black2 black dkblack red green brown blue midngihtblue purple cyan lgray gray lred lgreen yellow lblue violet azure white orange orange2 orangey magenta lyellow pink dkpink gold dkgreen carminio vermiglio bordeaux kawasaki azure2 indigo } , # english word
12
+ %w{ normale nero2 nero nerone rosso verde marrone blu bluenotte porpora ciano grigino grigione rossino verdino giallo lblu viola azzurro bianco arancio arancio2 arancino magenta giallino rosa rosino oro verdone carminio vermiglio bordo kawasaki azzurro2 indaco } , # italian word
13
+ %w{ 0;37 0;30 38;5;233 38;5;236 0;31 1;32 38;5;94 0;34 38;5;17 1;35 0;36 0;37 1;30 1;31 1;32 1;33 1;34 1;35 1;36 1;37 38;5;208 38;5;166 38;5;222 0;35 38;5;229 38;5;204 38;5;203 38;5;214 38;5;28 38;5;196 38;5;125 38;5;89 38;5;119 38;5;45 38;5;57 } ,
14
+ %w{ 000 000 111 222 f00 0f0 00f 191970 ff0 0ff aaa 888 f00 afa ff0 eebb00 } # HEX RGB
15
+ ]
16
+
17
+ def colors_on
18
+ set_color :on #(true)
19
+ end
20
+ def colors_off
21
+ set_color(false)
22
+ end
23
+
24
+ # TODO support a block (solo dentro l blocco fai il nocolor)
25
+ def set_color(bool)
26
+ b = bool ? true : false
27
+ deb "Setting color mode to: #{yellow bool} --> #{white b.to_s}"
28
+ b = false if bool.to_s.match( /(off|false)/ )
29
+ deb "Setting color mode to: #{yellow bool} --> #{white b.to_s}"
30
+ if block_given?
31
+ puts "TODO!!! scolara qui"
32
+ yield
33
+ puts "TODO ricolora qui"
34
+ end
35
+ $colors_active = bool
36
+ end
37
+ alias :set_colors :set_color
38
+
39
+ def bash_color(n, str )
40
+ "\033[#{n}m#{str}\033[0m"
41
+ end
42
+
43
+ def pcolor(color_name='red',str='COLOR: please define a string')
44
+ if $colors_active
45
+ puts colora(color_name,str)
46
+ else
47
+ puts str
48
+ end
49
+ end
50
+
51
+ def visible_color(s)
52
+ !( s.match(/nero|black/) )
53
+ end
54
+
55
+
56
+ def colora(color_name='greenpurpureo',str='colora_test_str2', opts={})
57
+ color_name = color_name.to_s
58
+ str = $debug_pad_colors ? $debug_pad_colors.join(str) : str # Adding '(2πi)'
59
+ return str unless $colors_active
60
+ return str if opts[:nocolor]
61
+ if ix = $color_db[0].index(color_name)
62
+ bash_color($color_db[2][ix],str)
63
+ elsif ix = $color_db[1].index(color_name)
64
+ bash_color($color_db[2][ix],str)
65
+ else
66
+ debug "Sorry, unknown color '#{color_name}'. Available ones are: #{$color_db[0].join(',') }"
67
+ end
68
+ end
69
+
70
+ alias :p :puts
71
+
72
+ def color_test(with_italian = false)
73
+ i=0
74
+ palette = $color_db[0].map { |c|
75
+ inglese = c
76
+ italiano = $color_db[1][i]
77
+ i = i+1
78
+ colora( c, with_italian ? [c,italiano].join(','): c )
79
+ }
80
+ puts( (1..257).map{|c| bash_color( "38;5;#{c}", c) }.join(', ') )
81
+ puts( palette.sort{|a,b| a.to_s.gsub(/[^a-z]/,'') <=> b.to_s.gsub(/[^a-z]/,'') }.join(' ')) # sort on a-z chars only (no color)
82
+ _flag_nations.sort.each{|nation|
83
+ puts "- Flag sample for #{nation}:\t" + flag("ThisIsAFlaggedPhraseBasedOnNation:#{nation}",nation)
84
+ }
85
+ end
86
+ alias :colortest :color_test
87
+
88
+ # carattere per carattere...
89
+ def rainbow(str)
90
+ i=0
91
+ ret = ''
92
+ str=str.to_s
93
+ while(i < str.length)
94
+ ch = str[i]
95
+ palette = $color_db[0][i % $color_db[0].length ]
96
+ ret << (colora(palette,str[i,1]))
97
+ i += 1
98
+ end
99
+ ret
100
+ end
101
+ alias :arcobaleno :rainbow
102
+
103
+
104
+ #########################################
105
+ # Dynamic functions
106
+ #########################################
107
+ #assert(color_db[0].length == color_db[1].length,"English and italian colors must be the same cardinality!!!")
108
+ # TODO ripeti con , $color_db[1]
109
+ ( $color_db[0] + $color_db[1] ).each { |colorname|
110
+ dyn_func = "
111
+
112
+ def get_#{colorname} (str='colors.rb: get_COLOR dynamically generated ENGLISH COLOR ')
113
+ return colora('#{colorname}',str)
114
+ end
115
+
116
+ def #{colorname} (str='colors.rb: COLOR dynamically generated ENGLISH COLOR TO BE COPIED TO GET')
117
+ return colora('#{colorname}',str) rescue
118
+ \"Errore #{colorname} con stringa '#"+"{str}' e classe #"+"{str.class} \"
119
+ end
120
+
121
+ def p#{colorname} (str='colors.rb: pCOLOR dynamically generated ENGLISH COLOR TO BE DESTROYED')
122
+ puts colora('#{colorname}',str)
123
+ end
124
+ "
125
+ eval dyn_func unless method_defined?( "get_#{colorname}".to_sym )
126
+ }
127
+
128
+ def okno(bool,str=nil)
129
+ str ||= bool
130
+ bool = (bool == 0 ) if (bool.class == Fixnum) # so 0 is green, others are red :)
131
+ return bool ? green(str) : red(str)
132
+ end
133
+
134
+ def colors_flag(nation = 'it')
135
+ %w{ red white green }
136
+ end
137
+
138
+ # "\e[0;31m42\e[0m" --> "42"
139
+ # \e[38;5;28mXXXX -> "XXX"
140
+ def scolora(str)
141
+ str.to_s.
142
+ gsub(/\e\[1;33m/,''). # colori 16
143
+ gsub(/\e\[0m/,''). # colori 64k
144
+ gsub(/\e\[38;\d+;\d+m/,'') # end color
145
+ end
146
+ alias :uncolor :scolora
147
+
148
+ # italia: green white red
149
+ # ireland: green white orange
150
+ # france: green white orange
151
+ # UK: blue white red white blue
152
+ # google:
153
+ def _flag_nations
154
+ %w{ar cc it de ie fr es en goo br po pt }.sort
155
+ end
156
+ def flag(str, flag = '')
157
+ case flag.to_s
158
+ when 'ar'
159
+ return flag3(str, 'azure2', 'white', 'cyan')
160
+ when 'br','pt'
161
+ return flag3(str, 'dkgreen', 'gold', 'dkgreen')
162
+ when 'cc'
163
+ return flag3(str, 'red', 'white', 'red') # switzerland
164
+ when 'de'
165
+ return flag3(str, 'dkblack', 'red', 'gold')
166
+ when 'ie','gd','ga'
167
+ return flag3(str, 'dkgreen', 'white', 'orange')# non so la differenza, sembrano entrambi gaelici!
168
+ when 'en'
169
+ return flag3(str, 'red', 'blue', 'red') # red white blue white red white blue white ... and again
170
+ when 'es'
171
+ return flag3(str, 'yellow', 'red', 'yellow')
172
+ when 'fr'
173
+ return flag3(str, 'blue', 'white', 'red')
174
+ when 'goo','google'
175
+ return flag_n(str, %w{ blue red yellow blue green red } )
176
+ when 'it'
177
+ return flag3(str, 'dkgreen', 'white', 'red')
178
+ when 'po'
179
+ return flag2(str, 'white', 'red')
180
+ when ''
181
+ return flag3(str + " (missing flag1, try 'it')")
182
+ end
183
+ return flag3(str + " (missing flag2, try 'it')")
184
+ end
185
+
186
+ # for simmetry padding
187
+ # m = length / 3
188
+ # 6: 2 2 2 m m m REST 0
189
+ # 5: 2 1 2 m+1 m m+1 2
190
+ # 4: 1 2 1 m m+1 m 1
191
+ def flag3(str,left_color='brown',middle_color='pink',right_color='red')
192
+ m = str.length / 3
193
+ remainder = str.length % 3
194
+ central_length = remainder == 1 ? m+1 : m
195
+ lateral_length = remainder == 2 ? m+1 : m
196
+ colora( left_color, str[ 0 .. lateral_length-1] ) +
197
+ colora( middle_color, str[ lateral_length .. lateral_length+central_length-1] ) +
198
+ colora( right_color, str[ lateral_length+central_length .. str.length ] )
199
+ end
200
+ def flag2(str,left_color='brown',right_color='pink')
201
+ flag_n(str, [left_color, right_color] )
202
+ end
203
+
204
+ def flag_n(str,colors)
205
+ size = colors.size
206
+ #debug_on :flag6
207
+ ret = ""
208
+ m = str.length / size # chunk size
209
+ deb m
210
+ (0 .. size-1).each{|i|
211
+ #deb "Passo #{i}"
212
+ chunk = str[m*(i),m*(i+1)]
213
+ #deb chunk
214
+ ret += colora(colors[i], chunk )
215
+ }
216
+ #deb str.split(/....../)
217
+ #remainder = str.length % 6
218
+ #return ret + " (bacatino)"
219
+ # central_length = remainder == 1 ? m+1 : m
220
+ # lateral_length = remainder == 2 ? m+1 : m
221
+ # colora( left_color, str[ 0 .. lateral_length-1] ) +
222
+ # colora( middle_color, str[ lateral_length .. lateral_length+central_length-1] ) +
223
+ # colora( right_color, str[ lateral_length+central_length .. str.length ] )
224
+ return ret
225
+ end
226
+
227
+
228
+ ###################################################################################################################
229
+ # COLORS LIBRARY
230
+ =begin
231
+ nero) shift; echo -en "\033[0;30m$*\033[0m\n" ;;
232
+ rossone) shift; echo -en "\033[0;31m$*\033[0m\n" ;;
233
+ verdone) shift; echo -en "\033[0;32m$*\033[0m\n" ;;
234
+ marrone) shift; echo -en "\033[0;33m$*\033[0m\n" ;;
235
+ bluino) shift; echo -en "\033[0;34m$*\033[0m\n" ;;
236
+ porpora) shift; echo -en "\033[0;35m$*\033[0m\n" ;;
237
+ ciano) shift; echo -en "\033[0;36m$*\033[0m\n" ;;
238
+ grigino) shift; echo -en "\033[0;37m$*\033[0m\n" ;;
239
+
240
+ grigione) shift; echo -en "\033[1;30m$*\033[0m\n" ;;
241
+ rosso) shift; echo -en "\033[1;31m$*\033[0m\n" ;;
242
+ verde) shift; echo -en "\033[1;32m$*\033[0m\n" ;;
243
+ giallo) shift; echo -en "\033[1;33m$*\033[0m\n" ;;
244
+ blu) shift; echo -en "\033[1;34m$*\033[0m\n" ;;
245
+ viola) shift; echo -en "\033[1;35m$*\033[0m\n" ;;
246
+ azzurro) shift; echo -en "\033[1;36m$*\033[0m\n" ;;
247
+ bianco) shift; echo -en "\033[1;37m$*\033[0m\n" ;;
248
+
249
+ arancio) shift; echo -en "\033[5;31m$*\033[0m\n" ;;
250
+
251
+ colour_codes = {
252
+ 'black': '\033[0;30m',
253
+ 'red': '\033[0;31m',
254
+ 'green': '\033[0;32m',
255
+ 'yellow': '\033[0;33m',
256
+ 'blue': '\033[0;34m',
257
+ 'magenta': '\033[0;35m',
258
+ 'cyan': '\033[0;36m',
259
+ 'white': '\033[0;37m',
260
+ 'darkgray': '\033[1;30m',
261
+ 'br-red': '\033[1;31m',
262
+ 'br-green': '\033[1;32m',
263
+ 'br-yellow': '\033[1;33m',
264
+ 'br-blue': '\033[1;34m',
265
+ 'br-magenta': '\033[1;35m',
266
+ 'br-cyan': '\033[1;36m',
267
+ 'br-white': '\033[1;37m',
268
+ 'ul-black': '\033[4;30m',
269
+ 'ul-red': '\033[4;31m',
270
+ 'ul-green': '\033[4;32m',
271
+ 'ul-yellow': '\033[4;33m',
272
+ 'ul-blue': '\033[4;34m',
273
+ 'ul-magenta': '\033[4;35m',
274
+ 'ul-cyan': '\033[4;36m',
275
+ 'ul-white': '\033[4;37m',
276
+ 'default': '\033[0m'
277
+ }
278
+ =end
279
+
280
+ class RicColor < String
281
+ attr :color
282
+
283
+ def initialize(mycol)
284
+ super
285
+ @color = mycol
286
+ end
287
+
288
+ def to_s
289
+ 'RicColor: ' + self.send(@color)
290
+ end
291
+
292
+ def to_html
293
+ "<font color=\"#{@color}\" >#{self}</font>"
294
+ end
295
+ end #/Class RicColor
296
+
297
+ def terminal
298
+ ENV['TERM_PROGRAM'] || 'suppongo_ssh'
299
+ end
300
+
301
+ def daltonic_terminal?()
302
+ #deb( "Terminal is: " + terminal )
303
+ return !! terminal.to_s.match( /Apple_Terminal/ )
304
+ end
305
+
306
+
307
+ end # /module
308
+
309
+ #require 'ric'
310
+
311
+
312
+ include RicColorsObsolete
313
+ $colors_active = ! RicColor.daltonic_terminal? # DEFAULT: active