#!/bin/bash clear -(-Vem Är du-)------------------------------------------ function findUser() { thisPID=$$ origUser=$(whoami) thisUser=$origUser while ( "$thisUser" = "$origUser" ) do ARR=($(ps h -p$thisPID -ouser,ppid;)) thisUser="${ARR(0)}" myPPid="${ARR(1)}" thisPID=$myPPid done getent passwd "$thisUser" | cut -d: -f1 } user=$(findUser) echo "logged in: $user" -----(-Vem Är du-)- # Start of adding PPA # Lägger till ppa för få ruby mysql att fungera #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= the_ppa01="deb http://host/debian distribution system develompment utilities" the_ppa02="deb-src http://host/debian distribution system develompment utilities" the_ppa03="deb http://http.us.debian.org/debian stable main contrib non-free" the_ppa04="deb-src http://http.us.debian.org/debian stable main" if ! grep -q "$the_ppa01" /etc/apt/sources.list /etc/apt/sources.list.d/-; then # commands to add the ppa ... echo "ppa not found, adding:" sudo sh -c "echo $the_ppa01 >> /etc/apt/sources.list" fi if ! grep -q "$the_ppa02" /etc/apt/sources.list /etc/apt/sources.list.d/-; then # commands to add the ppa ... echo "ppa not found, adding:" sudo sh -c "echo $the_ppa02 >> /etc/apt/sources.list" fi if ! grep -q "$the_ppa03" /etc/apt/sources.list /etc/apt/sources.list.d/-; then # commands to add the ppa ... echo "ppa not found, adding:" sudo sh -c "echo $the_ppa03 >> /etc/apt/sources.list" fi if ! grep -q "$the_ppa04" /etc/apt/sources.list /etc/apt/sources.list.d/-; then # commands to add the ppa ... echo "ppa not found, adding:" sudo sh -c "echo $the_ppa04 >> /etc/apt/sources.list" fi #(Update)--------------- sudo apt-get update #End of adding PPA #==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # RVM INSTALL (exempel 3) - Sucess! v1.26.10 latest #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= echo "installing ruby stable" curl -sSL https://get.rvm.io | bash -s stable --ruby # # If you want to maybe jump back to your system # installed Ruby which might be Ruby 1.8.6 # you can run the following command: # > rvm use system #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #==-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-= # rvm is found here! (If you Used Exempel 3) #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # /usr/local/rvm/ # # Pastebin and the other is found here! # # /usr/local/bin/ #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # - ERROR!---NOW!-ALL-SHIT!-Is-Installed-- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # rvm installed but lvm command dont work! - Error # # rvm: kommandot hittades inte # # > /usr/local/rvm/bin/rvm <-- this the file, ok! # #Dont paste the > #=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #- Lets! make a alias by hand! #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-== # # 1. make a file in your home named # .bash_aliases # # 2. add the line: # alias rvm="/usr/local/rvm/bin/rvm" # # 3. Reboot or refresh .bash_aliases # . /home/user/.bash_aliases # dit it work? # Najs!.. # # 4. not working, run in your terminal: # sudo reboot # # 5. make it to a alias to (user is your username!) # add the line: # alias updatealias=". ~/.bash_aliases" # #---------------------------------------------------------------------------- # (-WHY NOT!-)-Lets use a bash script! - #---------------------------------------------------------------------------- # To much work or to less work! We dont have t # write a little program that does write a the new # alias if it not alredy exist to the file .bash_aliases! # touch /home/$user/.bash_aliases printf "alias pastebin='/usr/local/bin/pastebin -l bash -e 10M -f '\n" >> ~/.bash_aliases printf "alias hpastebin='/usr/local/bin/pastebin -l bash -f '\n" >> ~/.bash_aliases printf "alias rvm='/usr/local/rvm/bin/rvm'\n" >> ~/.bash_aliases . ~/.bash_aliases #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #- Pastebin - - (exempel) #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #pastebin -f /home/username/Dokument/file.sh -l bash -e 10M # # remove -e 10M if you dont want your file to expire #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-" #------------------------------------------------------------------------------- #- better to install ruby 2.0 use not this (If you are smart READ @ end first.- #- use exempel 3 not this crap! ) <--- tHIS did not work 4 me- #------------------------------------------------------------------------------- #sudo apt-get -y update #sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev #cd /tmp #wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p481.tar.gz #tar -xvzf ruby-2.0.0-p481.tar.gz #cd ruby-2.0.0-p481/ #./configure --prefix=/usr/local #make #sudo make install #--------------- #- curl is needed - #------------------ #bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #- Other way to install ruby that i found / BUT! use exemepel 3 i always do. (Exempel 2) - #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # :> sudo gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 # \curl -sSL https://get.rvm.io | bash -s stable # # Dont paste the > #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= echo "hi $user" #some deb files apt-get install mysql-client mysql-server libmysql-ruby client-dev git curl automake libxml2-dev libxslt-dev autoconf openssl libreadline6 zlib1g subversion -y apt-get install libsqlite3-0 libsqlite3-dev sqlite3 libc6-dev ncurses-dev libtool bison build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev -y apt-get install debhelper fakeroot ruby-dev #Install RVM with Ruby and Ruby on Rails with all required libraries: echo "installing ruby stable" curl -sSL https://get.rvm.io | bash -s stable --ruby #installing rails echo "intalling rails" \curl -L https://get.rvm.io | bash -s stable --rails #activate auto deps 4 rvm echo "activate auto depends 4 rvm" sudo /usr/local/rvm/bin/rvm autolibs packages sudo /usr/local/rvm/bin/rvm autolibs homebrew #install head rvm install 2.0.0 rvm | head -1 rvm list known ruby -v rvm use --default 2.0.0 rvm 2.0.0 do gem install mysql gem install rdoc-data; rdoc-data --install gem install curl bundler mustache rdiscount ronn rspec builder git github_api highline nokogiri rake rdoc jeweler pastebin hpricot gem install rake-debian-build buildrdeb pry-debundle pry codebutler coderay sinatra rubygems-update rails bundler gem install debsfromrepos cucumber rapec make-rubygem-debs fpm gem2deb ruby-debiandebianize json rest-client slop debstep DebianPackageDownloader hoe gem install deb-fog fog thor dpkg-deb debugher addressable robots debot capistrano capistrano-ext quick-debug cache_debugging rails sqlite3 adressable gem install albanpeignier-rake-debian-build ruby-deb ar deb_control debeasy libarchive ruby-filemagic deblank gem install rubygems-mygems rubygems_dump rubygems-localproxy rubygems-deep_fetch rubygems_snapshot rubygems-bundler tf bundler-unload executable-hooks gem install rubygems-code_finder faraday multi_json octokitbundler webmock octokit sawyer ctags-bundler mpapis-bundler assetbundler asset_bundler gem install onpack actionview activejob activemodel activesupport ammeter appraisal arel arr-pm aruba asciidoctor asset_timestamps_cache atomic gem install awesome_print backports bcat bluecloth permutation sdoc echoe bones bones-rcov rcov spoon hoe-debugging hoe-gemspec http-cookie gem install net-http-digest_auth cabin capistrano-stats capybara CFPropertyList childprocess clamp closure-compiler gem install code_statistics coffee-script coffee-script-source colorize contest coveralls crack creole curb delorean descendants_tracker diff-lcs gem install docile docker-api eco ejs em-http-request erubis eventmachine excon execjs fakefs ffi fission flexmock fog-atmos fog-aws fog-brightbox gem install fog-core fog-ecloud fog-json fog-profitbricks fog-radosgw fog-riakcs fog-sakuracloud fog-serverlove fog-softlayer gem install fog-storm_on_demand fog-terremark fog-vmfusion gem install fog-voxel fog-xml formatador gems gherkin github-markup globalid google-api-client gpg_status_parser guard-rspec haml hashie hike hoe-bundler hoe-doofus gem install hoe-gemspec2 hoe-git hoe-rubygems hoe-seattlerb hoe-travis http httparty httpclient i18n inflecto insist ipaddress kpeg kramdown launchy less gem install libnotify liquid loofah mail markaby maruku mechanize midiator mime-types minitest minitest-stub-const mocha multipart-post multi_test multi_xml gem install net-http-persistent ntlm-http webrobots bacon Platform benchmark-ips mini_portile racc rexical jwt method_source actionmailer gem install activerecord netrc net-scp net-ssh oauth2 open4 opennebula osrcry patron pry-doc rack rack-protection rack-test radius gem install rails-deprecated_sanitizer rails-dom-testing rails-html-sanitizer railties sprockets-rails rake-compiler ramaze rb-inotify rbovirt rbvmomi gem install redcarpet RedCloth ritual rr rspec-core rspec-expectations rspec-its rspec-mocks rspec-rails rspec-support gem install rubocop ruby-beautify rubyforge rubygems-tasks rubyzip safe_yaml sass session shindo shoulda simplecov spork sprockets sshkit stud gem install syntax test-unit therubyracer thoughtbot-shoulda thread_safe tilt turn typhoeus tzinfo uglifier unf unf_ext unidecoder unindent vcr webrat gem install wikicloth yajl-ruby yard yui-compressor ZenTest oauth_bundle neobundle auto_build ro-bundle matebundle gem install rubygems-sandbox make deb gemcutter rubygems-pwn rubygems-sing gem_plugin rubygems-source rubygems-update update_rubygems nokogiri gem install rubygems-bundler rubygems-crawler glaze-analyzer query-analyzer pg_query_analyzer gem install rake hoe actionpack actionview activejob mail rails-dom-testing activemodel gem install activesupport rack rack-test rails-html-sanitizer builder erubis globalid arel gem install i18n json minitest thread_safe tzinfo launchy rspec rspec-its ansi detroit qed gem install ae ergo indexer lemon mast bundler thor rdoc cabin bcat childprocess cucumber gem install cucumber-pro fuubar kramdown rspec-expectations rubocop coderay haml nokogiri gem install slim tilt yard yard-tomdoc asset_timestamps_cache thoughtbot-shoulda bacon gem install bacon-colored_output coveralls json_pure mime-types simplecov guard-rspec gem install guard-rubocop parser ruby_gntp addressable extlib multi_json appraisal fakefs gem install sqlite3 little-plugger loquacious rubytest mustache rdiscount ronn amq-protocol gem install rails parallel rspec-fire capistrano-stats mocha sshkit capistrano ffi gem install test-construct sinatra coffee-script-source execjs rest-client term-ansicolor gem install vcr webmock safe_yaml aruba capybara diff-lcs gherkin multi_test ramaze rubyzip gem install spork syntax test-unit webrat awesome_print unidecoder docile rspec-rails fog gem install slop capistrano-ext robots chronic hoe-bundler hoe-doofus hoe-gemspec2 hoe-git gem install hoe-rubygems hoe-travis rubyforge github-markup redcarpet archive-tar-minitar gem install cane excon pry shoulda unf allison notify delorean eventmachine open4 shindo gem install minitest-rg multipart-post CFPropertyList docker-api fission fog-atmos fog-aws gem install fog-brightbox fog-core fog-ecloud fog-json fog-profitbricks fog-radosgw gem install fog-riakcs fog-sakuracloud fog-serverlove fog-softlayer fog-storm_on_demand gem install fog-terremark fog-vmfusion fog-voxel fog-xml google-api-client ipaddress gem install opennebula rbovirt rbvmomi turn inflecto formatador minitest-stub-const net-scp gem install net-ssh osrcry http-form_data arr-pm backports clamp insist stud mechanize gem install ruby-progressbar ritual rr html-pipeline nokogiri-diff sanitize gem install descendants_tracker faraday hashie oauth2 autoparse retriable signet rbench gem install test_declarative code_statistics hoe-gemspec hoe-seattlerb travis-lint gem install domain_name multi_xml bluecloth git github_api highline permutation sdoc echoe gem install itextomml prawn ritex rouge stringex bones bones-rcov rcov spoon reap commonjs gem install rake-compiler rspec-spies vulcan codeclimate-test-reporter colorize gem install hoe-debugging fpm http-cookie net-http-digest_auth net-http-persistent gem install ntlm-http webrobots Platform introspection metaclass benchmark-ips nenv gem install shellany jwt sawyer ast cliver gauntlet racc simplecov-sublime-ruby-coverage gem install jeweler method_source latest_ruby brass rulebow bunny logification actionmailer gem install activerecord railties sprockets-rails rails-deprecated_sanitizer loofah gem install Remarkably dalli erector ezamar innate liquid locale localmemcache lokar maruku gem install nagoro rack-contrib redis sass sequel slippers tagz tenjin yui-compressor gem install ZenTest kpeg netrc pry-doc hpricot rspec-core rspec-mocks flexmock gem install rspec-support ammeter astrolabe powerpack rainbow ar rspectacular timecop gem install warning_filter bundler-unload executable-hooks tf octokit httparty gems gem install gpg_status_parser midiator libnotify rb-inotify guard guard-minitest gem install shoulda-context shoulda-matchers simplecov-html sprockets rack-protection gem install temple closure-compiler coffee-script eco ejs hike uglifier unindent gem_hadar gem install tins jeremymcanally-pending packnga power_assert session atomic RedCloth gem install asciidoctor contest creole less markaby radius wikicloth yajl-ruby citron hashr gem install unf_ext nanotest crack curb em-http-request http httpclient patron typhoeus # gem plugins installer gem install executable-hooks gem-browse gem-ctags gem-empty gem_info gem-init gem-compare gem-man gem install gem-nice-install gem-orphan gem-patch gem-toolbox gem-wrappers graph maven_gem open-gem PushSafety gem install rbenv-rehash rubygems-desc rubygems-openpgp rubygems-sandbox rubygems_snapshot rubygems-tasks gem install wrapper wrapped qwrapper rapper rafters echo "Saved dependency needed in home dir" gem dependency > /home/hynt/dependsgem.txt #update gem update --system update_rubygems gem tumble gem update rvm install ruby-head-2.0.0 --url https://github.com/github/ruby.git --branch 2.1 #rvm install ruby-head-2.2.0 --url https://github.com/github/ruby.git --branch 2.1 #--------------------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------------------- #-Plugins Man--------------------------------------------------------------------------------------------------------------- # executable-hooks # https://github.com/mpapis/executable-hooks # Extends rubygems to support executables plugins. # In gem lib dir create rubygems_executable_plugin.rb: # Gem.execute do |original_file| # warn("Executing: #{original_file}") # end #--------------------------------------------------------------------------------------------------------------- # gem-browse # https://github.com/tpope/gem-browse # Adds four commands: # gem edit opens a gem in your editor # gem open opens a gem by name in your editor # gem clone clones a gem from GitHub # gem browse opens a gem’s homepage in your browser #--------------------------------------------------------------------------------------------------------------- # gem-empty # https://github.com/rvm/gem-empty # Adds command gem empty to remove all gems from current GEM_HOME. #--------------------------------------------------------------------------------------------------------------- # gem-ctags # https://github.com/tpope/gem-ctags # Adds a gem ctags command to invoke the Exuberant Ctags indexer on already-installed gems, and then automatically invokes it on gems as they are installed. #--------------------------------------------------------------------------------------------------------------- # gem_info # https://github.com/oggy/gem_info # Adds a gem info command with fuzzy matching on name and version. Designed for scripting use. #--------------------------------------------------------------------------------------------------------------- # gem-init # https://github.com/mwhuss/gem-init # Adds gem init to create a barebones gem. #--------------------------------------------------------------------------------------------------------------- # gem-compare # https://github.com/strzibny/gem-compare # Adds gem compare command that can help you to track upstream changes in the released .gem files by comparing gemspec values, gemspec and Gemfile dependencies and # # files. #--------------------------------------------------------------------------------------------------------------- # gem-man # https://github.com/defunkt/gem-ma # The gem man command lets you view a gem’s man page. #--------------------------------------------------------------------------------------------------------------- # gem-nice-install # https://github.com/voxik/gem-nice-install # Tries to install system dependencies needed to install your gems with binary extensions using standard gem install command. # This currently works only for Fedora, but # hopefully will be extended. #--------------------------------------------------------------------------------------------------------------- # gem-orphan # https://github.com/sakuro/gem-orphan # Adds a gem orphan command that finds and lists gems on which no other gems are depending. #--------------------------------------------------------------------------------------------------------------- # gem-patch # https://github.com/strzibny/gem-patch # Adds gem patch command, which enables you to apply patches directly on .gem files. Supports both RubyGems 1.8 and RubyGems 2.0. #--------------------------------------------------------------------------------------------------------------- # gem-toolbox # https://github.com/gudleik/gem-toolbox # Adds six commands: # gem open - opens a gem in your default editor # gem cd - changes your working directory to the gem’s source root # gem readme - locates and displays a gem’s readme file # gem history - locates and display’s a gem’s changelog # gem doc - Browse a gem’s documentation in your default browser # gem visit - Open a gem’s homepage in your default browser #--------------------------------------------------------------------------------------------------------------- # gem-wrappers # https://github.com/rvm/gem-wrappers # Create gem wrappers for easy use of gems in cron and other system locations. # By default wrappers are installed when a gem is installed. # Adds this commands: # gem wrappers regenerate - force rebuilding wrappers for all gem executables # gem wrappers - show current configuration #--------------------------------------------------------------------------------------------------------------- # graph # https://github.com/seattlerb/graph # Adds a gem graph command to output a gem dependency graph in graphviz’s dot format. #--------------------------------------------------------------------------------------------------------------- # maven_gem # https://github.com/jruby/maven_gem # Adds gem maven to install any Maven-published Java library as though it were a gem. #--------------------------------------------------------------------------------------------------------------- # open_gem # https://github.com/adamsanderson/open_gem # Adds two commands: # gem open opens a gem in your default editor # gem read opens a gem’s rdoc in your default browser #--------------------------------------------------------------------------------------------------------------- # PushSafety # https://github.com/jdleesmiller/push_safety # Applies a whitelist to gem push to prevent accidentally pushing private gems to the public RubyGems repository. #--------------------------------------------------------------------------------------------------------------- # rbenv-rehash # https://github.com/scoz/rbenv-rehash # Automatically runs rbenv rehash after installing or uninstalling gems. #--------------------------------------------------------------------------------------------------------------- # rubygems-desc # https://github.com/chad/rubygems-desc # Adds gem desc to describe a gem by name. #--------------------------------------------------------------------------------------------------------------- # rubygems-openpgp # https://github.com/grant-olson/rubygems-openpgp # Adds commands and flags to allow OpenPGP signing of gems. # gem sign foo.gem to sign a gem. # gem verify foo.gem --trust to verify a gem. # gem build foo.gemspec --sign to sign at build time. # gem install foo --verify --trust to verify on install. #--------------------------------------------------------------------------------------------------------------- # rubygems-sandbox # https://github.com/seattlerb/rubygems-sandbox # Manages command-line gem tools and dependencies with a gem sandbox command. # This lets you install things like flay and rdoc outside of the global rubygems repository. #--------------------------------------------------------------------------------------------------------------- # rubygems_snapshot # https://github.com/rogerleite/rubygems_snapshot # Adds gem snapshot to create exports of all your current gems into a single file that you can import later. #--------------------------------------------------------------------------------------------------------------- # rubygems-tasks # https://github.com/postmodern/rubygems-tasks # rubygems-tasks provides agnostic and unobtrusive Rake tasks for building, installing and releasing Ruby Gems. #--------------------------------------------------------------------------------------------------------------- #repair rvm repair environments rvm repair symlinks rvm repair archives rvm repair all #offline installer gem files gem install -i /home/hynt/tmp/ cucumber -v 0.10.7 gem install -f --local /home/hynt/tmp/*.gem # Temp - Not get tested.......................................... #Specify your dependencies in a Gemfile in your project's root: #source 'https://rubygems.org' #gem 'nokogiri' #gem 'rack', '~>1.1' #gem 'rspec', :require => 'spec' #bundle install #git add Gemfile Gemfile.lock #require 'rubygems' #require 'bundler/setup' #require 'nokogiri' #bundle exec rspec spec/models #However, this is unreliable and is the source of considerable pain. Even if it looks like it works, it may not work in the future or on another machine. #Finally, if you want a way to get a shortcut to gems in your bundle: #bundle install --binstubs #bin/rspec spec/model