Archive

Archive for June, 2008

Arnes preverjanje domen

June 30th, 2008 karlosp No comments
Categories: Malo mešano Tags:

Protected: TextAloud 2.274

June 29th, 2008 karlosp Enter your password to view comments.

This post is password protected. To view it please enter your password below:


Categories: Pesmica Tags:

Plot ab results with gnuplot

June 28th, 2008 karlosp No comments

Save to echo-gnu-plot.sh

CODE:
  1. echo "set terminal png"
  2. echo "set output \"$1.png\""
  3. echo "set xlabel \"Request\""
  4. echo "set ylabel \"ms\""
  5. echo "plot \"$1.txt\" using 10 with lines title \"Response time\""

Run ab
ab -g my-page.txt -n 1000 -c 100 http://mypage.net/

Run
sh echo-gnu-plot.sh my-page

Copy the output
Run

CODE:
  1. gnuplot

then paste from clip board
see the image my-page.png

ab gnuplot

ab and gnuplot

Categories: Fax, Malo mešano Tags:

Protected: Deluxe ski jump 3 v1.5.0

June 24th, 2008 karlosp Enter your password to view comments.

This post is password protected. To view it please enter your password below:


Categories: Pesmica Tags:

Web 3.0 semantics RDF

June 23rd, 2008 karlosp No comments

en.wikipedia.org/wiki/Semantics

Categories: Malo mešano Tags:

Java MySql connection (povezava)

June 23rd, 2008 karlosp No comments

Copy mysql-connector-java-3114-bin to C:\Program Files\Java\jre1.6.X\lib\ext

JAVA:
  1. import java.sql.Connection;
  2. import java.sql.DriverManager;
  3. import java.sql.SQLException;
  4.  
  5. // Notice, do not import com.mysql.jdbc.*
  6. // or you will have problems!
  7.  
  8. public class LoadDriver {
  9.  
  10.     Connection conn = null;
  11.    
  12.     public static void main(String[] args) {
  13.         try {
  14.         // The newInstance() call is a work around for some
  15.         // broken Java implementations
  16.  
  17.         Class.forName("com.mysql.jdbc.Driver").newInstance();
  18.         conn =
  19.         DriverManager.getConnection("jdbc:mysql://localhost/test?" +
  20.                                    "user=monty&password=greatsqldb");
  21.                                   
  22.         Statement stmt = null;
  23.         ResultSet rs = null;
  24.  
  25.         stmt = conn.createStatement();
  26.         rs = stmt.executeQuery("SELECT foo FROM bar");
  27.  
  28.         // or alternatively, if you don't know ahead of time that
  29.         // the query will be a SELECT...
  30.  
  31.         if (stmt.execute("SELECT foo FROM bar")) {
  32.             rs = stmt.getResultSet();
  33.         }
  34.  
  35.         } catch (Exception ex) {
  36.             // handle any errors
  37.             System.out.println("SQLException: " + ex.getMessage());
  38.             System.out.println("SQLState: " + ex.getSQLState());
  39.             System.out.println("VendorError: " + ex.getErrorCode());
  40.  
  41.         }
  42.         finally {
  43.         // it is a good idea to release
  44.         // resources in a finally{} block
  45.         // in reverse-order of their creation
  46.         // if they are no-longer needed
  47.  
  48.         if (rs != null) {
  49.             try {
  50.                 rs.close();
  51.             } catch (SQLException sqlEx) { } // ignore
  52.  
  53.             rs = null;
  54.         }
  55.  
  56.         if (stmt != null) {
  57.             try {
  58.                 stmt.close();
  59.             } catch (SQLException sqlEx) { } // ignore
  60.  
  61.             stmt = null;
  62.         }
  63.     }   
  64. }

JAVA:
  1. import java.sql.*;
  2.  
  3. public class Jdbc10 {
  4.   public static void main(String args[]){
  5.     System.out.println(
  6.                   "Copyright 2004, R.G.Baldwin");
  7.     try {
  8.       Statement stmt;
  9.       ResultSet rs;
  10.  
  11.       //Register the JDBC driver for MySQL.
  12.       Class.forName("com.mysql.jdbc.Driver");
  13.  
  14.       //Define URL of database server for
  15.       // database named JunkDB on the localhost
  16.       // with the default port number 3306.
  17.       String url =
  18.             "jdbc:mysql://localhost:3306/JunkDB";
  19.  
  20.       //Get a connection to the database for a
  21.       // user named auser with the password
  22.       // drowssap, which is password spelled
  23.       // backwards.
  24.       Connection con =
  25.                      DriverManager.getConnection(
  26.                         url,"auser", "drowssap");
  27.  
  28.       //Display URL and connection information
  29.       System.out.println("URL: " + url);
  30.       System.out.println("Connection: " + con);
  31.  
  32.       //Get a Statement object
  33.       stmt = con.createStatement();
  34.  
  35.       //As a precaution, delete myTable if it
  36.       // already exists as residue from a
  37.       // previous run.  Otherwise, if the table
  38.       // already exists and an attempt is made
  39.       // to create it, an exception will be
  40.       // thrown.
  41.       try{
  42.         stmt.executeUpdate("DROP TABLE myTable");
  43.       }catch(Exception e){
  44.         System.out.print(e);
  45.         System.out.println(
  46.                   "No existing table to delete");
  47.       }//end catch
  48.  
  49.       //Create a table in the database named
  50.       // myTable.
  51.       stmt.executeUpdate(
  52.             "CREATE TABLE myTable(test_id int," +
  53.                   "test_val char(15) not null)");
  54.  
  55.       //Insert some values into the table
  56.       stmt.executeUpdate(
  57.                 "INSERT INTO myTable(test_id, " +
  58.                     "test_val) VALUES(1,'One')");
  59.  
  60.       //Get another statement object initialized
  61.       // as shown.
  62.       stmt = con.createStatement(
  63.                ResultSet.TYPE_SCROLL_INSENSITIVE,
  64.                      ResultSet.CONCUR_READ_ONLY);
  65.  
  66.       //Query the database, storing the result
  67.       // in an object of type ResultSet
  68.       rs = stmt.executeQuery("SELECT * " +
  69.                 "from myTable ORDER BY test_id");
  70.  
  71.       //Use the methods of class ResultSet in a
  72.       // loop to display all of the data in the
  73.       // database.
  74.       System.out.println("Display all results:");
  75.       while(rs.next()){
  76.         int theInt= rs.getInt("test_id");
  77.         String str = rs.getString("test_val");
  78.         System.out.println("\ttest_id= " + theInt
  79.                              + "\tstr = " + str);
  80.       }//end while loop
  81.  
  82.       //Display the data in a specific row using
  83.       // the rs.absolute method.
  84.       System.out.println(
  85.                         "Display row number 2:");
  86.       if( rs.absolute(2) ){
  87.         int theInt= rs.getInt("test_id");
  88.         String str = rs.getString("test_val");
  89.         System.out.println("\ttest_id= " + theInt
  90.                              + "\tstr = " + str);
  91.       }//end if
  92.  
  93.       //Delete the table and close the connection
  94.       // to the database
  95.       stmt.executeUpdate("DROP TABLE myTable");
  96.       con.close();
  97.     }catch( Exception e ) {
  98.       e.printStackTrace();
  99.     }//end catch
  100.   }//end main
  101. }//end class Jdbc10

Categories: Java, Malo mešano Tags:

Linksys WRT54GL with dd-wrt change wlan password

June 22nd, 2008 karlosp No comments
CODE:
  1. #!/bin/sh
  2.  
  3. a=`date +%e%m%y`
  4. let "a = $a * $a"
  5. let "a = $a % 999999999"
  6. echo $a> /jffs/g.txt
  7. #po rebootu se izbrise uporabi
  8. #nvram set rc_startup="cp /jffs/g.txt  /tmp/www/g.htm"
  9. echo $a> /tmp/www/g.htm
  10. echo Pass: $a
  11. nvram set wl0_wpa_psk=$a
  12. nvram commit
  13. reboot
  14. echo OK

Categories: Malo mešano Tags:

cURL

June 16th, 2008 karlosp No comments
PHP:
  1. function disguise_curl($postaja, $proga)
  2. {
  3.   $curl = curl_init();
  4.  
  5.   // Setup headers - I used the same headers from Firefox version 2.0.0.6
  6.   // below was split up because php.net said the line was too long. :/
  7.   $header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
  8.   $header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
  9.   $header[] = "Cache-Control: max-age=0";
  10.   $header[] = "Connection: keep-alive";
  11.   $header[] = "Keep-Alive: 300";
  12.   $header[] = "Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7";
  13.   $header[] = "Accept-Language: sl, en-us,en;q=0.5";
  14.   $header[] = "Pragma: "; // browsers keep this blank.
  15.  
  16.   curl_setopt($curl, CURLOPT_URL, 'http://bus.talktrack.com/Default.aspx');
  17.   curl_setopt($curl, CURLOPT_USERAGENT, 'Googlebot/2.1 (+http://www.google.com/bot.html)');
  18.   curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
  19.   curl_setopt($curl, CURLOPT_REFERER, 'http://www.google.com');
  20.   curl_setopt($curl, CURLOPT_ENCODING, 'gzip,deflate');
  21.   curl_setopt($curl, CURLOPT_AUTOREFERER, true);
  22.   curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  23.   curl_setopt($curl, CURLOPT_TIMEOUT, 10);
  24.     curl_setopt($curl, CURLOPT_POST, true);
  25.     curl_setopt($curl, CURLOPT_POSTFIELDS,'__VIEWSTATE=%2FwEPDwUKLTgzNjU3NTU0NmRkyqriZHRludwvoChm7gDsbpNBymw%3D&tb_stationNo='.$postaja.'&tb_routeNo='.$proga.'&b_submit=Prika%C5%BEi');
  26.  
  27.   $html = curl_exec($curl); // execute the curl command
  28.   curl_close($curl); // close the connection
  29.  
  30.   return $html; // and finally, return $html
  31. }

Categories: Malo mešano Tags:

mRadar

June 15th, 2008 karlosp No comments
Categories: Malo mešano Tags:

Najdi.si zemljevid img link

June 11th, 2008 karlosp No comments

http://zemljevid.najdi.si/servlet/mapImage?id=dW2tWD&zoom=7&width=600&height=400&gkx=447157&gky=113601

Categories: Malo mešano Tags:

Ettercap 0.7.3 for PCLinuxOS

June 8th, 2008 karlosp No comments

Install:

CODE:
  1. rpm -ivh ettercap-ng-073-1mdv20070i586.rpm

ettercap 0.7.3

ettercap -G

Categories: Linux Tags:
101910 pages viewed, 155 today
53342 visits, 91 today
FireStats icon Powered by FireStats