User:Otuur: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Otuur (talk | contribs)
No edit summary
Otuur (talk | contribs)
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
==PowerShell Suurimad failid==
==OpenCV Installation==
==Quest3==
<source lang="bash">
#!/bin/bash
#Autor: Olle Tuur, otuur@itcollege.ee
#Versioon 0.3
#Exit väärtused
#0 - skript lõpetas edukalt tegevuse
#1 - kasutajal ei ole juurkasutaja õigusi
#2 - arvutis on liiga vähe kerneleid


#Kas kasutajal on vajalikud õigused?
'''Script is ment to be used with Ubuntu 10.04 (64bit)'''
if [ $UID -ne 0 ]; then
echo "$(basename $0) käivitamiseks, pead olema juurkasutaja!"
exit 1
fi


#Teatame, kasutajale, millega ta riskib
echo "See skript kustutab kõik vanad kernelid peale kahe kõige uuema."
echo "Jätka juhul, kui oled täiesti kindel, et ei vaja enam vanemaid kerneleid."
echo ""
echo "Kas soovid jätkata? (Jätkamiseks sisesta Y ja vajuta ENTER):"


read JATKA


#Kui kasutaja soovib jätkata
[This step is optional] First of all you need to install Gnome fallback. For that open terminal and use:
if [ $JATKA == "Y" ] || [ $JATKA == "y" ]; then
  sudo apt-get install gnome-session-fallback
Logout and select "Gnome Classic" to login


echo "Hetkel on kasutusel versioon $(uname -r | cut -d'-' -f1,2)"
echo ""
echo "Skript leidis sinu arvutist järgnevad kernelid:"
#Array, kus on kõik kernelid, mis leiti
OLEMAS=($(ls /boot | grep vmlinuz | cut -d'-' -f2,3))
#Array pikkus
PIKKUS=${#OLEMAS[@]}
#Trükime välja olemasolevad kernelid
for((i=0; i<${PIKKUS}; i++));
do
echo ${OLEMAS[$i]}
done


#Kas on olemas üle 2 kerneli?
[[File:Pngfallolle.png]]
if [ ${PIKKUS} -lt 3 ]; then
echo "Kahte kernelit ei saa alles jätta. Sul on ainult ${PIKKUS} kernel(it)."
echo "Skript lõpetab töö."
exit 2
fi


#Mitu võib kustutada
'''[What you need to do]'''
KUSTUTA=$[PIKKUS-2]
#Ütleme, mitu kernelit kustutatakse
echo "Kustutatakse ${KUSTUTA} kernel(it)"


for((j=0; j<${KUSTUTA}; j++));
Update your system using Update Manager ( You can find it under System -> Administration -> Update Manager if it doesn't open itself )
do
 
#Teavitame, mis kustutatakse
Open terminal and download the script:
echo "Kerneliga ${OLEMAS[$j]} seotud paketid, mis eemaldatakse:"
  wget http://enos.itcollege.ee/~otuur/skriptid/install_opencv.sh
echo $(dpkg -l | grep ^ii | grep ${OLEMAS[$j]} | awk -F' ' '{ print $2 }')
 
#Kustutame
Before you can use it you have to give execution rights to that file
                apt-get remove $(dpkg -l | grep ${OLEMAS[$j]} | awk -F' ' '{ print $2 }')
  sudo chmod +x install_opencv.sh
done
 
To run the script type
  sudo ./install_opencv.sh
#Teavitame kasutajat töö lõpetamisest
 
echo "Tehtud!"
Answer the questions if needed (best would be to use example when available).
exit 0
 
fi
'''IF ASKED FOR FOLDER TYPE IT IN OR COPY THE ADDRESS FROM ABOVE'''
</source>

Latest revision as of 16:38, 2 November 2011

OpenCV Installation

Script is ment to be used with Ubuntu 10.04 (64bit)


[This step is optional] First of all you need to install Gnome fallback. For that open terminal and use:

  sudo apt-get install gnome-session-fallback

Logout and select "Gnome Classic" to login


[What you need to do]

Update your system using Update Manager ( You can find it under System -> Administration -> Update Manager if it doesn't open itself )

Open terminal and download the script:

  wget http://enos.itcollege.ee/~otuur/skriptid/install_opencv.sh

Before you can use it you have to give execution rights to that file

  sudo chmod +x install_opencv.sh

To run the script type

  sudo ./install_opencv.sh

Answer the questions if needed (best would be to use example when available).

IF ASKED FOR FOLDER TYPE IT IN OR COPY THE ADDRESS FROM ABOVE