onsdag 25 mars 2015

Debian Wheezy - Spotify

Spotify for Linux

This is a preview build of Spotify for Linux. As a preview release this version is still unsupported, but we're running it ourselves and will try to make sure it keeps pace with its Mac and Windows siblings.
So how do you get it? We've packaged it for Debian Squeeze/Ubuntu.


# 1. Add this line to your list of repositories by
#    editing your /etc/apt/sources.list
deb http://repository.spotify.com stable non-free

# 2. If you want to verify the downloaded packages,
#    you will need to add our public key
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 94558F59

# 3. Run apt-get update
sudo apt-get update

# 4. Install spotify!
sudo apt-get install spotify-client 
As of this writing the current release of Spotify for Linux is built for Debian Squeeze/Ubuntu. That package is dependant on the libssl0.9.8 while Debian Wheezy has the newer libssl1.0.0 installed. The easy way to fix this would be to install libssl0.9.8 system wide from the Squeeze repository, however I don't like the idea of installing an older package system wide just because Spotify is slow on updating their package for Wheezy. This guide will show you how I worked around this issue, adding libssl0.9.8 only for spotify.
First try to install Spotify using the guide on the Spotify homepage
When running the command:
sudo apt-get install spotify-client
It will complain about libssl0.9.8 not being installed. In order to install the client we need to ignore the dependency, first download the deb file:
apt-get download spotify-client
Then install some more dependencies and the deb file while ignoring libssl0.9.8:
sudo apt-get install libqt4-dbus libqt4-network libnspr4-0d
sudo dpkg --ignore-depends=libssl0.9.8 -i spotify-client_0.9.1.55.gbdd3b79.203-1_amd64.deb
Since we ignore a dependency to install Spotify we need to edit the file /var/lib/dpkg/status in order to be able to install new packages with apt-get, or else apt-get will complain that the dependency is not installed and that you should perform an apt-get -f install, which would remove Spotify since the dependency is not available in the Wheezy repository.
Open the file /var/lib/dpkg/status and search for spotify-client, under spotify-client find the depends: line and remove the libssl0.9.8 dependency.
So now we need to download libssl0.9.8 from the Debian package website
Since I don't want to install the package system wide I only want to extract the files from the package and move them to a suitable path using this command:
dpkg -x libssl0.9.8_0.9.8o-4squeeze14_amd64.deb /tmp/libssl0.9.8
sudo mv /tmp/libssl0.9.8/usr/lib /usr/share/spotify/libssl0.9.8
Then in order to start Spotify we need to tell Spotify where to look for the libssl0.9.8 library, this can be done with the LD_LIBRARY_PATH variable:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/share/spotify/libssl0.9.8 spotify
You can add the above command to a script in order to start Spotify easier:

# Add libssl0.9.8 path
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/share/spotify/libssl0.9.8 spotify $1
I call the script spotify-starter and place the script in /usr/local/bin.
Remember to add execution permissions to the spotify-starter script
sudo chmod +x spotify-starter
Then I edit the Spotify desktop file /usr/share/applications/spotify.desktop and change Exec and TryExec to the following:
Exec=spotify-starter %U
Now you should be able to start Spotify either using the desktop shortcut or by running the spotify-starter script.

linux - package fresh-install

Package: fresh-install
Version: 6.0~6
Architecture: all
Maintainer: Rafael Senties Martinelli <rsm@imap.cc>
Depends: gksu, aptitude, python2.7, python-psutil, python-numpy, python-vte, exo-utils, apt, gir1.2-vte-2.90, libgtk-3-0
Installed-Size: 463
Section: utils
Priority: optional
Homepage: rsm.imap.cc/software/fresh-install.html
Description: Create a custom backup of the system and be able to make an easy set up in other computers.
 This program has been created to make a good system configuration backup and to be able to set it in a new system fast and easy. It is very useful for a computers  fresh  install, because with it you can select all the software, files  and  folders  that  you would like to install and replace them in a fresh install by just pushing a button.
 It is more  effective  than making a copy of the whole system and replacing it. Replacing the whole system doesn't work good if you change your computer. It may also bring bugs, and undesired files to the new system.
 With this program you have full control of your backup.

4shared download link

Bye! Bye! MINT... Welcome Debian---- Hello World!

Installerat Debian Wheezy net mini typ 200mb iso på en skiva och börjat bygga Slut på MINT för min del....... gör så du får KDE istället Stöd för add-ppa och riktiga firefox samt lite program Min Sources.list så här i början kul och gå tilbaka och se hur systemet växt hynten@speed-mailer.com

måndag 23 mars 2015

linux - packages commands

The original script will miss out packages with long names
such as "openoffice.org-hyphenation-en-us". A better way to
get the complete list of manually-installed packages using only aptitude is:


#Long version of list installed not automatic

aptitude search "?installed ?not(?automatic)"  ;--display-format "%p"
" > apitiude-long-installed-not-automatic.txt

#Short version of list installed not automatic
aptitude search "?installed ?not(?automatic)" --display-format "%p" > apitiude-installed-not-automatic.txt

#Output wajing commands to textfile
wajig list-commands > wajig-commands.txt

This following line dont work  

sudo aptitude markauto $(apt-cache showsrc PACKAGE | grep Build-Depends | perl -p -e 's/(?:[\[(].+?[\])]|Build-Depends:|,|\|)//g')
apt-get --print-uris --yes install vlc | grep ^\’ | cut -d\’ -f2>>offline.txt

aptitude keep-all && aptitude update && aptitude upgrade

linux - create .deb to install script create .deb with dependencies, package repository


linux - File Commands System Commands File - Cheatsheet


måndag 16 mars 2015

Linux - Ascii Table Unicode PDF Download Box Exemple Bash

Miobil - APN-inställningar Massa Olika Operatörer Sverige

För att du ska kunna använda datatrafik över mobilnätet (2G, 3G och 4G) samt att skicka MMS behöver du lägga till APN inställningar. Här kommer APN-inställningar för olika Svenska operatörer som man kan behöva ställa in manuellt, t.ex. om man importerar telefonen. Mer information finns på Swedroid's forum.

söndag 15 mars 2015

Linux - Youtube2mp3 - Front - Kde ........... .desktop open bash sh file Mint kde 17.1

http://pastebin.com/Him2rAFf http://pastebin.com/QgD7tuTP http://pastebin.com/DhCFPQGe

Linux - Youtube-dl error - new version fix the problem WARNING: Automatic signature extraction failed: Traceback (most recent call last):

WARNING: Warning: Falling back to static signature algorithm
WARNING: Automatic signature extraction failed: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 957, in _decrypt_signature
    video_id, player_url, len(s)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 331, in _extract_signature_function
    player_type = id_m.group('ext')
AttributeError: 'NoneType' object has no attribute 'group'

WARNING: Warning: Falling back to static signature algorithm
ERROR: unable to download video data: HTTP Error 403: Forbidden
Philipp Hagemeister
Please run youtube-dl --version to make sure you are using a halfway up-to-date version of youtube-dl. Since web services are often changing, we recommend the newest version (2014.09.14.3 as of writing), but you'll need at least 2014.05.25 for some YouTube videos, since YouTube changed their API on June 25th, 2014. It looks like you used a package manager such as apt-get to install youtube-dl. Please contact the Linux Mint support and request a not-totally-outdated version of the youtube-dl package. (Sorry, since we are not affilliated with Linux Mint, we cannot change what they are distributing)
Alternatively, uninstall the youtube-dl package and follow our manual installation instructions. In a pinch, this should do if you used apt-get before to install youtube-dl:
sudo apt-get remove -y youtube-dl
sudo wget https://yt-dl.org/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+x /usr/local/bin/youtube-dl
hash -r
Philipp Hagemeister phihag closed this
Patrick Murray
Awesome! Turns out apt-get installed version 2014.02.17. Your solution fixed everything!

fredag 13 mars 2015

Linux - Build deb ffrom source and unpack deb files

#to use apt-get source we need add this to sources.list
sudo gedit /etc/apt/sources.list

deb http://packages.linuxmint.com/ maya main upstream import universe
deb-src http://packages.linuxmint.com/ maya main upstream import universe #Added by software-properties
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ precise partner
deb-src http://archive.canonical.com/ubuntu/ precise partner
deb http://packages.medibuntu.org/ precise free non-free
deb http://archive.getdeb.net/ubuntu precise-getdeb apps
deb http://archive.getdeb.net/ubuntu precise-getdeb games
deb http://liveusb.info/multisystem/depot all main

sudo apt-get install checkinstall autoconf

#build pidgin
sudo apt-get build-dep pidgin
sudo apt-get -b source pidgin
sudo autoconf && ./configure && make && make install && checkinstall

#build ruby2.0
sudo apt-get build-dep ruby2.0
sudo apt-get -b source ruby2.0
sudo autoconf && ./configure && make && make install && checkinstall

#build gem
sudo apt-get build-dep gem
sudo apt-get -b source gem
sudo autoconf && ./configure && make && make install && checkinstall

sudo dpkg --unpack program.deb
sudo tar -zxvf data.tar.gz

dpkg -x package.deb ./deb/

Linux - Building .deb Packages from Source in Ubuntu (or Debian)

Written by in Guides

WP Greet Box icon
Hello there! If you are new here, you might want to subscribe to the RSS feed for updates on this topic.
Sometimes, we need to build a package from source. For performance reasons (architecture-specific optimizations), memory reasons (removing features we don’t need), or just for kicks. In Ubuntu (or any other Debian derivative, for that matter), this can often pose a problem, as such hand-built packages are no longer managed by our Package Manager. Removal is rarely clean, and updates are no longer tracked.
At least two solutions exist, each suited to a different purpose.

linux own zerobin server


Linux - Own pastebin server Hastebin-server

i'm trying to setup a hastebin-server
i get back to you all if it works!


have build and works great but where the fuck is all post
*.hs cant find anybody know email me hynt@speed-mailer.com
this is my config

tisdag 10 mars 2015

Linux - Bash Random number generator

RANDOM=`date '+%s'`
MY_RANDOM="$RANDOM % 60) + 1]"



Linux - Bash Litet Backup Script jag jobbat på under natten

ett litet script som kopierar en kopia av /etc/apt/ tillbaka till /etc/apt/
eller skapar en kopia av /etc/apt/ antligen som .tgz eller som i befitligt skick
perfekt då man ska installera om datorn och vill ha sina gammla ppa tillbaka
spara som .install.sh


KALLA="$(realpath $(dirname $0))"
RANDOM=`date '+%s'`
MY_RANDOM="$RANDOM % 60) + 1]"

echo "Script som återställer backup ifrån $MAL"
echo "$KALLA tillbaka till $MAL"
echo "tänk på att $MAL kommer raderas!!!!!"
echo "Skoja! klart jag gjort en backup på nuvarande varje gång du kör scriptet
echo "om du vill skapa en backup så går det som packad version eller som opackad version"
echo "gjort en  kopia av $MAL till osynlig fil"
echo "som du hittar i $KALLA skriv ls -a för visa alla filer..."
echo ""
echo "sudo sh .install.sh replace             Erstätter $MAL med filerna ifrån $KALLA"
echo "sudo sh .install.sh backup              packar ner $MAL till $KALLA i osynlif tar fil ."
echo "sudo sh .install.sh all                 Kör alla alternativen..."
echo "sudo sh .instal.sh backup_to_here       Tarbort $KALLA och ersätter med $MAL <-- are YOU SURE!!!"
echo "sudo sh .install.sh felsokning          Visar lite information som kan användas vid felsöknings syfte"
echo ""
echo"(c) hynt@speed-mailer.com   free to use and modify" 
return $TRUE
return $TRUE
echo felsökning!
echo $KALLA
echo $MAL
echo $MY_DATE
return $TRUE
sudo tar cfvz .$MY_RANDOM.tgz --exclude="install.sh" apt.conf.d preferences.d sources.list.d trusted.gpg.d *.*
return $TRUE
cd $MAL && rm -R  *.*
cd $KALLA && cp *.* $MAL
cd $KALLA && cp -r *.d $MAL
cd $MAL && rm install.sh && rm *.tgz
return $TRUE

cd $KALLA && cp .install.sh $MAL
cd $KALLA && rm -r  *.* && rm -r *.d && rm *.*
cd $MAL && cp *.* $KALLA
cd $MAL && cp -avr *.d $KALLA
echo "Grattis! nu är $MAL alla filer i $KALLA men dom osynliga .filerna ifrån tidigare är kvar"
return $TRUE
# -Case start
# if no command line arg given
# set val to Unknown
if [ -z $1 ]
  val="*** Unknown  ***"
elif [ -n $1 ]
# otherwise make first arg as val
# use case statement to make decision for rental
case $val in
   "replace") replace_MAL ;;
   "backup_to_tar") backup_MAL ;;
   "all") all ;;
   "backup_to_here") backup_to_here ;;
   "help") start_help ;;
   "felsokning") felsokning ;;
   *) echo "Sorry, I can not get a $val for you use install.sh help!";;
# Case stop

Linux - Bash Random number generator

RANDOM=`date '+%s'`
MY_RANDOM="$RANDOM % 60) + 1]"


Linux - Youtube 2 Mp3 i terminalen

behöver du en youtube 2 mp3har kirrat ett litet script som gör den direkt till mp3 i terminalen http://paste.linuxmint.com/view/ypgb/skapa en fil på srivbordet döp den till ex. youtube2mp3.sh högerklicka på den klicka i så den får körasMeddelandet kunde inte skickas. Klicka för att skicka igen.sedan kör du den i terminalen sudo sh youtube2mp3.sh

linux - undo apt-get-build-dep

När du vill kompilera något från källa i Ubuntu / Debian, det enklaste sättet att installera beroenden som krävs för att sammanställa det är att köra (sudo) "apt-get build-dep PACKAGE_NAME". Men det finns ingen inbyggd kommando för att ta bort dessa beroenden (som apt-get remove-dep).

Men tack vare tvst och Wesley Schwengle, kan du ångra "apt-get build-dep" genom att köra följande kommando (först installera aptitude använder "sudo apt-get install aptitude"):
sudo aptitude markauto $(apt-cache showsrc PACKAGE_NAME | sed -e '/Build-Depends/!d;s/Build-Depends: \|,\|([^)]*),*\|\[[^]]*\]//g')
sudo apt-get autoremove
 Ångra apt-get build-dep (Ta Build beroenden)

Författare: Andrew | Datum: söndag, oktober 24, 2010

När du vill kompilera något från källa i Ubuntu / Debian, det enklaste sättet att installera beroenden som krävs för att sammanställa det är att köra (sudo) "apt-get build-dep PACKAGE_NAME". Men det finns ingen inbyggd kommando för att ta bort dessa beroenden (som apt-get remove-dep).

Men tack vare tvst och Wesley Schwengle, kan du ångra "apt-get build-dep" genom att köra följande kommando (först installera aptitude använder "sudo apt-get install aptitude"):

sudo aptitude markauto $ (apt-cache showsrc PACKAGE_NAME | sed -e '/ Build-Depends / d; s / Build-Depends: \ |, \ | ([^)] *), * \ | \ [[^] ] * \] // g ')
sudo apt-get autoremove

I ovanstående kommando, ersätt "PACKAGE_NAME" med namnet på det paket du tidigare har sprang "apt-get build-dep" för. Running "sudo apt-get autoremove" bör då ta bort alla paketen som är byggberoenden för PACKAGE_NAME och därmed, installerades av "apt-get build-dep" kommandot.

Uppdatera: det finns problem med detta kommando och några paket. Till exempel försöker ångra "apt-get build-dep" för vin leder märkning ett stort antal paket som automatiskt installerade. Om det händer, kör "sudo apt-get install PAKET-märkt-AS-automatiskt installerade" markerar paketen som installeras så att de inte kommer att tas bort, ångra kommandot ovan. Så använd detta med omsorg och endast om du vet vad du gör!

I fall du undrar vad kommandot ovan gör:

    lämplighets auto - Markera paket har konstaterats installeras automatiskt (så om någon är beroende av dem, kommer de att tas bort)
    apt-cache showsrc - Visa källposter
    sed ....: - söker efter "Bygg-Depends:" i källdokument och tar bort onödiga grejer från paketnamnen (extra tecken som parenteser osv avlägsnas från utgången).

För att använda den som ett alias i din ~ / .bashrc-fil, se wilo108 kommentar nedan.

Liinux - Kör bash sccript ifrån "genväg" .desktop i konsole med vald .sh fil

söndag 8 mars 2015

Linux - Bash Gem local install *.gem and more

Here you have my bash script hgem.shmade in linux and difrent things incl gemGem install offline files *.gemand morehynt@speed-mailer.com

lördag 7 mars 2015

linux - gem2deb from gem list

# you need to install gem2deb
# sudo apt-get install gem2deb
mkdir gem2deb
cd gem2deb
gem list > installed_gem
sudo awk '{print "gem2deb "$0" "}'  installed_gem > tmp_gem_list
# remove everything betwen ()
echo '(F/.M/d h)' | sed 's/(.*)//' tmp_gem_list > ready_gem2deb
rm installed_gem && rm tmp_gem_list
sudo sh ready_gem2deb

Linux bash The case statement is good alternative to multilevel if-then-else-fi statement. It enable you to match several values against one variable. It is easier to read and write.

The case statement is good alternative to multilevel if-then-else-fi statement. It enable you to match several values against one variable. It is easier to read and write.


The syntax is as follows:

          case  $variable-name  in
          case  $variable-name  in
  • The case statement allows you to easily check pattern (conditions) and then process a command-line if that condition evaluates to true.
  • In other words the $variable-name is compared against the patterns until a match is found.
  • *) acts as default and it is executed if no match is found.
  • The pattern can include wildcards.
  • You must include ;; at the end of each commandN. The shell executes all the statements up to the two semicolons that are next to each other.
  • The esac is always required to indicate end of case statement.


Create a shell script called rental.sh:

# if no command line arg given
# set rental to Unknown

  rental="*** Unknown vehicle ***"

# otherwise make first arg as a rental

# use case statement to make decision for rental
   "car"  "For $rental rental is Rs.20 per k/m."
   "van"  "For $rental rental is Rs.10 per k/m."
   "jeep"  "For $rental rental is Rs.5 per k/m."
   "bicycle"  "For $rental rental 20 paisa per k/m."
   "enfield"  "For $rental rental Rs.3  per k/m."
   "thunderbird"  "For $rental rental Rs.5 per k/m."
     "Sorry, I can not get a $rental rental  for you!"

Save and close the file. Run it as follows:

chmod +x rental.sh
.rental.sh jeep
.rental.sh enfield
.rental.sh bike

Sample outputs:

Sorry, I can not get a *** Unknown vehicle *** rental  for you!
For jeep rental is Rs.5 per k/m.
For enfield rental Rs.3  per k/m.
Sorry, I can not get a bike rental  for you!

The case statement first checks $rental against each option for a match. If it matches "car", the echo command will display rental for car. If it matches "van", the echo command will display rental for van and so on. If it matches nothing i.e. * (default option), an appropriate warning message is printed.

Using Multiple Patterns

=$ +
		 "Full backup"
		 "Partial backup"
		 "No backup"

The following shell script demonstrate the concept of command line parameters processing using the case statement (casecmdargs.sh):

=   # option
=  # filename
# test -e and -E command line args matching
  	 "Editing $2 file..." 
        # make sure filename is passed else an error displayed   
  	  $FILE     "File name missing";  ;    $FILE	
  	 "Displaying $2 file..." 
  	  $FILE     "File name missing";  ;    $FILE	
  	 "Today is $(date)" 
     "Bad argument!" 
     "Usage: $0 -ecd filename"
     "	-e file : Edit file."
     "	-c file : Display file."
     "	-d      : Display current date and time."	

Run it as follows:

chmod +x casecmdargs.sh
.casecmdargs.sh  tmp
.casecmdargs.sh  tmp

Creating a backup script

Create a backup script called allinonebackup.sh:

# A shell script to backup mysql, webserver and files to tape
                 "Running mysql backup using mysqldump tool..."
                 "Running backup using rsync tool..."
                 "Running tape backup using tar tool..."
        	     "Backup shell script utility"
                 "Usage: $0 {sql|sync|tar}"
                 "	sql  : Run mySQL backup utility."
                 "	sync : Run web server backup utility."	
                 "	tar  : Run tape backup utility."	

Save and close the file. Run it as follows:

chmod +x allinonebackup.sh
# run sql backup
.allinonebackup.sh sql
# Dump file system using tape device
# however, the following will fail as patterns are case sensitive
# you must use command line argument tar and not TAR, Tar, TaR etc. 
.allinonebackup.sh TAR

Linux Bash - Tar all folder & Files in users /home/user/

cd /home/user/
tar -cvpjf backup`date +%m%d%y`.tar.bz2 --exclude=~/backup`date +%m%d%y`.tar.bz2 ~/

Linux bash skapa fil.sh -command

för att köra en bash fil i linux exempel besöka en hemsida
utan att behöva köra .sh filen "hela" utan bara ett kommando

hynt@hynt-mint-kde-17:~ > sudo sh htest.sh  -www  

Först sätter jag upp en alias:

alias htest="sudo sh /home/hynt/.hprojekt/htest.sh"

så efter refresh av alias så skriver jag bara

hynt@hynt-mint-kde-17:~ > htest -www  

Lägg till i .sh filen:

case "$1" in
-www) firefox $MY_HOMEPAGE
*) echo "Invalid option"

jag har gjort så htest inkl h.sh
h.sh är med i alla mina nyare filer pga låt oss titta på mina filer eller kör på ovanstående..

torsdag 5 mars 2015

Linux - Bash - empty trash in terminal if yes


#Show Trash Folder Size
clear && echo Folder Trash Size: && du -csh  $trashdir

echo "Would you like to empty Trash  [y/n]?"
read ans
if [ $ans = y -o $ans = Y -o $ans = yes -o $ans = Yes -o $ans = YES ]
cd $trashdir
sudo rm -rf *
if [ $ans = n -o $ans = N -o $ans = no -o $ans = No -o $ans = NO ]
echo "hynt@speed-mailer.com" 
echo "htrash.sh $version"

Linux - bash add ppa, yes or no to run command, show size of folder, mfl


install="sudo apt-get install "
versionof=echo This is $version of installos-install.sh

# Start of adding PPA
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"
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"
sudo apt-get update
# end of exempel add ppa
# End od adding PPA

# skapar mapp om den saknas
# Kopierar nerladdade filer: #-(03)
if [ ! -d /root/deb/ ]; then
  mkdir /root/deb/
 sudo mv /var/cache/apt/archives/*.deb /root/deb/

# Base install start
echo "Would you like to run base install [y/n]?"
read ans
if [ $ans = y -o $ans = Y -o $ans = yes -o $ans = Yes -o $ans = YES ]
echo "'yes'"

#Följande ytterligare paket kommer att installeras:
sudo apt-get install apt-rdepends emacs24 xterm super vim dselect lynx

if [ $ans = n -o $ans = N -o $ans = no -o $ans = No -o $ans = NO ]
echo "'no'"
# End of Base Install

echo "Would you like to run apt-get upgrade [y/n]?"
read ans
if [ $ans = y -o $ans = Y -o $ans = yes -o $ans = Yes -o $ans = YES ]
echo "'yes'"
sudo apt-get upgrade
if [ $ans = n -o $ans = N -o $ans = no -o $ans = No -o $ans = NO ]
echo "'no'"
echo "Would you like to run apt-get -f install [y/n]?"
read ans
if [ $ans = y -o $ans = Y -o $ans = yes -o $ans = Yes -o $ans = YES ]
echo "'yes'"
sudo apt-get -f install
if [ $ans = n -o $ans = N -o $ans = no -o $ans = No -o $ans = NO ]
echo "'no'"
echo "Would you like to run dpkg --configure -a [y/n]?"
read ans
if [ $ans = y -o $ans = Y -o $ans = yes -o $ans = Yes -o $ans = YES ]
echo "'yes'"
sudo dpkg --configure -a
if [ $ans = n -o $ans = N -o $ans = no -o $ans = No -o $ans = NO ]
echo "'no'"

# Kopierar nerladdade filer: #-(03)-01
# skapar mapp om den saknas
if [ ! -d /root/deb/ ]; then
  mkdir /root/deb/
fi && sudo mv /var/cache/apt/archives/*.deb /root/deb/
# Show size of folder used to store *.deb
clear && echo After copy to root && du -csh /root/deb /var/cache/apt/archives && echo hanterar deb filer && echo installos v $version && echo hynt@speed-mailer.com

onsdag 4 mars 2015

Linux - normal user Cant become root

vanligen skriver du: 
för att bli root user men fungerar inte det prova
  su -root
fungerade för mig gjorde en 
  alias su="su -root"

Linux - Terminal - Bash - Change user Password

#Change Root Users Password
sudo passwd root

Linux Bash - add normal user to root group - usermod -a -G root username

To add a user to the group root you should run (as root):
usermod -a -G root username

Linux - Bash - get size of folders in bash (rekommended)

#use version in your script

# Show size of folder used to store *.deb
# i use version in this exemple if no .sh file is used

clear && version="1.0.0" && echo Before copy to root && du -csh /root/deb /root/installos /var/cache/apt/archives && echo hanterar deb filer && echo installos $version && echo hynt@speed-mailer.com

# output in terminal

hynt - 2015

måndag 2 mars 2015

Linux - Bash- use sed and more - downloads dependency for gem file enter programs name in bash script

downloads dependency for gem file enter programs name in bash script

linux - bash remove everything in file betwen char ( and char )

Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. clear
  3. echo "Before:"
  4. echo "Gem actionmailer-4.2.0"
  5.   echo "actionpack (= 4.2.0)"
  6.   echo "actionview (= 4.2.0)"
  7.   echo "activejob (= 4.2.0)"
  8.   echo "mail (>= 2.5.4, ~> 2.5)"
  9.   echo "rails-dom-testing (>= 1.0.5, ~> 1.0)"
  11. gem dependency > dependsgem.txt
  12. echo '(F/.M/d h)' | sed 's/(.*)//' dependsgem.txt > dependsgem1.txt
  13. sed -e '/^[A-Z]/d' dependsgem1.txt > dependsgem2.txt
  14. sed -e 's/^[ \t]*//' dependsgem2.txt > dependsgem3.txt
  15. sed '/^$/d' dependsgem3.txt > dependsgem4.txt
  16. sudo perl -lane 'print "@F" if @F = grep !$seen{$_}++, @F' < dependsgem4.txt > dependsgem5.txt
  17. ls -1 | awk 'ORS=" "' dependsgem5.txt > dependsgem6.txt
  18. fold -s dependsgem6.txt > dependsgem7.txt
  19. while read LINE;do LARGE="sudo gem install $LINE";echo $LARGE>>dependsgem.sh;done<dependsgem7.txt
  20. clear
  22. echo "Make so .sh can run"
  23. sudo chmod u+x dependsgem.sh
  25. echo "Clean - delete *.txt files"
  26. sudo rm dependsgem1.txt && rm dependsgem2.txt && rm dependsgem3.txt && rm dependsgem4.txt
  27. sudo rm dependsgem5.txt && rm dependsgem6.txt && dependsgem7.txt
  28. echo "dependsgem.sh created"
  29. echo "sudo ./dependsgem.sh to run"
  31. echo "After:"
  32. echo "sudo gem install rake hoe actionpack actionview activejob mail rails-dom-testing activemodel"
  33. echo "sudo gem install activesupport rack rack-test rails-html-sanitizer builder erubis globalid arel"
  34. echo "sudo gem install i18n json minitest thread_safe tzinfo launchy rspec rspec-its ansi detroit qed"
  35. echo "sudo gem install ae ergo indexer lemon mast bundler thor rdoc cabin bcat childprocess cucumber"
  36. echo "sudo gem install cucumber-pro fuubar kramdown rspec-expectations rubocop coderay haml nokogiri"

Linux - "bash" perl remove dublicate word in file in one line - alias

alias rmwordinfile="sudo perl -lane 'print "@F" if @F = grep !$seen{$_}++, @F' <fil.txt >fil-new.txt"

söndag 1 mars 2015

Linux - trying to login on firefox addon Pastebin linux mint 14 firefox 36.0

Firefox Extension
With this Firefox Add-on you are able to create new pastes directly from your browser. A recommended add-on for all Pastebin users who use Firefox.
Version Download API Version Developer
3.0 DOWNLOAD 3.0 Prafulla Kiran

cap above this is my gem projekt

Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #!/bin/bash
  2. clear
  4. -(-Vem Är du-)------------------------------------------
  6. function findUser() {
  7.  thisPID=$$
  8.  origUser=$(whoami)
  9.  thisUser=$origUser
  11.  while ( "$thisUser" = "$origUser" )
  12.  do
  13.   ARR=($(ps h -p$thisPID -ouser,ppid;))
  14.   thisUser="${ARR(0)}"
  15.   myPPid="${ARR(1)}"
  16.   thisPID=$myPPid
  17.  done
  19.  getent passwd "$thisUser" | cut -d: -f1
  20. }
  21. user=$(findUser)
  22. echo "logged in: $user"
  23. -----(-Vem Är du-)-
  24. # Start of adding PPA  
  25. # Lägger till ppa för få ruby mysql att fungera
  26. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  28.   the_ppa01="deb http://host/debian distribution system develompment utilities"
  29.   the_ppa02="deb-src http://host/debian distribution system develompment utilities"
  30.   the_ppa03="deb http://http.us.debian.org/debian stable main contrib non-free"
  31.   the_ppa04="deb-src http://http.us.debian.org/debian stable main"
  33. if ! grep -q "$the_ppa01" /etc/apt/sources.list /etc/apt/sources.list.d/-; then
  34.  # commands to add the ppa ...
  35. echo "ppa not found, adding:"
  36.  sudo sh -c "echo $the_ppa01 >> /etc/apt/sources.list"
  37. fi
  39. if ! grep -q "$the_ppa02" /etc/apt/sources.list /etc/apt/sources.list.d/-; then
  40.  # commands to add the ppa ...
  41. echo "ppa not found, adding:"
  42.  sudo sh -c "echo $the_ppa02 >> /etc/apt/sources.list"
  43. fi
  45. if ! grep -q "$the_ppa03" /etc/apt/sources.list /etc/apt/sources.list.d/-; then
  46.  # commands to add the ppa ...
  47. echo "ppa not found, adding:"
  48.  sudo sh -c "echo $the_ppa03 >> /etc/apt/sources.list"
  49. fi
  51. if ! grep -q "$the_ppa04" /etc/apt/sources.list /etc/apt/sources.list.d/-; then
  52.  # commands to add the ppa ...
  53. echo "ppa not found, adding:"
  54.  sudo sh -c "echo $the_ppa04 >> /etc/apt/sources.list"
  55. fi
  57. #(Update)---------------
  58. sudo apt-get update
  59. #End of adding PPA
  61. #==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  62. # RVM INSTALL (exempel 3) - Sucess!  v1.26.10 latest
  63. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  64. echo "installing ruby stable"
  65. curl -sSL https://get.rvm.io | bash -s stable --ruby  
  66. #
  67. #  If you want to maybe jump back to your system
  68. #  installed Ruby which might be Ruby 1.8.6
  69. #  you can run the following command:
  70. #  > rvm use system
  71. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  73. #==-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=
  74. # rvm is found here!  (If you Used Exempel 3)
  75. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  76. #  /usr/local/rvm/
  77. #
  78. #  Pastebin and the other is found here!
  79. #
  80. #  /usr/local/bin/
  81. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  83. #=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  84. # - ERROR!---NOW!-ALL-SHIT!-Is-Installed--
  85. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  86. # rvm installed but lvm command dont work! - Error
  87. #  
  88. #  rvm: kommandot hittades inte  
  89. #  
  90. # > /usr/local/rvm/bin/rvm  <-- this the file, ok!
  91. #  
  92. #Dont paste the >  
  94. #=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  95. #- Lets! make a alias by hand!
  96. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==
  97. #  
  98. # 1. make a file in your home named
  99. # .bash_aliases
  100. #  
  101. # 2. add the line:
  102. # alias rvm="/usr/local/rvm/bin/rvm"
  103. #  
  104. # 3. Reboot or refresh .bash_aliases
  105. #  . /home/user/.bash_aliases
  106. #  dit it work?
  107. #  Najs!..  
  108. #  
  109. # 4. not working, run in your terminal:
  110. # sudo reboot
  111. #                        
  112. # 5. make it to a alias to (user is your username!)
  113. # add the line:
  114. # alias updatealias=". ~/.bash_aliases"
  115. #  
  116. #----------------------------------------------------------------------------
  117. #  (-WHY NOT!-)-Lets use a bash script! -
  118. #----------------------------------------------------------------------------
  119. # To much work or to less work! We dont have t
  120. # write a little program that does write a the new
  121. # alias if it not alredy exist to the file .bash_aliases!  
  122. #
  123.  touch /home/$user/.bash_aliases  
  124.  printf "alias pastebin='/usr/local/bin/pastebin -l bash -e 10M -f '\n" >> ~/.bash_aliases  
  125.  printf "alias hpastebin='/usr/local/bin/pastebin -l bash -f '\n" >> ~/.bash_aliases  
  126.  printf "alias rvm='/usr/local/rvm/bin/rvm'\n" >> ~/.bash_aliases
  127. . ~/.bash_aliases
  129. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  130. #- Pastebin -  -  (exempel)
  131. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  132. #pastebin -f /home/username/Dokument/file.sh -l bash -e 10M
  133. #
  134. # remove -e 10M if you dont want your file to expire
  135. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
  137. #-------------------------------------------------------------------------------
  138. #- better  to install ruby 2.0 use not this (If you are smart READ @ end first.-
  139. #- use exempel 3 not this crap! ) <--- tHIS did not work 4 me-
  140. #-------------------------------------------------------------------------------
  141. #sudo apt-get -y update
  142. #sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
  143. #cd /tmp
  144. #wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p481.tar.gz
  145. #tar -xvzf ruby-2.0.0-p481.tar.gz
  146. #cd ruby-2.0.0-p481/
  147. #./configure --prefix=/usr/local
  148. #make
  149. #sudo make install
  151. #---------------
  152. #- curl is needed -
  153. #------------------
  154. #bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
  155. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  156. #- Other way to install ruby that i found / BUT! use exemepel 3 i always do. (Exempel 2)  -
  157. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  158. # :> sudo gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
  159. # \curl -sSL https://get.rvm.io | bash -s stable
  160. #
  161. # Dont paste the >  
  162. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  163. echo "hi $user"
  164. #some deb files
  165. apt-get install mysql-client mysql-server libmysql-ruby client-dev git curl automake libxml2-dev libxslt-dev autoconf openssl libreadline6 zlib1g subversion -y
  166. 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
  167. apt-get install debhelper fakeroot ruby-dev
  168. #Install RVM with Ruby and Ruby on Rails with all required libraries:
  169. echo "installing ruby stable"
  170. curl -sSL https://get.rvm.io | bash -s stable --ruby  
  171. #installing rails
  172. echo "intalling rails"
  173. \curl -L https://get.rvm.io | bash -s stable --rails
  174. #activate auto deps 4 rvm
  175. echo "activate auto depends 4 rvm"
  176. sudo /usr/local/rvm/bin/rvm autolibs packages
  177. sudo /usr/local/rvm/bin/rvm autolibs homebrew
  178. #install head
  179. rvm install 2.0.0
  180. rvm | head -1
  181. rvm list known
  182. ruby -v  
  183. rvm use --default 2.0.0
  184. rvm 2.0.0 do gem install mysql
  186. gem install rdoc-data; rdoc-data --install
  187. gem install curl bundler mustache rdiscount ronn rspec builder git github_api highline nokogiri rake rdoc jeweler pastebin hpricot
  188. gem install rake-debian-build buildrdeb pry-debundle pry codebutler coderay sinatra rubygems-update rails bundler
  189. gem install debsfromrepos cucumber rapec make-rubygem-debs fpm gem2deb ruby-debiandebianize json rest-client slop debstep DebianPackageDownloader hoe
  190. gem install deb-fog fog thor dpkg-deb debugher addressable robots debot capistrano capistrano-ext quick-debug cache_debugging rails sqlite3 adressable
  191. gem install albanpeignier-rake-debian-build ruby-deb ar deb_control debeasy libarchive ruby-filemagic deblank
  192. gem install rubygems-mygems rubygems_dump rubygems-localproxy rubygems-deep_fetch rubygems_snapshot rubygems-bundler tf bundler-unload executable-hooks
  193. gem install rubygems-code_finder faraday multi_json octokitbundler webmock octokit sawyer ctags-bundler mpapis-bundler assetbundler asset_bundler
  194. gem install onpack actionview activejob activemodel activesupport ammeter appraisal arel arr-pm aruba asciidoctor asset_timestamps_cache atomic
  195. gem install awesome_print backports bcat bluecloth permutation sdoc echoe bones bones-rcov rcov spoon hoe-debugging hoe-gemspec http-cookie
  196. gem install net-http-digest_auth cabin capistrano-stats capybara CFPropertyList childprocess clamp closure-compiler
  197. gem install code_statistics coffee-script coffee-script-source colorize contest coveralls crack creole curb delorean descendants_tracker diff-lcs
  198. gem install docile docker-api eco ejs em-http-request erubis eventmachine excon execjs fakefs ffi fission flexmock fog-atmos fog-aws fog-brightbox
  199. gem install fog-core fog-ecloud fog-json fog-profitbricks fog-radosgw fog-riakcs fog-sakuracloud fog-serverlove fog-softlayer
  200. gem install fog-storm_on_demand fog-terremark fog-vmfusion
  201. 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
  202. gem install hoe-gemspec2 hoe-git hoe-rubygems hoe-seattlerb hoe-travis http httparty httpclient i18n inflecto insist ipaddress kpeg kramdown launchy less
  203. gem install libnotify liquid loofah mail markaby maruku mechanize midiator mime-types minitest minitest-stub-const mocha multipart-post multi_test multi_xml
  204. gem install net-http-persistent ntlm-http webrobots bacon Platform benchmark-ips mini_portile racc rexical jwt method_source actionmailer
  205. gem install activerecord netrc net-scp net-ssh oauth2 open4 opennebula osrcry patron pry-doc rack rack-protection rack-test radius
  206. gem install rails-deprecated_sanitizer rails-dom-testing rails-html-sanitizer railties sprockets-rails rake-compiler ramaze rb-inotify rbovirt rbvmomi
  207. gem install redcarpet RedCloth ritual rr rspec-core rspec-expectations rspec-its rspec-mocks rspec-rails rspec-support
  208. gem install rubocop ruby-beautify rubyforge rubygems-tasks rubyzip safe_yaml sass session shindo shoulda simplecov spork sprockets sshkit stud
  209. gem install syntax test-unit therubyracer thoughtbot-shoulda thread_safe tilt turn typhoeus tzinfo uglifier unf unf_ext unidecoder unindent vcr webrat
  210. gem install wikicloth yajl-ruby yard yui-compressor ZenTest oauth_bundle neobundle auto_build ro-bundle matebundle
  211. gem install rubygems-sandbox make deb gemcutter rubygems-pwn rubygems-sing gem_plugin rubygems-source rubygems-update update_rubygems nokogiri
  212. gem install rubygems-bundler rubygems-crawler glaze-analyzer query-analyzer pg_query_analyzer
  213. gem install rake hoe actionpack actionview activejob mail rails-dom-testing activemodel
  214. gem install activesupport rack rack-test rails-html-sanitizer builder erubis globalid arel
  215. gem install i18n json minitest thread_safe tzinfo launchy rspec rspec-its ansi detroit qed
  216. gem install ae ergo indexer lemon mast bundler thor rdoc cabin bcat childprocess cucumber
  217. gem install cucumber-pro fuubar kramdown rspec-expectations rubocop coderay haml nokogiri
  218. gem install slim tilt yard yard-tomdoc asset_timestamps_cache thoughtbot-shoulda bacon
  219. gem install bacon-colored_output coveralls json_pure mime-types simplecov guard-rspec
  220. gem install guard-rubocop parser ruby_gntp addressable extlib multi_json appraisal fakefs
  221. gem install sqlite3 little-plugger loquacious rubytest mustache rdiscount ronn amq-protocol
  222. gem install rails parallel rspec-fire capistrano-stats mocha sshkit capistrano ffi
  223. gem install test-construct sinatra coffee-script-source execjs rest-client term-ansicolor
  224. gem install vcr webmock safe_yaml aruba capybara diff-lcs gherkin multi_test ramaze rubyzip
  225. gem install spork syntax test-unit webrat awesome_print unidecoder docile rspec-rails fog
  226. gem install slop capistrano-ext robots chronic hoe-bundler hoe-doofus hoe-gemspec2 hoe-git
  227. gem install hoe-rubygems hoe-travis rubyforge github-markup redcarpet archive-tar-minitar
  228. gem install cane excon pry shoulda unf allison notify delorean eventmachine open4 shindo
  229. gem install minitest-rg multipart-post CFPropertyList docker-api fission fog-atmos fog-aws
  230. gem install fog-brightbox fog-core fog-ecloud fog-json fog-profitbricks fog-radosgw
  231. gem install fog-riakcs fog-sakuracloud fog-serverlove fog-softlayer fog-storm_on_demand
  232. gem install fog-terremark fog-vmfusion fog-voxel fog-xml google-api-client ipaddress
  233. gem install opennebula rbovirt rbvmomi turn inflecto formatador minitest-stub-const net-scp
  234. gem install net-ssh osrcry http-form_data arr-pm backports clamp insist stud mechanize
  235. gem install ruby-progressbar ritual rr html-pipeline nokogiri-diff sanitize
  236. gem install descendants_tracker faraday hashie oauth2 autoparse retriable signet rbench
  237. gem install test_declarative code_statistics hoe-gemspec hoe-seattlerb travis-lint
  238. gem install domain_name multi_xml bluecloth git github_api highline permutation sdoc echoe
  239. gem install itextomml prawn ritex rouge stringex bones bones-rcov rcov spoon reap commonjs
  240. gem install rake-compiler rspec-spies vulcan codeclimate-test-reporter colorize
  241. gem install hoe-debugging fpm http-cookie net-http-digest_auth net-http-persistent
  242. gem install ntlm-http webrobots Platform introspection metaclass benchmark-ips nenv
  243. gem install shellany jwt sawyer ast cliver gauntlet racc simplecov-sublime-ruby-coverage
  244. gem install jeweler method_source latest_ruby brass rulebow bunny logification actionmailer
  245. gem install activerecord railties sprockets-rails rails-deprecated_sanitizer loofah
  246. gem install Remarkably dalli erector ezamar innate liquid locale localmemcache lokar maruku
  247. gem install nagoro rack-contrib redis sass sequel slippers tagz tenjin yui-compressor
  248. gem install ZenTest kpeg netrc pry-doc hpricot rspec-core rspec-mocks flexmock
  249. gem install rspec-support ammeter astrolabe powerpack rainbow ar rspectacular timecop
  250. gem install warning_filter bundler-unload executable-hooks tf octokit httparty gems
  251. gem install gpg_status_parser midiator libnotify rb-inotify guard guard-minitest
  252. gem install shoulda-context shoulda-matchers simplecov-html sprockets rack-protection
  253. gem install temple closure-compiler coffee-script eco ejs hike uglifier unindent gem_hadar
  254. gem install tins jeremymcanally-pending packnga power_assert session atomic RedCloth
  255. gem install asciidoctor contest creole less markaby radius wikicloth yajl-ruby citron hashr
  256. gem install unf_ext nanotest crack curb em-http-request http httpclient patron typhoeus
  258. # gem plugins installer
  259. gem install executable-hooks gem-browse gem-ctags gem-empty gem_info gem-init gem-compare gem-man
  260. gem install gem-nice-install gem-orphan gem-patch gem-toolbox gem-wrappers graph maven_gem open-gem PushSafety
  261. gem install rbenv-rehash rubygems-desc rubygems-openpgp rubygems-sandbox rubygems_snapshot rubygems-tasks
  262. gem install wrapper wrapped qwrapper rapper rafters
  264. echo "Saved dependency needed in home dir"
  265. gem dependency > /home/hynt/dependsgem.txt
  267. #update
  268. gem update --system
  269. update_rubygems    
  270. gem tumble
  271. gem update
  272. rvm install ruby-head-2.0.0 --url https://github.com/github/ruby.git --branch 2.1
  273. #rvm install ruby-head-2.2.0 --url https://github.com/github/ruby.git --branch 2.1
  274. #---------------------------------------------------------------------------------------------------------------
  276. #---------------------------------------------------------------------------------------------------------------
  277. #-Plugins Man---------------------------------------------------------------------------------------------------------------
  278. # executable-hooks
  279. # https://github.com/mpapis/executable-hooks
  280. # Extends rubygems to support executables plugins.
  281. # In gem lib dir create rubygems_executable_plugin.rb:
  282. # Gem.execute do |original_file|
  283. # warn("Executing: #{original_file}")
  284. # end
  285. #---------------------------------------------------------------------------------------------------------------
  286. # gem-browse
  287. # https://github.com/tpope/gem-browse
  288. # Adds four commands:
  289. # gem edit opens a gem in your editor
  290. # gem open opens a gem by name in your editor
  291. # gem clone clones a gem from GitHub
  292. # gem browse opens a gem’s homepage in your browser
  293. #---------------------------------------------------------------------------------------------------------------
  294. # gem-empty
  295. # https://github.com/rvm/gem-empty
  296. # Adds command gem empty to remove all gems from current GEM_HOME.
  297. #---------------------------------------------------------------------------------------------------------------
  298. # gem-ctags
  299. # https://github.com/tpope/gem-ctags
  300. # 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.
  301. #---------------------------------------------------------------------------------------------------------------
  302. # gem_info
  303. # https://github.com/oggy/gem_info
  304. # Adds a gem info command with fuzzy matching on name and version. Designed for scripting use.
  305. #---------------------------------------------------------------------------------------------------------------
  306. # gem-init
  307. # https://github.com/mwhuss/gem-init
  308. # Adds gem init to create a barebones gem.
  309. #---------------------------------------------------------------------------------------------------------------
  310. # gem-compare
  311. # https://github.com/strzibny/gem-compare
  312. # 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.
  313. #---------------------------------------------------------------------------------------------------------------
  314. # gem-man
  315. # https://github.com/defunkt/gem-ma
  316. # The gem man command lets you view a gem’s man page.
  317. #---------------------------------------------------------------------------------------------------------------
  318. # gem-nice-install
  319. # https://github.com/voxik/gem-nice-install
  320. # Tries to install system dependencies needed to install your gems with binary extensions using standard gem install command.
  321. # This currently works only for Fedora, but # hopefully will be extended.
  322. #---------------------------------------------------------------------------------------------------------------
  323. # gem-orphan
  324. # https://github.com/sakuro/gem-orphan
  325. # Adds a gem orphan command that finds and lists gems on which no other gems are depending.
  326. #---------------------------------------------------------------------------------------------------------------
  327. # gem-patch
  328. # https://github.com/strzibny/gem-patch
  329. # Adds gem patch command, which enables you to apply patches directly on .gem files. Supports both RubyGems 1.8 and RubyGems 2.0.
  330. #---------------------------------------------------------------------------------------------------------------
  331. # gem-toolbox
  332. # https://github.com/gudleik/gem-toolbox
  333. # Adds six commands:
  334. # gem open - opens a gem in your default editor
  335. # gem cd - changes your working directory to the gem’s source root
  336. # gem readme - locates and displays a gem’s readme file
  337. # gem history - locates and display’s a gem’s changelog
  338. # gem doc - Browse a gem’s documentation in your default browser
  339. # gem visit - Open a gem’s homepage in your default browser
  340. #---------------------------------------------------------------------------------------------------------------
  341. # gem-wrappers
  342. # https://github.com/rvm/gem-wrappers
  343. # Create gem wrappers for easy use of gems in cron and other system locations.
  344. # By default wrappers are installed when a gem is installed.
  345. # Adds this commands:
  346. # gem wrappers regenerate - force rebuilding wrappers for all gem executables
  347. # gem wrappers - show current configuration
  348. #---------------------------------------------------------------------------------------------------------------
  349. # graph
  350. # https://github.com/seattlerb/graph
  351. # Adds a gem graph command to output a gem dependency graph in graphviz’s dot format.
  352. #---------------------------------------------------------------------------------------------------------------
  353. # maven_gem
  354. # https://github.com/jruby/maven_gem
  355. # Adds gem maven to install any Maven-published Java library as though it were a gem.
  356. #---------------------------------------------------------------------------------------------------------------
  357. # open_gem
  358. # https://github.com/adamsanderson/open_gem
  359. # Adds two commands:
  360. # gem open opens a gem in your default editor
  361. # gem read opens a gem’s rdoc in your default browser
  362. #---------------------------------------------------------------------------------------------------------------
  363. # PushSafety
  364. # https://github.com/jdleesmiller/push_safety
  365. # Applies a whitelist to gem push to prevent accidentally pushing private gems to the public RubyGems repository.
  366. #---------------------------------------------------------------------------------------------------------------
  367. # rbenv-rehash
  368. # https://github.com/scoz/rbenv-rehash
  369. # Automatically runs rbenv rehash after installing or uninstalling gems.
  370. #---------------------------------------------------------------------------------------------------------------
  371. # rubygems-desc
  372. # https://github.com/chad/rubygems-desc
  373. # Adds gem desc to describe a gem by name.
  374. #---------------------------------------------------------------------------------------------------------------
  375. # rubygems-openpgp
  376. # https://github.com/grant-olson/rubygems-openpgp
  377. # Adds commands and flags to allow OpenPGP signing of gems.
  378. # gem sign foo.gem to sign a gem.
  379. # gem verify foo.gem --trust to verify a gem.
  380. # gem build foo.gemspec --sign to sign at build time.
  381. # gem install foo --verify --trust to verify on install.
  382. #---------------------------------------------------------------------------------------------------------------
  383. # rubygems-sandbox
  384. # https://github.com/seattlerb/rubygems-sandbox
  385. # Manages command-line gem tools and dependencies with a gem sandbox command.
  386. # This lets you install things like flay and rdoc outside of the global rubygems repository.
  387. #---------------------------------------------------------------------------------------------------------------
  388. # rubygems_snapshot
  389. # https://github.com/rogerleite/rubygems_snapshot
  390. # Adds gem snapshot to create exports of all your current gems into a single file that you can import later.
  391. #---------------------------------------------------------------------------------------------------------------
  392. # rubygems-tasks
  393. # https://github.com/postmodern/rubygems-tasks
  394. # rubygems-tasks provides agnostic and unobtrusive Rake tasks for building, installing and releasing Ruby Gems.
  395. #---------------------------------------------------------------------------------------------------------------
  397. #repair
  398. rvm repair environments
  399. rvm repair symlinks
  400. rvm repair archives
  401. rvm repair all
  403. #offline installer gem files
  404. gem install -i /home/hynt/tmp/ cucumber -v 0.10.7
  405. gem install -f --local /home/hynt/tmp/*.gem
  407. # Temp - Not get tested..........................................
  408. #Specify your dependencies in a Gemfile in your project's root:
  410. #source 'https://rubygems.org'
  411. #gem 'nokogiri'
  412. #gem 'rack', '~>1.1'
  413. #gem 'rspec', :require => 'spec'
  415. #bundle install
  416. #git add Gemfile Gemfile.lock
  417. #require 'rubygems'
  418. #require 'bundler/setup'
  419. #require 'nokogiri'
  421. #bundle exec rspec spec/models
  423. #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.
  424. #Finally, if you want a way to get a shortcut to gems in your bundle:
  426. #bundle install --binstubs
  427. #bin/rspec spec/model