sakuric 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +13 -0
- data/Gemfile +22 -0
- data/Gemfile.lock +60 -0
- data/HISTORY.yml +13 -0
- data/INSTALL +5 -0
- data/LICENSE +1 -0
- data/Makefile +19 -0
- data/Manifest +405 -0
- data/README.md +72 -0
- data/Rakefile +4 -0
- data/TODO +3 -0
- data/VERSION +1 -0
- data/bashrc +30 -0
- data/bashrc.d/00-functions.include +7 -0
- data/bashrc.d/01-sakura_checks.include +15 -0
- data/bashrc.d/02-uname.include +11 -0
- data/bashrc.d/80-ruby.include +4 -0
- data/bashrc.d/99-dirs.include +11 -0
- data/bashrc.d/aliases.include +20 -0
- data/bashrc.d/common.include +7 -0
- data/bashrc.d/local.d/README +1 -0
- data/bashrc.d/local.d/nothing.include +0 -0
- data/bashrc.d/uname.d/Darwin +6 -0
- data/bashrc.d/uname.d/Linux +0 -0
- data/bashrc.local.sample +11 -0
- data/bin/10 +7 -0
- data/bin/10times +7 -0
- data/bin/1every +22 -0
- data/bin/1everyN +22 -0
- data/bin/1suN +22 -0
- data/bin/2 +5 -0
- data/bin/act +24 -0
- data/bin/amarelo +2 -0
- data/bin/arancio +4 -0
- data/bin/arcobaleno +10 -0
- data/bin/bianco +3 -0
- data/bin/black +2 -0
- data/bin/brew-install +3 -0
- data/bin/cache +50 -0
- data/bin/cache3 +50 -0
- data/bin/cheorae +4 -0
- data/bin/colorastdouterr +37 -0
- data/bin/cp2desktop +3 -0
- data/bin/create-git-repo.sh +24 -0
- data/bin/csoe +37 -0
- data/bin/data +3 -0
- data/bin/derive +90 -0
- data/bin/dimmi +31 -0
- data/bin/dimmiora +4 -0
- data/bin/doppioni +48 -0
- data/bin/du- +9 -0
- data/bin/duplicates +48 -0
- data/bin/echodo +7 -0
- data/bin/ensure_line_present +82 -0
- data/bin/epoch2date +5 -0
- data/bin/fanout +100 -0
- data/bin/find-broken-symlink +26 -0
- data/bin/find-duplicates +48 -0
- data/bin/find-special-chars-within-filenames +12 -0
- data/bin/fix-terminal +5 -0
- data/bin/gce-create-centos-instance +5 -0
- data/bin/gce-create-custom-image +8 -0
- data/bin/gce-curl-get-instances-for-project +7 -0
- data/bin/gce-get-token +3 -0
- data/bin/gce-getproject-metadata +35 -0
- data/bin/gce-public-ip +4 -0
- data/bin/gcutil-fetch +36 -0
- data/bin/giallo +2 -0
- data/bin/git-clone-in-non-empty-dir +21 -0
- data/bin/git-ignore +3 -0
- data/bin/git-repos +98 -0
- data/bin/git-repos.py +99 -0
- data/bin/gitinfo +2 -0
- data/bin/google-spreadsheet-cat +40 -0
- data/bin/google_ips +5 -0
- data/bin/gray +3 -0
- data/bin/green +2 -0
- data/bin/grigio +3 -0
- data/bin/gsutil-debug-bucket +12 -0
- data/bin/gsutil-get-oauth2-token +4 -0
- data/bin/gugol-image +74 -0
- data/bin/hamachi-ubuntu-install +17 -0
- data/bin/head-1^-1 +5 -0
- data/bin/ifdownup +13 -0
- data/bin/immature/ok2 +25 -0
- data/bin/immature/twice-still-broken +9 -0
- data/bin/install-gic-repo +13 -0
- data/bin/install-sakura-on-debian-latest +6 -0
- data/bin/iphoto_big_files.sh +37 -0
- data/bin/itunes +140 -0
- data/bin/jason-xpath.rb +54 -0
- data/bin/jsawk +1128 -0
- data/bin/json-xpath.rb +54 -0
- data/bin/keepup +13 -0
- data/bin/lsof-top10 +3 -0
- data/bin/minicook +218 -0
- data/bin/mv2. +2 -0
- data/bin/mv2desktop +2 -0
- data/bin/mv2dropbox +2 -0
- data/bin/mv2here +2 -0
- data/bin/mvto +39 -0
- data/bin/nero +2 -0
- data/bin/never_as_root +18 -0
- data/bin/not +16 -0
- data/bin/ok +42 -0
- data/bin/orange +4 -0
- data/bin/pink +2 -0
- data/bin/polygen-dell +7 -0
- data/bin/polygen-heanet +6 -0
- data/bin/polygen-labs +4 -0
- data/bin/print_key_val +4 -0
- data/bin/rainbow +10 -0
- data/bin/recipe +19 -0
- data/bin/red +2 -0
- data/bin/remember-command +140 -0
- data/bin/remember-command.rb +140 -0
- data/bin/richelp +99 -0
- data/bin/ricorda-comando +140 -0
- data/bin/rosa +2 -0
- data/bin/rosso +2 -0
- data/bin/run-parts.sh +50 -0
- data/bin/sakura-check-version +48 -0
- data/bin/sakura-init.DRAFT +5 -0
- data/bin/sakura-version +2 -0
- data/bin/sano +5 -0
- data/bin/sbianca +3 -0
- data/bin/sblua +2 -0
- data/bin/setterm-reset +5 -0
- data/bin/sgialla +2 -0
- data/bin/sgrigia +2 -0
- data/bin/split +37 -0
- data/bin/split.rb +37 -0
- data/bin/srosa +1 -0
- data/bin/srossa +2 -0
- data/bin/strip-white-spaces +2 -0
- data/bin/stty-sane +5 -0
- data/bin/sudo^-1 +18 -0
- data/bin/sverda +6 -0
- data/bin/swift-saio-install.sh +336 -0
- data/bin/synergyc +0 -0
- data/bin/synergys +0 -0
- data/bin/syracuse.pl +29 -0
- data/bin/tail-n+2 +5 -0
- data/bin/tellme +31 -0
- data/bin/tellme-time +4 -0
- data/bin/timeout3 +91 -0
- data/bin/top5 +4 -0
- data/bin/trim +4 -0
- data/bin/trova-broken-symlink +26 -0
- data/bin/twice +5 -0
- data/bin/twice.rb +5 -0
- data/bin/ubuntu-install-hamachi64 +17 -0
- data/bin/ultimo +5 -0
- data/bin/upload.py +2380 -0
- data/bin/usleep +0 -0
- data/bin/varia +90 -0
- data/bin/verde +2 -0
- data/bin/vermelho +2 -0
- data/bin/vim-whereveritis +5 -0
- data/bin/viola +1 -0
- data/bin/virsh-list-all-vms.py +21 -0
- data/bin/virtualbox-manage +41 -0
- data/bin/weekend +12 -0
- data/bin/whattimeisit +4 -0
- data/bin/whereis-ip +5 -0
- data/bin/white +3 -0
- data/bin/whitefy +3 -0
- data/bin/yellow +2 -0
- data/bin/yellowfy +2 -0
- data/bin/zombies +25 -0
- data/docz/polygen/dell.grm +100 -0
- data/docz/polygen/frati.grm +85 -0
- data/docz/polygen/heanet.grm +54 -0
- data/docz/richelp/gcompute.yml +52 -0
- data/docz/richelp/gcutil.yml +52 -0
- data/docz/richelp/gmail.yml +2 -0
- data/docz/richelp/ruby.yml +81 -0
- data/docz/richelp/sakura.yml +20 -0
- data/docz/richelp/sql.yml +12 -0
- data/docz/richelp/ubuntu.yml +22 -0
- data/docz/richelp/yaml.yml +39 -0
- data/docz/richelp/yml.yml +39 -0
- data/etc/sakura/devel.yml +36 -0
- data/etc/synergy.conf.example +37 -0
- data/images/color-sample.png +0 -0
- data/images/google.jpg +0 -0
- data/images/icons/toilet.png +0 -0
- data/images/sakura.jpg +0 -0
- data/images/sakura2.jpg +0 -0
- data/init.rb +5 -0
- data/lib/classes/arrays.rb +246 -0
- data/lib/classes/debug_ric.rb +196 -0
- data/lib/classes/fake_data.rb +8 -0
- data/lib/classes/ric_debug.rb +0 -0
- data/lib/classes/ricconf.rb +110 -0
- data/lib/classes/richelp.rb +70 -0
- data/lib/classes/strings.rb +284 -0
- data/lib/facter/google_compute_engine.rb +10 -0
- data/lib/recipes/20120411-puppet-rump-palladius.recipe +2 -0
- data/lib/recipes/20120726-skype.ubuntu.recipe +16 -0
- data/lib/recipes/20130206-puppet3.ubuntu.recipe +32 -0
- data/lib/recipes/20130206-redis.linux.recipe +17 -0
- data/lib/recipes/20130208-vanilla.linux.recipe +37 -0
- data/lib/recipes/Makefile +4 -0
- data/lib/recipes/README.md +29 -0
- data/lib/recipes/scripts/redis.sh +14 -0
- data/lib/ric.rb +156 -0
- data/lib/ric_colors.rb +313 -0
- data/lib/ric_strings.rb +285 -0
- data/lib/sonice-players/itunes_mac.rb +43 -0
- data/lib/sonice-players/itunes_win.rb +47 -0
- data/lib/sonice-players/mpd.rb +45 -0
- data/lib/sonice-players/rhythmbox.rb +38 -0
- data/profile +1 -0
- data/sakuric.gemspec +40 -0
- data/sbin/install-sakura-on-debian +25 -0
- data/sbin/make-install.sh +10 -0
- data/sbin/mate-createsymlink +4 -0
- data/sounds/0.ogg +0 -0
- data/sounds/0.wav +0 -0
- data/sounds/01.ogg +0 -0
- data/sounds/02.ogg +0 -0
- data/sounds/03.ogg +0 -0
- data/sounds/08.ogg +0 -0
- data/sounds/09.ogg +0 -0
- data/sounds/1.ogg +0 -0
- data/sounds/1.wav +0 -0
- data/sounds/10.ogg +0 -0
- data/sounds/100.ogg +0 -0
- data/sounds/11.ogg +0 -0
- data/sounds/12.ogg +0 -0
- data/sounds/13.ogg +0 -0
- data/sounds/14.ogg +0 -0
- data/sounds/15.ogg +0 -0
- data/sounds/16.ogg +0 -0
- data/sounds/17.ogg +0 -0
- data/sounds/18.ogg +0 -0
- data/sounds/19.ogg +0 -0
- data/sounds/2.ogg +0 -0
- data/sounds/2.wav +0 -0
- data/sounds/20.ogg +0 -0
- data/sounds/21.ogg +0 -0
- data/sounds/22.ogg +0 -0
- data/sounds/23.ogg +0 -0
- data/sounds/24.ogg +0 -0
- data/sounds/26.ogg +0 -0
- data/sounds/3.ogg +0 -0
- data/sounds/3.wav +0 -0
- data/sounds/30.ogg +0 -0
- data/sounds/34.ogg +0 -0
- data/sounds/4.ogg +0 -0
- data/sounds/4.wav +0 -0
- data/sounds/40.ogg +0 -0
- data/sounds/42.ogg +0 -0
- data/sounds/45.ogg +0 -0
- data/sounds/47.ogg +0 -0
- data/sounds/5.ogg +0 -0
- data/sounds/5.wav +0 -0
- data/sounds/50.ogg +0 -0
- data/sounds/6.ogg +0 -0
- data/sounds/6.wav +0 -0
- data/sounds/60.ogg +0 -0
- data/sounds/7.ogg +0 -0
- data/sounds/7.wav +0 -0
- data/sounds/70.ogg +0 -0
- data/sounds/8.ogg +0 -0
- data/sounds/8.wav +0 -0
- data/sounds/80.ogg +0 -0
- data/sounds/9.ogg +0 -0
- data/sounds/9.wav +0 -0
- data/sounds/90.ogg +0 -0
- data/sounds/a.ogg +0 -0
- data/sounds/aaahhh.ogg +0 -0
- data/sounds/abologna.ogg +0 -0
- data/sounds/adargenta.ogg +0 -0
- data/sounds/alzatiecammina.ogg +0 -0
- data/sounds/apache.ogg +0 -0
- data/sounds/attenzione.ogg +0 -0
- data/sounds/awesome.m4a +0 -0
- data/sounds/bazinga.mp3 +0 -0
- data/sounds/bazinga.ogg +0 -0
- data/sounds/bela regaz.wav +0 -0
- data/sounds/benvenuti.wav +0 -0
- data/sounds/benvenuti2.wav +0 -0
- data/sounds/bergonz.ogg +0 -0
- data/sounds/boh.ogg +0 -0
- data/sounds/buahah.ogg +0 -0
- data/sounds/buonasera.ogg +0 -0
- data/sounds/buongiorno.ogg +0 -0
- data/sounds/burp.ogg +0 -0
- data/sounds/carlo.ogg +0 -0
- data/sounds/cena.ogg +0 -0
- data/sounds/che figata.m4a +0 -0
- data/sounds/che figlio di puttana.m4a +0 -0
- data/sounds/che.ogg +0 -0
- data/sounds/ciao.ogg +0 -0
- data/sounds/ciao.wav +0 -0
- data/sounds/da.ogg +0 -0
- data/sounds/davide.ogg +0 -0
- data/sounds/demone.ogg +0 -0
- data/sounds/dhcp.ogg +0 -0
- data/sounds/dinuovo.ogg +0 -0
- data/sounds/dns.ogg +0 -0
- data/sounds/dopo.ogg +0 -0
- data/sounds/e'.ogg +0 -0
- data/sounds/eattivo.ogg +0 -0
- data/sounds/ee.ogg +0 -0
- data/sounds/ehi.ogg +0 -0
- data/sounds/eoragiu.ogg +0 -0
- data/sounds/eorasu.ogg +0 -0
- data/sounds/eripartita.ogg +0 -0
- data/sounds/estato.ogg +0 -0
- data/sounds/estatoriavviato.ogg +0 -0
- data/sounds/fratro.ogg +0 -0
- data/sounds/frozenbubble.ogg +0 -0
- data/sounds/funziona.ogg +0 -0
- data/sounds/go raibh mile maith agaibh.m4a +0 -0
- data/sounds/grazie.ogg +0 -0
- data/sounds/h1.ogg +0 -0
- data/sounds/hainuovaposta.ogg +0 -0
- data/sounds/hogiamangiato.ogg +0 -0
- data/sounds/host.ogg +0 -0
- data/sounds/il.ogg +0 -0
- data/sounds/ilcomputer.ogg +0 -0
- data/sounds/ilnumerodaleiselezionatoe.ogg +0 -0
- data/sounds/ilprocesso.ogg +0 -0
- data/sounds/ilprogramma.ogg +0 -0
- data/sounds/ilservizio.ogg +0 -0
- data/sounds/imap.ogg +0 -0
- data/sounds/imieisuperpoterimidiconoche.ogg +0 -0
- data/sounds/infunzione.ogg +0 -0
- data/sounds/inpunto.ogg +0 -0
- data/sounds/ipmon.ogg +0 -0
- data/sounds/laconnessioneadinternet.ogg +0 -0
- data/sounds/lastampante.ogg +0 -0
- data/sounds/lazzaron.ogg +0 -0
- data/sounds/ldap.ogg +0 -0
- data/sounds/linterfaccia.ogg +0 -0
- data/sounds/lucilla.ogg +0 -0
- data/sounds/ma vaffanculo.m4a +0 -0
- data/sounds/majjal.wav +0 -0
- data/sounds/mamma.ogg +0 -0
- data/sounds/mauro.ogg +0 -0
- data/sounds/max.ogg +0 -0
- data/sounds/meerda.wav +0 -0
- data/sounds/meno.ogg +0 -0
- data/sounds/merda clo.wav +0 -0
- data/sounds/mezza.ogg +0 -0
- data/sounds/mila.ogg +0 -0
- data/sounds/mille.ogg +0 -0
- data/sounds/minuti.ogg +0 -0
- data/sounds/named.ogg +0 -0
- data/sounds/no.ogg +0 -0
- data/sounds/nohofame.ogg +0 -0
- data/sounds/nonfunziona.ogg +0 -0
- data/sounds/nonriescoatrovare.ogg +0 -0
- data/sounds/nonsarebbeoradilavorare.ogg +0 -0
- data/sounds/nonstalavorando.ogg +0 -0
- data/sounds/numero.wav +0 -0
- data/sounds/ooohhh.ogg +0 -0
- data/sounds/pinger.ogg +0 -0
- data/sounds/pocofa.ogg +0 -0
- data/sounds/pop3.ogg +0 -0
- data/sounds/porca puttana.m4a +0 -0
- data/sounds/porcapupazza.ogg +0 -0
- data/sounds/ppp.ogg +0 -0
- data/sounds/pranzo.ogg +0 -0
- data/sounds/prego.ogg +0 -0
- data/sounds/prima.ogg +0 -0
- data/sounds/qualcosamidice.ogg +0 -0
- data/sounds/raggiungibile.ogg +0 -0
- data/sounds/riccardo.ogg +0 -0
- data/sounds/salsa ridge.wav +0 -0
- data/sounds/scusa.ogg +0 -0
- data/sounds/seriously man.m4a +0 -0
- data/sounds/si.ogg +0 -0
- data/sounds/sito porno con sonoro.wav +0 -0
- data/sounds/socmel.wav +0 -0
- data/sounds/sono.ogg +0 -0
- data/sounds/sonoacasa.ogg +0 -0
- data/sounds/sonole.ogg +0 -0
- data/sounds/sputo.ogg +0 -0
- data/sounds/ssh.ogg +0 -0
- data/sounds/stagiocando.ogg +0 -0
- data/sounds/statospento.ogg +0 -0
- data/sounds/stopaiodipalle.ogg +0 -0
- data/sounds/thesedicks.wav +0 -0
- data/sounds/tornatosu.ogg +0 -0
- data/sounds/trapoco.ogg +0 -0
- data/sounds/trequarti.ogg +0 -0
- data/sounds/tutti.ogg +0 -0
- data/sounds/una.ogg +0 -0
- data/sounds/unquarto.ogg +0 -0
- data/sounds/virgola.ogg +0 -0
- data/sources/c/usleep.c +50 -0
- data/spec/my_first_spec.rb +6 -0
- data/tasks/sakuric-gem.rake +21 -0
- data/tasks/testing.rake +15 -0
- data/templates/bashrc.inject +10 -0
- data/templates/happy_christmas.ascii_art +5 -0
- data/test/roodi.sh +10 -0
- data/test/test_mini_failing.rb +3 -0
- data/test/test_mini_ok.rb +3 -0
- data/test/test_ruby_syntax.sh +12 -0
- data/third-party/jsawk/README.markdown +437 -0
- data/third-party/jsawk/jsawk +1128 -0
- metadata +835 -0
data/README.md
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
# Sakura
|
2
|
+
|
3
|
+
[![Build Status](https://secure.travis-ci.org/palladius/sakura.png)](http://travis-ci.org/palladius/sakura)
|
4
|
+
|
5
|
+
Sakura stands for Swiss Army Knife Uncanny Repository and Awesome :)
|
6
|
+
|
7
|
+
<img src='https://github.com/palladius/sakura/raw/master/images/sakura.jpg' height='200' align='right' />
|
8
|
+
|
9
|
+
It's a very nice way to color your life, I guess. It also provides a lot of tools, aliases, .. that power
|
10
|
+
your shell experience. If you're not a shell guy, you shouldn't be using it. If you are, you can have your
|
11
|
+
shell PS1 to be changed to have the Italian flag, or Irish, or Argentinian, for instance. :)
|
12
|
+
|
13
|
+
## Synopsis
|
14
|
+
|
15
|
+
This is my famous SVN which is becoming opensource!
|
16
|
+
|
17
|
+
## Install
|
18
|
+
|
19
|
+
Go to the directory where you want to 'install' this software. Then download the repo:
|
20
|
+
|
21
|
+
git clone git://github.com/palladius/sakura.git
|
22
|
+
cat sakura/templates/bashrc.inject >> ~/.bashrc
|
23
|
+
|
24
|
+
Note. Any help is appreciated to make this changeable!
|
25
|
+
|
26
|
+
## License
|
27
|
+
|
28
|
+
Everything in this repo is under the Creative Commons license, except where stated otherwise.
|
29
|
+
|
30
|
+
## Usage
|
31
|
+
|
32
|
+
<img src='https://github.com/palladius/sakura/raw/master/images/color-sample.png' height='100' align='right' />
|
33
|
+
See `doc/sakura-samples.txt` for some usage.
|
34
|
+
For instant gratification try the following:
|
35
|
+
|
36
|
+
richelp ubuntu # shows a richelp of my 'ubuntu' cheatsheet
|
37
|
+
richelp sakura synopsis # shows a richelp of my 'sakura' cheatsheet, grepping for 'synopsis'
|
38
|
+
ls | act # randomly scrambles the lines! Taken from cat/cat ;)
|
39
|
+
ps | rainbow # colors all lines differently
|
40
|
+
twice itunes - # lowers volume of iTunes... twice :)
|
41
|
+
10 echo Bart Simpson likes it DRY # tells you this 10 times. Very sarcastic script!
|
42
|
+
seq 100 | 1suN 7 # prints every 7th element of the list
|
43
|
+
zombies # prints processes that show zombies (plus funny options to kill them)
|
44
|
+
find . -size +300M | xargs mvto /tmp/bigfiles/ # moves big files to that directory
|
45
|
+
alias gp='never_as_root git pull' # only if u r not root it runs!
|
46
|
+
tellme-time # Tells you the time with Riccardo voice in Italian. Brilliant!
|
47
|
+
find-duplicates . # Tells you files with same size/MD5 in this directory
|
48
|
+
facter is_google_vm # Tells if it's a GCE Virtual Machine
|
49
|
+
|
50
|
+
## Credits
|
51
|
+
|
52
|
+
Many people contributed to it. First place goes obviously to my mum (see below).
|
53
|
+
|
54
|
+
<img src='http://www.palladius.it/palladius.jpg' height='100' align='right' />
|
55
|
+
|
56
|
+
- Riccardo Carlesso <riccardo.carlesso@gmail.com>
|
57
|
+
|
58
|
+
Borrowed code:
|
59
|
+
|
60
|
+
- Dmitry V Golovashkin <Dmitry.Golovashkin@sas.com>: `timeout3`
|
61
|
+
- William Stearns <wstearns@pobox.com>: `fanout`, GPL
|
62
|
+
- Synergy FOSS <http://synergy-foss.org/support>
|
63
|
+
- Google: `upload.py` (Apache license)
|
64
|
+
- Micha Niskin <micha@thinkminimo.com>: `jsawk`
|
65
|
+
- A. Iurlano <http://github.com/aiurlano>: `gcutil-fetch`
|
66
|
+
|
67
|
+
Thanks for who believed in me:
|
68
|
+
|
69
|
+
- Enrico "Vector field" Biondini
|
70
|
+
- Chris <a href='https://github.com/palladius/sakura/raw/master/sounds/awesome.m4a'>"awesome"</a> Glass (Notice `Awesome.m4a` sound, under Creative Commons)
|
71
|
+
- Lucilla "Mum" Gennari for love and support
|
72
|
+
- Jeffrey Silverman, my wise colleague for wise suggestions
|
data/Rakefile
ADDED
data/TODO
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.0.1
|
data/bashrc
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
VER=`cat "$SAKURADIR/VERSION"`
|
3
|
+
export SAKURA_VER=$VERSION
|
4
|
+
|
5
|
+
## enable/disable DEBUG
|
6
|
+
#export DEBUG=true
|
7
|
+
export DEBUG=false
|
8
|
+
|
9
|
+
if [ "nope$SAKURADIR" = "nope" ] ; then
|
10
|
+
echo "SAKURA> Sorry, SAKURADIR is missing. Please add to ~/.bashrc something like this:" >&2
|
11
|
+
echo " export SAKURADIR=~/path/to/your/sakura/repo/" >&2
|
12
|
+
echo "Or you might try the following: cat templates/bashrc.inject" >&2
|
13
|
+
fi
|
14
|
+
|
15
|
+
if [ ! -f $SAKURADIR/bashrc.local ] ; then
|
16
|
+
echo "File $SAKURADIR/bashrc.local not found, copying $SAKURADIR/bashrc.local. this may take a while..."
|
17
|
+
cp $SAKURADIR/bashrc.local.sample $SAKURADIR/bashrc.local
|
18
|
+
sleep 1
|
19
|
+
echo Done.
|
20
|
+
fi
|
21
|
+
|
22
|
+
|
23
|
+
# TODO change to run-all or source-all :)
|
24
|
+
for INCLUDE_FILE in $SAKURADIR/bashrc.d/*.include ; do
|
25
|
+
source "$INCLUDE_FILE"
|
26
|
+
done
|
27
|
+
#. $SAKURADIR/bashrc.d/00-functions
|
28
|
+
#. $SAKURADIR/bashrc.d/01-sakura_checks
|
29
|
+
#. $SAKURADIR/bashrc.d/all/_common
|
30
|
+
#. $SAKURADIR/bashrc.d/all/aliases
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
#deb SAKDEB sourceing $0 v$VER bashrc on Sakura
|
3
|
+
|
4
|
+
#set -x
|
5
|
+
# TODO: verify that $SAKURADIR is set otherwise exit saying:
|
6
|
+
# Sorry, inject 'bashrc.inject' THIS into .bashrc
|
7
|
+
# This should be changed by the user
|
8
|
+
export SAKURA_BASHRC_PARSED=true
|
9
|
+
|
10
|
+
if [ -f $SAKURADIR/bashrc.local ] ; then
|
11
|
+
. $SAKURADIR/bashrc.local
|
12
|
+
else
|
13
|
+
echo "Attention, bashrc.local doesnt exist. Copy it and adapt it to your situation"
|
14
|
+
echo " cp $SAKURADIR/bashrc.local.sample $SAKURADIR/bashrc.local"
|
15
|
+
fi
|
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
# Local, depends on final user...
|
3
|
+
for INCLUDE_FILE in $SAKURADIR/bashrc.d/local.d/*.include ; do
|
4
|
+
#deb "Including local file: $INCLUDE_FILE"
|
5
|
+
source "$INCLUDE_FILE"
|
6
|
+
done
|
7
|
+
|
8
|
+
# for INCLUDE_FILE in local.d/*.include ; do
|
9
|
+
# echo "SAKDEB: including local file: $INCLUDE_FILE"
|
10
|
+
# source "$INCLUDE_FILE"
|
11
|
+
# done
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
# Sakura stuff
|
4
|
+
alias 'cdsak=cd $SAKURADIR'
|
5
|
+
alias sak="giallo With sakura everything is easier and more verbose..; . $SAKURADIR/bashrc"
|
6
|
+
alias ssa="rosso SSA is sourcing sakura.. ; . $SAKURADIR/bashrc"
|
7
|
+
alias sa="rosso SA is now sourcing sakura.. ; . $SAKURADIR/bashrc"
|
8
|
+
alias sb='source ~/.bashrc'
|
9
|
+
alias sbsak='source $SAKURADIR/bashrc'
|
10
|
+
alias rh=richelp
|
11
|
+
|
12
|
+
# git
|
13
|
+
alias git-undo-last-commit='git reset --soft HEAD^'
|
14
|
+
|
15
|
+
# PS1
|
16
|
+
alias ps1_normal="export PS1='\u@\h:\w\$ '"
|
17
|
+
alias ps1_coloured="export PS1='\u@\h:\w (TODO COLORS)\$ '"
|
18
|
+
|
19
|
+
#ls
|
20
|
+
alias ll='ls -al'
|
@@ -0,0 +1 @@
|
|
1
|
+
Feel free to add here your personal .include files
|
File without changes
|
File without changes
|
data/bashrc.local.sample
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
# This should be changed by the user
|
3
|
+
|
4
|
+
export SAKURA_BASHRC_LOCAL_CONF_VER=1.0.2
|
5
|
+
|
6
|
+
# This should be in the ~/.bashrc !
|
7
|
+
#export SAKURADIR=~/path/to/your/sakura/repo/
|
8
|
+
|
9
|
+
export SAKURA_BROWSER=google-chrome
|
10
|
+
export SAKURARIC=true
|
11
|
+
export SAKURA_USER=YOUR_USERNAME
|
data/bin/10
ADDED
data/bin/10times
ADDED
data/bin/1every
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/perl -w
|
2
|
+
|
3
|
+
# IN BASH You can simply do: sed -n 2~5p : rows 2 7 12 17...
|
4
|
+
# i.e.:
|
5
|
+
# eq 1 100 | sed -n 2~5p
|
6
|
+
# But on my Mac it doesnt work!
|
7
|
+
|
8
|
+
my $DEBUG = 0;
|
9
|
+
|
10
|
+
my $n=10; # default N=10
|
11
|
+
if (defined($ARGV[0]) ) { $n=int($ARGV[0]); }
|
12
|
+
|
13
|
+
|
14
|
+
# prints one line every n (default: n=10)
|
15
|
+
my $i=0;
|
16
|
+
while (<STDIN>) {
|
17
|
+
if ($DEBUG) { print "DEB $i/$n (".($i == 0)."): $_"; }
|
18
|
+
if ($i == 0) { print; }
|
19
|
+
$i++;
|
20
|
+
if ($i == $n) { $i = 0; }
|
21
|
+
}
|
22
|
+
|
data/bin/1everyN
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/perl -w
|
2
|
+
|
3
|
+
# IN BASH You can simply do: sed -n 2~5p : rows 2 7 12 17...
|
4
|
+
# i.e.:
|
5
|
+
# eq 1 100 | sed -n 2~5p
|
6
|
+
# But on my Mac it doesnt work!
|
7
|
+
|
8
|
+
my $DEBUG = 0;
|
9
|
+
|
10
|
+
my $n=10; # default N=10
|
11
|
+
if (defined($ARGV[0]) ) { $n=int($ARGV[0]); }
|
12
|
+
|
13
|
+
|
14
|
+
# prints one line every n (default: n=10)
|
15
|
+
my $i=0;
|
16
|
+
while (<STDIN>) {
|
17
|
+
if ($DEBUG) { print "DEB $i/$n (".($i == 0)."): $_"; }
|
18
|
+
if ($i == 0) { print; }
|
19
|
+
$i++;
|
20
|
+
if ($i == $n) { $i = 0; }
|
21
|
+
}
|
22
|
+
|
data/bin/1suN
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/perl -w
|
2
|
+
|
3
|
+
# IN BASH You can simply do: sed -n 2~5p : rows 2 7 12 17...
|
4
|
+
# i.e.:
|
5
|
+
# eq 1 100 | sed -n 2~5p
|
6
|
+
# But on my Mac it doesnt work!
|
7
|
+
|
8
|
+
my $DEBUG = 0;
|
9
|
+
|
10
|
+
my $n=10; # default N=10
|
11
|
+
if (defined($ARGV[0]) ) { $n=int($ARGV[0]); }
|
12
|
+
|
13
|
+
|
14
|
+
# prints one line every n (default: n=10)
|
15
|
+
my $i=0;
|
16
|
+
while (<STDIN>) {
|
17
|
+
if ($DEBUG) { print "DEB $i/$n (".($i == 0)."): $_"; }
|
18
|
+
if ($i == 0) { print; }
|
19
|
+
$i++;
|
20
|
+
if ($i == $n) { $i = 0; }
|
21
|
+
}
|
22
|
+
|
data/bin/2
ADDED
data/bin/act
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/perl
|
2
|
+
###########
|
3
|
+
# act.pl
|
4
|
+
#########
|
5
|
+
# scrambla i contenuti di un stdin, li rimescola a caso
|
6
|
+
# fisher_yates_shuffle( \@array ) : generate a random permutation
|
7
|
+
# of @array in place
|
8
|
+
|
9
|
+
sub fisher_yates_shuffle {
|
10
|
+
my $array = shift;
|
11
|
+
my $i;
|
12
|
+
for ($i = @$array; --$i; ) {
|
13
|
+
my $j = int rand ($i+1);
|
14
|
+
next if $i == $j;
|
15
|
+
@$array[$i,$j] = @$array[$j,$i];
|
16
|
+
}
|
17
|
+
return $array;
|
18
|
+
}
|
19
|
+
|
20
|
+
my @Astdin = 0;
|
21
|
+
my $i=0;
|
22
|
+
while (<>) { $Astdin[$i++] = $_; }
|
23
|
+
fisher_yates_shuffle(\@Astdin);
|
24
|
+
print @Astdin;
|
data/bin/amarelo
ADDED
data/bin/arancio
ADDED
data/bin/arcobaleno
ADDED
data/bin/bianco
ADDED
data/bin/black
ADDED
data/bin/brew-install
ADDED
data/bin/cache
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
VER = '1.1'
|
4
|
+
|
5
|
+
require 'rubygems'
|
6
|
+
begin
|
7
|
+
require 'filecache' # gem install ruby-cache
|
8
|
+
rescue Exception => e
|
9
|
+
puts 'gem filecache requires installation, sorry'
|
10
|
+
puts 'gem filecache requires installation, sorry. trying to install myself, give me root password'
|
11
|
+
system 'sudo gem install -r filecache'
|
12
|
+
puts 'Try again now!'
|
13
|
+
exit 1
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
$time_cache_secs = 3600
|
18
|
+
$cache_dir = File.expand_path("~/.riccache")
|
19
|
+
|
20
|
+
def deb(s)
|
21
|
+
#puts "#DEB# #{s}"
|
22
|
+
end
|
23
|
+
|
24
|
+
# writes a command
|
25
|
+
def main
|
26
|
+
# create a new cache called "my-cache", rooted in /home/simon/caches
|
27
|
+
# with an expiry time of 30 seconds, and a file hierarchy three
|
28
|
+
# directories deep
|
29
|
+
cache = FileCache.new("cache3", $cache_dir, $time_cache_secs, 3)
|
30
|
+
cmd = ARGV.join(' ').to_s
|
31
|
+
cmd = 'echo give me an argment' if cmd.length < 1
|
32
|
+
|
33
|
+
# gives a list... but hey! This expires! Maybe better a normal single file serialization...
|
34
|
+
#list = cache.get('_index') || []
|
35
|
+
#list << cmd # unless cmd contains it
|
36
|
+
#deb list
|
37
|
+
#cache.set(list)
|
38
|
+
|
39
|
+
# caches the command and retrieves it
|
40
|
+
if cache.get('output' + cmd)
|
41
|
+
deb "Cache found!(for '#{cmd}')"
|
42
|
+
else
|
43
|
+
deb "Cache not found! Recalculating and setting for the future"
|
44
|
+
cache.set('output' + cmd, `#{cmd}`)
|
45
|
+
end
|
46
|
+
deb 'anyway calling the cache now'
|
47
|
+
print(cache.get('output' + cmd))
|
48
|
+
end
|
49
|
+
|
50
|
+
main
|
data/bin/cache3
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
VER = '1.1'
|
4
|
+
|
5
|
+
require 'rubygems'
|
6
|
+
begin
|
7
|
+
require 'filecache' # gem install ruby-cache
|
8
|
+
rescue Exception => e
|
9
|
+
puts 'gem filecache requires installation, sorry'
|
10
|
+
puts 'gem filecache requires installation, sorry. trying to install myself, give me root password'
|
11
|
+
system 'sudo gem install -r filecache'
|
12
|
+
puts 'Try again now!'
|
13
|
+
exit 1
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
$time_cache_secs = 3600
|
18
|
+
$cache_dir = File.expand_path("~/.riccache")
|
19
|
+
|
20
|
+
def deb(s)
|
21
|
+
#puts "#DEB# #{s}"
|
22
|
+
end
|
23
|
+
|
24
|
+
# writes a command
|
25
|
+
def main
|
26
|
+
# create a new cache called "my-cache", rooted in /home/simon/caches
|
27
|
+
# with an expiry time of 30 seconds, and a file hierarchy three
|
28
|
+
# directories deep
|
29
|
+
cache = FileCache.new("cache3", $cache_dir, $time_cache_secs, 3)
|
30
|
+
cmd = ARGV.join(' ').to_s
|
31
|
+
cmd = 'echo give me an argment' if cmd.length < 1
|
32
|
+
|
33
|
+
# gives a list... but hey! This expires! Maybe better a normal single file serialization...
|
34
|
+
#list = cache.get('_index') || []
|
35
|
+
#list << cmd # unless cmd contains it
|
36
|
+
#deb list
|
37
|
+
#cache.set(list)
|
38
|
+
|
39
|
+
# caches the command and retrieves it
|
40
|
+
if cache.get('output' + cmd)
|
41
|
+
deb "Cache found!(for '#{cmd}')"
|
42
|
+
else
|
43
|
+
deb "Cache not found! Recalculating and setting for the future"
|
44
|
+
cache.set('output' + cmd, `#{cmd}`)
|
45
|
+
end
|
46
|
+
deb 'anyway calling the cache now'
|
47
|
+
print(cache.get('output' + cmd))
|
48
|
+
end
|
49
|
+
|
50
|
+
main
|