70 gostiju, 0 korisnika

Poslednje poruke

Autor Tema: Linux Tips & Tricks  (Pročitano 24571 puta)

Van mreže cambridge

  • Hyper-aktivan član
  • ***
  • Poruke: 594
Re: Linux Tips & Tricks
« Odgovor #45 poslato: Jul 19, 2008, 15:58:13 »
Kako napraviti jednostavan stopwatch (stopericu) u bash-u ???

copy & paste & chmod:

Citat
#!/bin/sh

# A command line Stopwatch

# Author:
#    http://www.pixelbeat.org/
# Notes:
#    This script starts a few processes per lap, in addition to
#    the shell loop processing, so the assumption is made that
#    this takes an insignificant amount of time compared to
#    the response time of humans (~.1s) (or the keyboard
#    interrupt rate (~.05s)).
#    '?' for splits must be entered twice if characters
#    (erroneously) entered before it (on the same line).
#    '?' since not generating a signal may be slightly delayed
#    on heavily loaded systems.
#    Lap timings on ubuntu may be slightly delayed due to:
#    http://bugs.launchpad.net/bugs/62511
# Changes:
#    V1.0, 23 Aug 2005, Initial release
#    V1.1, 26 Jul 2007, Allow both splits and laps from single invocation.
#                       Only start timer after a key is pressed.
#                       Indicate lap number
#                       Cache programs at startup so there is less error
#                       due to startup delays.
#    V1.2, 01 Aug 2007, Work around `date` commands that don't have nanoseconds.
#                       Use stty to change interrupt keys to space for laps etc.
#                       Ignore other input as it causes problems.
#    V1.3, 01 Aug 2007, Testing release.
#    V1.4, 02 Aug 2007, Various tweaks to get working under ubuntu and Mac OS X.
#    V1.5, 27 Jun 2008, set LANG=C as got vague bug report about it.

export LANG=C

ulimit -c 0 #no cores from SIGQUIT
trap '' TSTP #ignore Ctrl-Z just in case
save_tty=`stty -g` && trap "stty $save_tty" EXIT #restore tty on exita
stty quit ' ' #space for laps rather than Ctrl-\
stty eof  '?' #? for splits rather than Ctrl-D
stty -echo    #don't echo input

cache_progs() {
    stty > /dev/null
    date > /dev/null
    grep . < /dev/null
    (echo "import time" | python) 2> /dev/null
    bc < /dev/null
    sed '' < /dev/null
    printf '1' > /dev/null
    /usr/bin/time false 2> /dev/null
    cat < /dev/null
}
cache_progs #to minimise startup delay

date +%s.%N | grep -qF 'N' && use_python=1 #if `date` doesn't have nanoseconds
now() {
    if [ "$use_python" ]; then
        echo "import time; print time.time()" 2>/dev/null | python
    else
        printf "%.2f" `date +%s.%N`
    fi
}

fmt_seconds() {
    seconds=$1
    mins=`echo $seconds/60 | bc`
    if [ "$mins" != "0" ]; then
        seconds=`echo "$seconds - ($mins*60)" | bc`
        echo "$mins:$seconds"
    else
        echo "$seconds"
    fi
}

total() {
    end=`now`
    total=`echo "$end - $start" | bc`
    fmt_seconds $total
}

stop() {
    [ "$lapped" ] && lap "$laptime" "display"
    total
    exit
}

lap() {
    laptime=`echo "$1" | sed -n 's/.*real[^0-9.]*\(.*\)/\1/p'`
    [ ! "$laptime" -o "$laptime" = "0.00" ] && return #signals too frequent
    laptotal=`echo $laptime+0$laptotal | bc`
    if [ "$2" = "display" ]; then
        lapcount=`echo 0$lapcount+1 | bc`
        laptime=`fmt_seconds $laptotal`
        echo $laptime "($lapcount)"
        lapped="true"
        laptotal="0"
    fi
}

echo -n "Space for lap | ? for split | Ctrl-C to stop | Space to start...">&2

while true; do
    trap true INT QUIT #set signal handlers
    laptime=`/usr/bin/time -p 2>&1 cat >/dev/null`
    ret=$?
    trap '' INT QUIT #ignore signals within this script
    if [ $ret -eq 1 -o $ret -eq 2 -o $ret -eq 130 ]; then #SIGINT = stop
        [ ! "$start" ] && { echo >&2; exit; }
        stop
    elif [ $ret -eq 3 -o $ret -eq 131 ]; then #SIGQUIT = lap
        if [ ! "$start" ]; then
            start=`now` || exit 1
            echo >&2
            continue
        fi
        lap "$laptime" "display"
    else #eof = split
        [ ! "$start" ] && continue
        total
        lap "$laptime" #update laptotal
    fi
done


za gtk ili java-swing verziju pogledati http://code.google.com/p/gstpw/
« Poslednja izmena: Jul 19, 2008, 16:31:58 by cambridge »
cam.vacau.com

Van mreže cambridge

  • Hyper-aktivan član
  • ***
  • Poruke: 594
Re: Linux Tips & Tricks
« Odgovor #46 poslato: Jul 20, 2008, 15:50:38 »
za konvertovanje vektorskih formata koji nisu nativni u linuxu koristite Uniconvertor!

On podrzava sledece formate:
Citat

UniConvertor 1.1.2

USAGE: uniconv [INPUT FILE] [OUTPUT FILE]

Converts one vector graphics format to another using sK1 engine.
sK1 Team (http://sk1project.org), copyright (C) 2007,2008 by Igor E. Novikov

 Allowed input formats:
     AI  - Adobe Illustrator files (postscript based)
     CDR - CorelDRAW Graphics files (7-X3,X4 versions)
     CDT - CorelDRAW templates files (7-X3 versions)
     CCX - Corel Compressed Exchange files
     CMX - Corel Presentation Exchange files (CMX1 format)
     SVG - Scalable Vector Graphics files
     FIG - XFig files
     CGM - Computer Graphics Metafile files
     AFF - Draw files
     WMF - Windows Metafile files
     SK  - Sketch/Skencil files
     SK1 - sK1 vector graphics files

 Allowed output formats:
     AI  - Adobe Illustrator files (postscript based)
     SVG - Scalable Vector Graphics files
     CGM - Computer Graphics Metafile files
     WMF - Windows Metafile files
     SK  - Sketch/Skencil files
     SK1 - sK1 vector graphics files

Example: uniconv drawing.cdr drawing.svg

cam.vacau.com

Van mreže zarej

  • Administrator
  • Veteran
  • *****
  • Poruke: 2496
  • lose programe iskljucicu trajno...
Re: Linux Tips & Tricks
« Odgovor #47 poslato: Avgust 14, 2008, 16:00:01 »
za konvertovanje vektorskih formata koji nisu nativni u linuxu koristite Uniconvertor!

On podrzava sledece formate:
Citat

UniConvertor 1.1.2

USAGE: uniconv [INPUT FILE] [OUTPUT FILE]

Converts one vector graphics format to another using sK1 engine.
sK1 Team (http://sk1project.org), copyright (C) 2007,2008 by Igor E. Novikov

 Allowed input formats:
     AI  - Adobe Illustrator files (postscript based)
     CDR - CorelDRAW Graphics files (7-X3,X4 versions)
     CDT - CorelDRAW templates files (7-X3 versions)
     CCX - Corel Compressed Exchange files
     CMX - Corel Presentation Exchange files (CMX1 format)
     SVG - Scalable Vector Graphics files
     FIG - XFig files
     CGM - Computer Graphics Metafile files
     AFF - Draw files
     WMF - Windows Metafile files
     SK  - Sketch/Skencil files
     SK1 - sK1 vector graphics files

 Allowed output formats:
     AI  - Adobe Illustrator files (postscript based)
     SVG - Scalable Vector Graphics files
     CGM - Computer Graphics Metafile files
     WMF - Windows Metafile files
     SK  - Sketch/Skencil files
     SK1 - sK1 vector graphics files

Example: uniconv drawing.cdr drawing.svg

Covece gde ovo iskopa izgleda kao mnogo mocna stvar. Jel si probao kakav je u praksi?
Ovaj sk1 izgleda kao Corelov light klon.
"Ne možes samo pitati korisnike šta je to što oni žele i onda se truditi da im to i daš. Dok ti to napraviš, oni će poželeti nešto drugo". (Inc Magazine, 1989.)

"Veoma je teško dizajnirati proizvod za određenu grupu. Često ljudi ne znaju šta žele dok im to ne pokažeš". (BusinessWeek, maj 1998.)

Van mreže cambridge

  • Hyper-aktivan član
  • ***
  • Poruke: 594
Re: Linux Tips & Tricks
« Odgovor #48 poslato: Avgust 19, 2008, 13:18:56 »
sk1 nisam jos, ali mi se cini da je inkscape "mainstream" sto se tice vektorske grafike pod linuxom, sudeci po screenshotovima :)

uniconvertor je nezaobilazna alatka ako radis sa cdr corel fajlovima !!!
cam.vacau.com

Van mreže cambridge

  • Hyper-aktivan član
  • ***
  • Poruke: 594
« Poslednja izmena: Septembar 07, 2008, 16:12:24 by cambridge »
cam.vacau.com

Van mreže Sale

  • Administrator
  • Ne silazi sa Foruma
  • *****
  • Poruke: 4738
  • Live in your world, play in ours.
    • Mega blog
Re: Linux Tips & Tricks
« Odgovor #50 poslato: Novembar 11, 2008, 13:09:12 »
Malo humora nije na odmet : evo male parodije na Matrix. Šta bi se desilo da Matrica funkcioniše pomoću windowsa lol



Small | Large


specijalan pozdrav za zareja  ;)
Mega blog Blog koji prati novosti iz sveta filma, muzike, tv serija, interneta, softvera, video igara, stripova i još ponečeg...

Van mreže zarej

  • Administrator
  • Veteran
  • *****
  • Poruke: 2496
  • lose programe iskljucicu trajno...
Re: Linux Tips & Tricks
« Odgovor #51 poslato: Decembar 03, 2008, 10:00:06 »
Haha evo sad videh. Free Trial version Learning Kung-fu has expired :D :D :D
"Ne možes samo pitati korisnike šta je to što oni žele i onda se truditi da im to i daš. Dok ti to napraviš, oni će poželeti nešto drugo". (Inc Magazine, 1989.)

"Veoma je teško dizajnirati proizvod za određenu grupu. Često ljudi ne znaju šta žele dok im to ne pokažeš". (BusinessWeek, maj 1998.)

Van mreže Sale

  • Administrator
  • Ne silazi sa Foruma
  • *****
  • Poruke: 4738
  • Live in your world, play in ours.
    • Mega blog
Re: Linux Tips & Tricks
« Odgovor #52 poslato: Februar 28, 2009, 19:24:21 »
Gde ste "pingvini" ? Nema vas nešto u poslednje vreme  ;)

Ajde onda ja da kažem koju o linuxu, i to preporukom ovim sajtovima svima onima koji žele da probaju Ubuntu i saznaju aktuelnosti o Linuxu:



http://www.ubuntu-rs.org/



http://planeta.ubuntusrbija.org/
Mega blog Blog koji prati novosti iz sveta filma, muzike, tv serija, interneta, softvera, video igara, stripova i još ponečeg...

Van mreže cambridge

  • Hyper-aktivan član
  • ***
  • Poruke: 594
Odg: Linux Tips & Tricks
« Odgovor #53 poslato: Januar 19, 2010, 20:11:16 »
Da ne zaboravim:

Dobar program za iso i slične cd-dvd fajlove :



These are AcetoneISO's Features:

- Mount automatically ISO, MDF, NRG, BIN, NRG without the need to insert admin password! Only single-track images are supported for the moment.
- a native utility to blank your CD-RW, DVD-RW and DVD-RW discs
- A nice display which shows current images mounted and possibility to click on it to quickly reopen mounted image
- Convert 2 ISO all image types:
  *.bin *.mdf *.nrg *.img *.daa *.dmg *.cdi *.b5i *.bwi *.pdi and much more
- Extract images content to a folder:
  *.bin *.mdf *.nrg *.img *.daa *.dmg *.cdi *.b5i *.bwi *.pdi and much more
- Play a DVD Movie Image with Kaffeine / VLC / SMplayer with auto-cover download from Amazon
- Generate an ISO from a Folder or CD/DVD
- Check MD5 file of an image and/or generate it to a text file
- Calculate ShaSums of images in 128, 256 and 384 bit
- Encrypt / Decrypt an image
- Split / Merge image in X megabyte
- Compress with High Ratio an image in 7z format
- Rip a PSX cd to *.bin to make it work with epsxe/psx emulators
- Restore a lost CUE file of *.bin *.img
- Convert Mac OS *.dmg to a mountable image
- El-Torito support to create ISO bootable Cd
- Mount an image in a specified folder from the user
- Create a database of images to manage big collections
- Extract the Boot Image file of a CD/DVD or ISO
- Backup a CD-Audio to a *.bin image
- Complete localization for English, Italian, French, Spanish, Polish and much more!
- Quick and simple utility to Rip a DVD to Xvid AVI
- Quick and simple utility to convert a generic video (avi, mpeg, mov, wmv, asf) to Xvid AVI
- Quick and simple utility to convert a FLV video to AVI
- Utility to download videos from Youtube and Metacafe!
- Extract Audio from a video file
- Extract a *.rar archive that has a password
- Quick and simple utility to convert any video for Sony PSP Playstation Portable
- Display History that shows all images you mount in time

cam.vacau.com

Van mreže zarej

  • Administrator
  • Veteran
  • *****
  • Poruke: 2496
  • lose programe iskljucicu trajno...
Odg: Linux Tips & Tricks
« Odgovor #54 poslato: Januar 20, 2010, 10:32:08 »
Odlican je AcetoneIso koristio sam ranije verzije za mountovannje mdf imidza a sad vidim da je dodata jos gomila mogucnosti.
"Ne možes samo pitati korisnike šta je to što oni žele i onda se truditi da im to i daš. Dok ti to napraviš, oni će poželeti nešto drugo". (Inc Magazine, 1989.)

"Veoma je teško dizajnirati proizvod za određenu grupu. Često ljudi ne znaju šta žele dok im to ne pokažeš". (BusinessWeek, maj 1998.)

Van mreže cambridge

  • Hyper-aktivan član
  • ***
  • Poruke: 594
Odg: Linux Tips & Tricks
« Odgovor #55 poslato: Januar 20, 2010, 16:26:42 »
Josh samo da rezhe!

BTW Za rezanje koristim



Vrlo je lagan po pitanju koriscenja drugih paketa!

cam.vacau.com

Van mreže cambridge

  • Hyper-aktivan član
  • ***
  • Poruke: 594
Odg: Linux Tips & Tricks
« Odgovor #56 poslato: Mart 05, 2010, 15:34:37 »
Yeahconsole, Tilda i Yakuake su tri nacina da dobijete autohide terminal koji potseca na Quake-ov komandni prompt (jos dosta  igara ima tu opciju koja se aktivira na ~ taster).



Vrlo praktichna stvar! Ukoliko vam zatreba terminal, animirano se pojavljuje i da vam ne bi smetao u radu, po zelji nestaje sa desktopa.
cam.vacau.com