This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # povezava do weather apija s poizvedbo za mesto Ljubljana | |
| url="http://api.openweathermap.org/data/2.5/weather?q=Ljubljana,si" | |
| # Primer rezultata poizvedbe: | |
| # (Za celoten rezultat odprite url v brskalniku) | |
| # {...,"main":{"temp":277.447, ...}, ...} | |
| # main.temp je v Kelvinih, za pretvorbo v Celzije odstejemo 273.15 | |
| # Vrne trenutno temperaturo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <signal.h> | |
| #include <unistd.h> | |
| #include <sys/types.h> | |
| #include <sys/time.h> | |
| char sign; | |
| int energy; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # --- razno.sh --- | |
| echo '#!/bin/bash'>razno.sh | |
| chmod +x razno.sh | |
| # razno.sh a) | |
| echo '# naloga a)'>>razno.sh | |
| echo 'echo "--- razno | naloga a) ---"'>>razno.sh | |
| echo 'tail -8 datoteka | head -5'>>razno.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| html=$(curl -s "http://www.uni-lj.si/akademije_in_fakultete/fakultete/") | |
| function getNumbers { | |
| echo $(egrep -o -E 'tel:.?[0-9\/\ \-]{12}?' <<< $html) | sed -E $'s/\ tel:[\ ]?/\\\ntel:/g' | |
| } | |
| function getNames { | |
| echo $(egrep -o -E '<dl class="photo-list">.{1,}?<\/dl>' <<< $html) | egrep -o '(>[A-ZČŠŽ]+ - [A-Z\ a-z蚞ȊŽ]+<)' | sed -E $'s/(<|>)//g' | |
| } | |
| function lookupNumber { | |
| echo -n "Vnesite ime željene fakultete: "; read name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| function help { | |
| echo "Pomoc:" | |
| echo "Klic skripte: $0 [ime_funkcije] [argument_funkcije]" | |
| echo "Moznosti:" | |
| echo -e "\t - fakrek = faktoriela z rekurzijo" | |
| echo -e "\t - fakiter = faktoriela z iteracijo" | |
| echo -e "\t - fibrek = fibonacci z rekurzijo" | |
| echo -e "\t - fibiter = fibonacci z iteracijo" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // a) Definirajte strukturo, ki predstavlja matriko in še ustrezen tip matrix. Struktura naj hrani dimenzijo matrike (št. vrstic in stolpcev) in elemente matrike (tabela celih števil). Koliko bajtov zaseda ta struktura? | |
| // b) Napišite funkcije za delo z matrikami, npr.: | |
| // matrix* create_matrix(int n, int m, int val) | |
| // Ustvari novo matriko velikosti n x m, njene elemente pa inicializira na val. | |
| // matrix* create_random_matrix(int n, int m) | |
| // Ustvari novo matriko velikosti n x m, njene elemente pa naključno inicializira. | |
| // print_matrix(matrix* m) | |
| // Podamo matriko m izpiše. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| function help { | |
| echo -en "\033cPritisnite: | |
| q - izhod iz programa (quit) | |
| h - izpiše pomoč in čaka na pritisk tipke (help) | |
| c - menjava vidnosti izpisa ukaza (command toggle display) | |
| m - menjava vidnosti izpisa porabe pomnilnika (memory toggle display) | |
| p - menjava vidnosti izpisa zasedenosti cpu (cpu toggle display) | |
| u - menjava izpisa uporabnika (user toggle display) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <signal.h> | |
| #include <unistd.h> | |
| #include <sys/types.h> | |
| char sign; | |
| int energy; | |
| void moreEnergy() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| #include <sys/types.h> | |
| #include <dirent.h> | |
| void ls(char const *path) { | |
| DIR* dir = opendir(path); | |
| struct dirent *entry; | |
| if(dir != NULL) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a) useradd -D | |
| b) useradd -c "Uporabniski komentar" -s /bin/bash -m uporabnik1 | |
| useradd -c "Uporabniski komentar" -s /bin/bash -m uporabnik2 | |
| c) chmod 000 -R /home/uporabnik1 | |
| chmod 744 -R /home/uporabnik2 | |
| d) passwd uporabnik1 | |
| passwd uporabnik2 |