sakuric 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,52 @@
1
+ commands:
2
+ adddisk: Create a new machine disk.
3
+ addfirewall: Create a new firewall.
4
+ addimage: Create a new machine image.
5
+ addinstance: Create a new machine instance.
6
+ addnetwork: Create a new network instance.
7
+ auth: Class for forcing client authorization.
8
+ deletedisk: Delete a machine disk.
9
+ deletefirewall: Delete a firewall.
10
+ deleteimage: Delete a machine image.
11
+ deleteinstance: Delete a machine instance.
12
+ deletenetwork: Delete a machine network.
13
+ deleteoperation: Delete an operation.
14
+ getdisk: Get a machine disk.
15
+ getfirewall: Get a firewall.
16
+ getimage: Get a machine image.
17
+ getinstance: Get a machine instance.
18
+ getkernel: Get a kernel.
19
+ getmachinetype: Get a machine type.
20
+ getnetwork: Get a network instance.
21
+ getoperation: Retrieve an operation resource.
22
+ getproject: Get the resource for a Google Compute project.
23
+ getzone: Get a zone.
24
+ #help: Help for all or selected command:
25
+ listdisks: List the machine disks for a project.
26
+ listfirewalls: List the firewalls for a project.
27
+ listimages: List the machine images for a project.
28
+ listinstances: List the machine instances for a project.
29
+ listkernels: List the machine kernels for a project.
30
+ listmachinetypes: List the machine types.
31
+ listnetworks: List the machine networks for a project.
32
+ listoperations: List the operations for a project.
33
+ listzones: List available zones.
34
+ pull: Pull one or more files from an instance.
35
+ push: Push one or more files to an instance.
36
+ setcommoninstancemetadata: Set the commonInstanceMetadata field for a Google
37
+ ssh: Ssh to an instance.
38
+ version: Get the current version of this command.
39
+ other:
40
+ cache project_id: gcompute getproject --project_id=<your_project_id> --cache_flag_values
41
+ browse gcompute code project (python): @shortcutme mate ~/Dropbox/.linux/git/gcompute-1.1.pre.20120507.1654
42
+ howto install: @shortcutme open https://developers.google.com/compute/docs/gcompute_setup
43
+ jason json response: gcompute getproject --dump_request_response # or whatever
44
+ install: pip install https://dl.google.com/compute/gcutil.tar.gz
45
+ list images: gcutil listimages --project=projects/google
46
+ code snippets:
47
+ metadata: gcutil-test11 setcommoninstancemetadata --metadata foo:bar --metadata owner:riccardo --metadata data:$(data) -f --metadata perhosturl:http://www.palladius.eu/hosts/
48
+ kernels: gcutil --print_json --project=google listkernels
49
+ API info:
50
+ last version: 1.2
51
+ last release: 20120912
52
+ API version: v1beta12
@@ -0,0 +1,52 @@
1
+ commands:
2
+ adddisk: Create a new machine disk.
3
+ addfirewall: Create a new firewall.
4
+ addimage: Create a new machine image.
5
+ addinstance: Create a new machine instance.
6
+ addnetwork: Create a new network instance.
7
+ auth: Class for forcing client authorization.
8
+ deletedisk: Delete a machine disk.
9
+ deletefirewall: Delete a firewall.
10
+ deleteimage: Delete a machine image.
11
+ deleteinstance: Delete a machine instance.
12
+ deletenetwork: Delete a machine network.
13
+ deleteoperation: Delete an operation.
14
+ getdisk: Get a machine disk.
15
+ getfirewall: Get a firewall.
16
+ getimage: Get a machine image.
17
+ getinstance: Get a machine instance.
18
+ getkernel: Get a kernel.
19
+ getmachinetype: Get a machine type.
20
+ getnetwork: Get a network instance.
21
+ getoperation: Retrieve an operation resource.
22
+ getproject: Get the resource for a Google Compute project.
23
+ getzone: Get a zone.
24
+ #help: Help for all or selected command:
25
+ listdisks: List the machine disks for a project.
26
+ listfirewalls: List the firewalls for a project.
27
+ listimages: List the machine images for a project.
28
+ listinstances: List the machine instances for a project.
29
+ listkernels: List the machine kernels for a project.
30
+ listmachinetypes: List the machine types.
31
+ listnetworks: List the machine networks for a project.
32
+ listoperations: List the operations for a project.
33
+ listzones: List available zones.
34
+ pull: Pull one or more files from an instance.
35
+ push: Push one or more files to an instance.
36
+ setcommoninstancemetadata: Set the commonInstanceMetadata field for a Google
37
+ ssh: Ssh to an instance.
38
+ version: Get the current version of this command.
39
+ other:
40
+ cache project_id: gcompute getproject --project_id=<your_project_id> --cache_flag_values
41
+ browse gcompute code project (python): @shortcutme mate ~/Dropbox/.linux/git/gcompute-1.1.pre.20120507.1654
42
+ howto install: @shortcutme open https://developers.google.com/compute/docs/gcompute_setup
43
+ jason json response: gcompute getproject --dump_request_response # or whatever
44
+ install: pip install https://dl.google.com/compute/gcutil.tar.gz
45
+ list images: gcutil listimages --project=projects/google
46
+ code snippets:
47
+ metadata: gcutil-test11 setcommoninstancemetadata --metadata foo:bar --metadata owner:riccardo --metadata data:$(data) -f --metadata perhosturl:http://www.palladius.eu/hosts/
48
+ kernels: gcutil --print_json --project=google listkernels
49
+ API info:
50
+ last version: 1.2
51
+ last release: 20120912
52
+ API version: v1beta12
@@ -0,0 +1,2 @@
1
+ filters:
2
+ 'To get an OR for 3 subject in OR, choose "include the words with following"': 'subject:("AppEngine") OR subject:("App Engine") OR subject:("GAE")'
@@ -0,0 +1,81 @@
1
+ _conf:
2
+ colors:
3
+ title: white
4
+ line_key: red
5
+ line_val: lred
6
+ sort: false
7
+ mantain_crlf: true
8
+ Strings:
9
+ upper/lower case: UPCASE(), downcase, Capitalize, singularize/pluralize()
10
+ REGEX: "reads conf file, regex+memorize: subject = (/^Subject\: (.+)$/).match(email)[1]"
11
+ Arrays:
12
+ flatten: 'flattens [ [a,b],c] into [a,b,c]'
13
+ compact: removes nil (not to confuse with flatten)
14
+ include?: '%%w[ jan feb march].include?("feb") = true'
15
+ File and Directories:
16
+ glob: Dir.glob("config.?") #=> ["config.h"]
17
+ rails views:
18
+ ComboBox on model: ' collection_select("role", "user_id", User.find(:all, :order => "username") , :id, :username , :include_blank => true ) '
19
+ rails generators:
20
+ model: script/generate model user name:string hashed_password:string salt:string
21
+ scaffold: script/generate scaffold user name:string hashed_password:string salt:string
22
+ nifty auth: script/generate nifty_authentication --help (Ryan Bates awesome gem)
23
+ capistrano:
24
+ avanti: cap deploy
25
+ indietro: cap deploy:rollback
26
+ mine: cap ric (my stuff)
27
+ nullity:
28
+ 'obj.nil?': dice se é nullo
29
+ 'obj ||= "init"': per inizializzare un oggetto, se null va a INIT se no rimane se stesso...
30
+ Rake:
31
+ 'rake -T': shows all rake helps
32
+ "rake db:migrate RAILS_ENV=production": run migrations (migrate DB) in production
33
+ "rake db:migrate:all": migrates all 3 envs
34
+ "rake db:rollback": back ONE step
35
+ "rake db:migrate:redo STEP=3": rolls back 3 migrations and executes them back :)
36
+ 'rake routes': shows RESTful routes and stuff, very cool, i.e. safewatch 'rake routes|grep -i api |grep GET'
37
+ gems:
38
+ capistrano: for easy deploy
39
+ navigation_helper: Gem for navigation menu, http://github.com/rpheath/navigation_helper
40
+ problem w infinite stack: gem install roart --no-rdoc --no-ri # without documentation can work :)
41
+ watir install: "http://wiki.openqa.org/display/WTR/Install+Watir#InstallWatir-Mac"
42
+ watir on Mac:
43
+ - sudo gem update --system
44
+ - sudo gem install firewatir
45
+ - sudo gem install safariwatir"
46
+ yaml:
47
+ - require 'set'
48
+ - require 'yaml'
49
+ - "puts Set.new([1,2,3,4]).to_yaml"
50
+ - YAML.load_file('some.yml')
51
+ flow control:
52
+ switch case: |
53
+ See this:
54
+ case myvar
55
+ when 1..5
56
+ puts "Its between 1 and 5"
57
+ when 6
58
+ puts "Its 6"
59
+ when String
60
+ puts "You passed a string"
61
+ else
62
+ puts "You gave me #{a} -- I have no idea what to do with that."
63
+ end
64
+ heroku:
65
+ push/deploy: git push heroku master # push/deploy
66
+ remote rake action: "heroku rake db:migrate # executes rake remotely.."
67
+ Add to repo: "git remote add heroku git@heroku.com:APPNAME.git"
68
+ tricks n tips:
69
+ # On my Mac I have a lot of libs in 777 mode!!!
70
+ fix permissions: "find /usr/local/lib/ruby/ -type d -print0 | xargs -0 -s 1000 sudo chmod 755 "
71
+ rails server more clean: "rails server | egrep --line-buffered -v '^Rendered|Load \(' "
72
+ trace_vars: 'trace_var( :$_, proc{|v| pgray "$_ is now #{v}" }) # super cool!'
73
+ bugs yaml ruby193 in psych: require 'yaml'; YAML::ENGINE.yamler = 'syck'
74
+ Rails:
75
+ pkgs to make rails work: apt-get install libsqlite3-dev
76
+ camel: '"active_record".camelize => "ActiveRecord"'
77
+ tableize: '"RawScaledScorer".tableize => "raw_scaled_scorers"'
78
+ rvm:
79
+ _cheat: http://cheat.errtheblog.com/s/rvm/
80
+ nice commands:
81
+ - rvm use --default 1.9.3
@@ -0,0 +1,20 @@
1
+ sakura:
2
+ Synopsys: This is about my Sakura project, which is a Git repo freely available on github to
3
+ help people like you waste their time on funny scripts :) You can also create your own YAML
4
+ files if you put it in $SAKURADIR/doc/richelp/. For instance you could add your friends you
5
+ invited to a party and keep track of invitations, presences and absences and make stats over
6
+ them then.
7
+ samples:
8
+ 'ls | act': 'randomly scrambles the lines! Taken from cat/cat ;)'
9
+ 'ps | rainbow': 'colors all lines differently'
10
+ 'twice itunes -': lowers volume of iTunes... twice :)
11
+ '10 echo Bart Simpson likes it DRY': tells you this 10 times. Very sarcastic script!
12
+ 'seq 100 | 1suN 7': prints every 7th element of the list
13
+ zombies: 'prints processes that show zombies (plus funny options to kill them)'
14
+ 'find . -size +300M | xargs mvto /tmp/bigfiles/': moves big files to that directory
15
+ "alias gp='never_as_root git pull'": only if u r not root it runs!
16
+ dimmiora: Tells you the time with Riccardo voice in Italian. Brilliant!
17
+ 'echo $PATH | split': Splits path on ':'. Amazing innit?
18
+ richelp sakura: help to this one
19
+ richelp ubuntu: help on how to use Ubuntu
20
+ duplicates: finds file in the current subtree which are identical
@@ -0,0 +1,12 @@
1
+
2
+ _Common SQL: &COMMON_SQL_LABEL # dev'essere prima degli altri ma funge!
3
+ select: "SELECT * FROM clients WHERE id = 1 OR name LIKE '%riccardo%' ;"
4
+ INSERT: TODO
5
+ UPDATE: TODO
6
+ DELETE: TODO
7
+ mysql: # &MYSQL_LABEL
8
+ explain: EXPLAIN SELECT * from MYSQL_SOBENME ;
9
+ <<: *COMMON_SQL_LABEL
10
+ postgres:
11
+ <<: *COMMON_SQL_LABEL
12
+ explain: "Like MySQL but this is PostGre!"
@@ -0,0 +1,22 @@
1
+ _conf:
2
+ colors:
3
+ title: brown
4
+ line_key: orange
5
+ line_val: gold
6
+ sort: false
7
+ Packets:
8
+ list: dpkg -l
9
+ installed?: "dpkg -L request-tracker3.8"
10
+ purge: dpkg -P <packet_to_be_purged>
11
+ quale pacchetto ha questo file: dpkg -S /usr/bin/scp
12
+ distro:
13
+ get current: lsb_release -a
14
+ upgrade:
15
+ - update-manager -d (graphical)
16
+ - do-release-upgrade -d (textual)
17
+ - requires sudo apt-get install update-manager-core
18
+ Debian:
19
+ ifdownup: 'sleep 5 | ifdown eth0 && ifup eth0'
20
+ remove everything with Graphics: apt-get --purge remove liborbit2
21
+ Gnome:
22
+ Torvalds suggests this: sudo apt-get install gnome-tweak-tool
@@ -0,0 +1,39 @@
1
+ various:
2
+ Synopsis: |
3
+ This is a test YML which preserves newline as they are.
4
+ Please take a look at this link where I borrowed part fo that code:
5
+
6
+ http://en.wikipedia.org/wiki/YAML#Lists
7
+
8
+ and let me know what you think.
9
+ Riccardo
10
+ date: 2012-11-25
11
+ tables and arrays:
12
+ table cars:
13
+ - &car1
14
+ make: Audi
15
+ model: A4
16
+ descr: Carina
17
+ - &car2
18
+ make: VolksWagen
19
+ model: GTI
20
+ descr: Sobenme
21
+ - &car_hiro
22
+ make: Nissan
23
+ model: Versa
24
+ descr: Macchina di Hiro&Ando
25
+ - &car_ric
26
+ make: Mercedes Benz
27
+ model: C180
28
+ descr: Macchina di Riccardo
29
+ Family (associative array): &family_riccardo
30
+ - {name: Ric, dob: 1976}
31
+ - {&mum name: Mum, dob: 1954}
32
+ - {name: Ele, dob: 1975}
33
+ favorite_car: *car_ric
34
+ favorite_person: *mum
35
+ YAML help:
36
+ cheatsheet: http://yaml.org/refcard.html
37
+ wikipedia: http://en.wikipedia.org/wiki/YAML
38
+ ---
39
+ myObject: !myClass { name: Joe, age: 15 }
@@ -0,0 +1,39 @@
1
+ various:
2
+ Synopsis: |
3
+ This is a test YML which preserves newline as they are.
4
+ Please take a look at this link where I borrowed part fo that code:
5
+
6
+ http://en.wikipedia.org/wiki/YAML#Lists
7
+
8
+ and let me know what you think.
9
+ Riccardo
10
+ date: 2012-11-25
11
+ tables and arrays:
12
+ table cars:
13
+ - &car1
14
+ make: Audi
15
+ model: A4
16
+ descr: Carina
17
+ - &car2
18
+ make: VolksWagen
19
+ model: GTI
20
+ descr: Sobenme
21
+ - &car_hiro
22
+ make: Nissan
23
+ model: Versa
24
+ descr: Macchina di Hiro&Ando
25
+ - &car_ric
26
+ make: Mercedes Benz
27
+ model: C180
28
+ descr: Macchina di Riccardo
29
+ Family (associative array): &family_riccardo
30
+ - {name: Ric, dob: 1976}
31
+ - {&mum name: Mum, dob: 1954}
32
+ - {name: Ele, dob: 1975}
33
+ favorite_car: *car_ric
34
+ favorite_person: *mum
35
+ YAML help:
36
+ cheatsheet: http://yaml.org/refcard.html
37
+ wikipedia: http://en.wikipedia.org/wiki/YAML
38
+ ---
39
+ myObject: !myClass { name: Joe, age: 15 }
@@ -0,0 +1,36 @@
1
+ ---
2
+ hooks:
3
+ after_all:
4
+ - echo ciao
5
+ before_all:
6
+ - echo
7
+ templates: # TODO link me from programs
8
+ rtcommon: #&rtcommon
9
+ - pink "This is a common task for RT"
10
+ # This is the REAL configuration, per label.
11
+ sviluppanda: # here are the real confs!
12
+ ric:
13
+ - mate ~/svn/carlesso/.bashrc ~/svn/carlesso/.bashrc.hansel ~/svn/carlesso/.bashrc.slartibartfast.heanet.ie ~/svn/carlesso/.bashrc.`hostname` ~/svn/carlesso/.profile ~/svn/carlesso/bookmarks/ ~/svn/carlesso/.profile.`hostname` ~/svn/carlesso/.bashrc_* ~/svn/carlesso/lib/ ~/svn/carlesso/hosts/ ~/svn/carlesso/bin/ ~/svn/carlesso/doc/ ~/svn/carlesso/templates/ ~/svn/carlesso/etc/
14
+ - "iterm-session.scpt eccentrica"
15
+ riclife:
16
+ - mate ~/riclife
17
+ rt: *rtcommon
18
+ - iterma -- 'ssh lasagna tail -f /var/log/apache2/*.log'
19
+ - hwiki Ticketing Install
20
+ - open ~/Desktop/doc1.rtf
21
+ - open /Users/riccardo/Desktop/doc2.rtf
22
+ - h -m rt
23
+ - open ~/Dropbox/lavoro/
24
+ snippets:
25
+ AddressBookListPeople: echo osascript -e 'tell app "Address Book" to get the name of every person' | perl -pe 's/, /\n/g'
26
+ swdev:
27
+ - mate ~/swdev/lib/ ~/swdev/bin/
28
+ - open /Users/riccardo/Desktop/sysadmin.rtf
29
+ - "iterm-session.scpt devotchka"
30
+ - "iterm-session.scpt eccentrica"
31
+ test:
32
+ - verde ciao test devel
33
+ - ls -al
34
+ sakura:
35
+ - mate ~/git/sakura
36
+ - echo Please extend this yml in $SAKURADIR/etc/sakura/devel.yml
@@ -0,0 +1,37 @@
1
+ # sample synergy configuration file
2
+ #
3
+ # comments begin with the # character and continue to the end of
4
+ # line. comments may appear anywhere the syntax permits.
5
+
6
+ section: screens
7
+ # three hosts named: moe, larry, and curly
8
+ moe:
9
+ larry:
10
+ curly:
11
+ end
12
+
13
+ section: links
14
+ # larry is to the right of moe and curly is above moe
15
+ moe:
16
+ right = larry
17
+ up = curly
18
+
19
+ # moe is to the left of larry and curly is above larry.
20
+ # note that curly is above both moe and larry and moe
21
+ # and larry have a symmetric connection (they're in
22
+ # opposite directions of each other).
23
+ larry:
24
+ left = moe
25
+ up = curly
26
+
27
+ # larry is below curly. if you move up from moe and then
28
+ # down, you'll end up on larry.
29
+ curly:
30
+ down = larry
31
+ end
32
+
33
+ section: aliases
34
+ # curly is also known as shemp
35
+ curly:
36
+ shemp
37
+ end
Binary file
Binary file
Binary file
Binary file
Binary file
data/init.rb ADDED
@@ -0,0 +1,5 @@
1
+
2
+ # So this will also work as a plugin! See
3
+ # http://asciicasts.com/episodes/135-making-a-gem
4
+ require 'sakuric'
5
+
@@ -0,0 +1,246 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Fake array of integers
4
+ #$arr_int = [10.5, 5.4, 40.3, 58.0, 9.9, 58.0 ]
5
+
6
+ # doppioni code: http://snippets.dzone.com/posts/show/3838
7
+ module Enumerable
8
+ def dups # pulito con solo elementi ALMENO doppi.
9
+ inject({}) {|h,v| h[v]=h[v].to_i+1; h}.reject{|k,v| v==1}.keys
10
+ end
11
+ def dups_c # tutto l'arrai con doppioni e relativa cardinalita..
12
+ inject({}) {|h,v| h[v]=h[v].to_i+1; h}.reject{|k,v| v==1 }
13
+ end
14
+ def dups_indices
15
+ (0...self.size).to_a - self.uniq.map{ |x| index(x) }
16
+ end
17
+
18
+ end
19
+
20
+ ########################
21
+ # my personal Array powerup class
22
+ class Array
23
+
24
+ alias :to_s_according_to_ruby :to_s
25
+
26
+ def to_s
27
+ "[ #{join(', ').to_s} ]"
28
+ end
29
+
30
+ # naive removal of ARGV options :)
31
+ # ARGV: "-h -dn -aaa A B C" --> "A B C"
32
+ def remove_options
33
+ select{|x| ! x.match( /^-/ ) }
34
+ end
35
+
36
+ # EL should be an EXACT match, NOT a regex :(
37
+ def from(el)
38
+ return [] unless self.include?(el)
39
+ ix1 = self.index(el)
40
+ ix2 = self.length
41
+ self[ix1..ix2]
42
+ end
43
+
44
+ def to(el)
45
+ return [] unless self.include?(el)
46
+ ix2 = self.index(el)
47
+ self[0..ix2]
48
+ end
49
+
50
+ def from_to(el1,el2)
51
+ from(el1).to(el2)
52
+ end
53
+
54
+ # [1,2,3].join2('- ',"\n") => "- 1\n- 2\n- 3\n"
55
+ def join2(initial,final)
56
+ initial + self.join(final+initial) + final
57
+ end
58
+ def join3(initial="'",middle="', '",final="'")
59
+ initial.to_s + self.join(middle.to_s) + final.to_s
60
+ end
61
+
62
+ def map_to_hash
63
+ map { |e| yield e }.inject({}) { |carry, e| carry.merge! e }
64
+ end
65
+
66
+ # it would be awesome with 'method_not_existent' to mark all the plurals into a singular call of the elements :)
67
+ def names
68
+ map{|x| x.name }
69
+ end
70
+ def quote(sep=nil)
71
+ map{|x| x.quote(sep) }
72
+ end
73
+ def double_quote()
74
+ map{|x| x.quote('"') }
75
+ end
76
+ def chomp_all
77
+ map{|x| x.chomp }
78
+ end
79
+ def match(regex)
80
+ each{|x|
81
+ ret = x.match(regex)
82
+ return ret if ret
83
+ }
84
+ return nil
85
+ end
86
+ alias :matches :match
87
+
88
+ # GREP
89
+ alias :contains :include?
90
+ alias :has :include?
91
+
92
+ def head
93
+ self[0] # raise if empty
94
+ end
95
+
96
+ def tail # TBOPT
97
+ cp = Array.new(self)
98
+ cp.shift
99
+ return cp
100
+ end
101
+
102
+ # Math
103
+ def sum
104
+ ret = 0
105
+ self.each{ |el|
106
+ ret += el.to_f
107
+ }
108
+ ret
109
+ end
110
+
111
+ def average
112
+ sum / size
113
+ end
114
+ alias :avg :average
115
+
116
+ def scalar_product(arr2)
117
+ # assert size must be the same
118
+ throw "must be same size (self: #{size}) / arg: #{arr2.size})!!!" if( size != arr2.size )
119
+ ret = 0.0
120
+ for i in (0..size)
121
+ deb "DEB #{self[i]} * #{arr2[i]}"
122
+ ret += ( self[i].to_f * arr2[i].to_f)
123
+ end
124
+ ret
125
+ end
126
+ alias :mul :scalar_product
127
+
128
+ def weighted_average(weights)
129
+ scalar_product(weights) / weights.sum
130
+ end
131
+ alias :wavg :weighted_average
132
+
133
+ def prepend(str)
134
+ map{|x| str+x}
135
+ end
136
+ def append(str)
137
+ map{|x| x+str}
138
+ end
139
+ def chop_all
140
+ map{|x| x.chop }
141
+ end
142
+ def trim_all
143
+ map{|x| x.trim }
144
+ end
145
+ def quote_all
146
+ map{|x| x.quote }
147
+ end
148
+
149
+ # options:
150
+ # :first_line_as_title (make it bold)
151
+ # smart printf of an AoA like
152
+ # [[ title1, title2, title3],
153
+ # [ arg1 arg2 arg3 ]
154
+ # ....
155
+ # printf with perfect %10d length
156
+ def smart_printf(opts={})
157
+ printf_template = ''
158
+ # assret its a AoA
159
+ width=self[0].size
160
+ deb width
161
+ for k in (0 .. width-1) # { |k|
162
+ max = self.map{|line| line[k].to_s.length }.max
163
+ deb( [k, max].join(':'))
164
+ printf_template += "%-#{max}s "
165
+ end
166
+ printf_template += "\n"
167
+ deb("printf_template: #{printf_template}")
168
+ self.each{ |line|
169
+ puts( printf_template % line ) # [0], line[1]
170
+ }
171
+ end
172
+
173
+ #def prepend_all(str); map{|x| x.prepend(str) }; end
174
+
175
+ alias :trim :trim_all
176
+ # like UNIQ - C, returns uncity with cardinality into an elegant HASH :)
177
+ # sort is pointless
178
+ def uniq_c(min_cardinality = 1) # sort=false)
179
+ hash=Hash.new
180
+ self.map{|x| hash[x] = (hash[x] + 1) rescue 1 }
181
+ hash.select{|k,v| v >= min_cardinality}
182
+ end
183
+
184
+ def color(regex, opts = {} )
185
+ opts[:color] ||= :red
186
+ map{|line|
187
+ line.gsub(regex) {|match|
188
+ match.color(opts[:color])
189
+ }
190
+ } rescue map{|line| line.gsub(/(b)/,green('b')) }
191
+ end
192
+
193
+ # [1,2,3,4,5] => [1,2,3,4]
194
+ def remove_last
195
+ return self[0.. self.size-2 ]
196
+ end
197
+
198
+ def egrep_v(regex)
199
+ select{|line| ! line.match(regex) }
200
+ end
201
+ def egrep(regex)
202
+ select{|line| line.match(regex) }
203
+ end
204
+
205
+ # string must NOT contain //, i.e. 'goliardia' or "zuppa|pambagnato"
206
+ def evidenzia(string_or_array_or_regex, opts = {} )
207
+ opts[:color] ||= :yellow
208
+ color(autoregex(string_or_array_or_regex), opts)
209
+ end
210
+ # I could put it in Enumerable...
211
+
212
+ # find duplicates
213
+ # if count, does what uniq -c does (returns occurrences as well)
214
+ def duplicates(count = false)
215
+ count ? dups_c : dups
216
+ end
217
+ alias :doppioni :duplicates
218
+
219
+ # copiato da srtsolution.com/public/blog/250508
220
+ def method_missing(method_name, *args)
221
+ method_name = method_name.to_s
222
+ deb "Array.method_missing: called '#{method_name}' (class=#{method_name.class}) with args: #{ (args * ',') }"
223
+ if m = method_name.match( /^(.*)_all$/)
224
+ descr = "Calling on this array this function: " + white(" .map{|x| x.#{m[1]}(#{args.map{|x| x.to_s.quote}.join(', ')}) }")
225
+ deb descr
226
+ deb "DEB Figoso: I call #{m[1]} on the Array son, as an object, like obj.foo(args)"
227
+ return self.map{|x| x.send(m[1], *args ) }
228
+ end
229
+ if method_name =~ /^map_(.*)$/
230
+ deb "method_name matches map_SOMETHING!"
231
+ return self.map{|x| x.send($1, *args ) }
232
+ end
233
+ if method_name =~ /^(.*)s$/
234
+ pazure "Cool! Seems like you called a plural attribute over an array. It would be *SO* cool to call map.#{$1} but I dont trust myself enough, so its better that you use: #{green "map_#{$1}"}"
235
+ return super #return self.map{|x| x.send($1, *args ) }
236
+ end
237
+ return true
238
+ end
239
+
240
+ # finds index of regex, to be sure I stringify everything
241
+ def index_regex(regex)
242
+ first_element = self.map{|x| x.to_s}.grep(regex).first
243
+ return index( first_element )
244
+ end
245
+
246
+ end #/Array