Archive for the 'codes' Category

revers caller lookup for android in austria #update

7 Comments

I found a nice and also free application on the android market called “Lookup Incoming Call

It currently supports a lookup for:

  • Sweden (Hitta.se)
  • whitepages.com (US)
  • GoYellow.de (DE)

and it also supports a custom lookup!

so i decided to program a little script to lookup phone numbers in Austria.

After two days of coding (python) it’s finished.

just add this URL to your custom provider:

http://server.true-binary.com/_lookup/index.py/get_info?number=P

and you are done.

It will show you the name and the street of the caller.

for example:

Max Mustermann – Home Street 6a

if anything is missing, tell me.

cheerio, chaos

################################

#1 UPDATE:

added support for two more countries:

  • GERMANY
  • SWITZERLAND

################################

#2 UPDATE:

Because of DNS problems the server was unreachable for a few days.

It should work again on July, 28, 2009 18:00 (GMT+2)

################################

hostinfo – ported to openmoko #update1

1 Comment

update1:

nmap is now running!

you have to add the angstrom repository to your okpg source:

echo "arch base 50" > /etc/opkg/angstrom-feed.conf
echo "src/gz base http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv4t/base" >> /etc/opkg/angstrom-feed.conf

and then just type:

opkg update && opkg install nmap

or reinstall the install file!

done =]

original post:

as i promised, the first application was ported to the openmoko freerunner (tested under om2008.9 with the newest kernel)

just download this file: install

and type “sh install.sh”

should work ;)

greetz

bugs:

*tracerouting problem

*nmap problem(at the moment there is no whois package in the om repository [i will have a look])

*whois problem(at the moment there is no whois package in the om repository [i will have a look])

*scrolling problem

MD5 of install file: ceeb65655c95e9835339a568f89905b0

kaffeine-sc plugin 0.4.0 on ubuntu

6 Comments

have you ever tryed to compile the kaffeine-sc-plugin (softcam plugin for kaffeine) on ubuntu?

after installing all the lib-packages (X-libs, kernel headers, and so on), you get the message:

Good – your configure finished. Start make now

okay, what shall we do now?

we gonna type “make” now

now it tries to compile but we get an error-message like this:

make[3]: g++34: Kommando nicht gefunden
make[3]: *** [FFdecsa_test.o] Fehler 127
make[3]: Verlasse Verzeichnis ‘/home/chaos/kaffeine-sc-plugin-0.4.0/src/FFdecsa’

so let us have a look into the “Makefile” located in the “src/FFdesca” directory.

we just have to find the line:

COMPILER=g++34

and change it to:

COMPILER=g++

and now retry to compile the plugin (make)

aaand it works, now we have to install it:

make install

finished!

Where is the Softcam key file stored?

it’s located in ~/.kaffeine/SoftCam.Key (case-sensetive)

everything should work now : )

greetz chaos

backup script

Add a comment

Here’s a [new] backup script:

  1. #!/usr/bin/python
  2. # -*- encoding: iso-8859-15 -*-
  3. ### under GPL
  4. ### (c) chaos – www.true-binary.com
  5. #####################################
  6.  
  7. import os
  8. import sys
  9. import time
  10.  
  11. datum=time.strftime(‘%d-%m-%Y_%H-%M’)
  12.  
  13. def makemeclear():
  14.  os.system("clear")
  15. makemeclear()
  16.  
  17.  
  18. a=raw_input(‘type in the full path [example: /var/www/mysite/]: ‘)
  19. b=raw_input(‘name of the backup-file: ‘)
  20.  
  21. ####################
  22. #make a tar.gz file:
  23. ####################
  24. def makebackuptar(datum,a,b):
  25.  print ""
  26.  print "please stand by while creating the backup …"
  27.  print ""
  28.  os.system(‘tar -czvf ‘+b+‘_’+datum+‘.tar.gz ‘+a)
  29.  print ""
  30.  print "backup done whiteout any problems!"
  31.  print ""
  32.  sys.exit(0)
  33.  
  34. #################
  35. #make a zip file:
  36. #################
  37. def makebackupzip(datum,a,b):
  38.  print ""
  39.  print "please stand by while creating the backup …"
  40.  print ""
  41.  os.system(‘zip -9 ‘+b+‘_’+datum+‘.zip ‘+a+‘*’)
  42.  print ""
  43.         print "backup done whiteout any problems!"
  44.         print ""
  45.         sys.exit(0)
  46.  
  47. #####################
  48. #ask for compression:
  49. #####################
  50. def askcomp1(datum,a,b):
  51.  c=raw_input(‘type "1" for TAR-GZ or "2" for ZIP: ‘)
  52.  for i in c:
  53.          if c == "1":
  54.                  makebackuptar(datum,a,b)
  55.    pass
  56.          if c == "2":
  57.                  makebackupzip(datum,a,b)
  58.    pass
  59.          else:
  60.    print ""
  61.    print "uuups, just type in 1 or 2 … please try again … [or type CTRL+C to exit]"
  62.    print ""
  63.    askcomp1(datum,a,b)
  64.  
  65. askcomp1(datum,a,b)

DOWNLOAD
MD5: 97ab6c16809ecb346275173010907ca1

what can this script do?
as you can see in the above source, the script asks you for the full path for the backup and the filename for the backup file (automated timestamp added[not unix time])
after your input, the script asks you for your compression choise (tar.gz or zip)
and then – FINISH!

cheerz chaos

hostinfo

3 Comments

here’s a preview of a little helpfull GUI-tool to get some host infos:

  1. #!/usr/bin/python
  2. # -*- coding: iso8859-15 -*-
  3. ### under GPL
  4. ### (c) chaos — www.true-binary.com
  5. #####################################
  6.  
  7.  
  8. from Tkinter import *
  9. from tkMessageBox import *
  10. from tkColorChooser import askcolor
  11. from tkFileDialog   import *
  12. import socket
  13. import urllib
  14. import os
  15. import httplib
  16. import string
  17.  
  18.  
  19. ###global vars:
  20. ###############
  21.  
  22. def about():
  23.         showinfo(‘ABOUT’, "Thanks for using this little tool… \n\n…it’s brought you by chaos\n\n www.true-binary.com")
  24.  
  25. def file_save():
  26.         file=asksaveasfile(mode=‘w’)
  27.         text2save = str(textfenster.get(0.0,END))
  28.         file.write(text2save)
  29.         file.close()
  30.  
  31. ###textbox, scrollbar, entry-field and menubar:
  32. ###############################################
  33.  
  34. root = Tk()
  35. root.title(‘hostinfo – www.true-binary.com’)
  36. menubar = Menu(root)
  37. root.config(menu=menubar)
  38. file_menu = Menu(menubar)
  39. menubar.add_cascade(label="File", underline=1, menu=file_menu)
  40. file_menu.add_command(label="Save as", command=file_save)
  41. file_menu.add_separator()
  42. file_menu.add_command(label="Exit", command=root.quit)
  43. help_menu = Menu(menubar)
  44. menubar.add_cascade(label="Help", underline=1, menu=help_menu)
  45. help_menu.add_command(label="About", command=about)
  46. scrollbar = Scrollbar(root)
  47. scrollbar.pack(side=RIGHT, fill=Y)
  48. textfenster = Text(root,width=100,background="#FAF0E6", yscrollcommand=scrollbar.set)
  49. textfenster.pack()
  50. textfenster.config(yscrollcommand=scrollbar.set)
  51. scrollbar.config(command=textfenster.yview)
  52. eingabe = Entry(root,background="#FAEBD7",width=40)
  53. eingabe.pack(side=LEFT)
  54.  
  55. line="################################################ \n################################################ \n################################################\n"
  56.  
  57. ###definitions:
  58. ###############
  59.  
  60. ###getip:
  61. #########
  62.  
  63. def hole():
  64.         c=eingabe.get()
  65.         d=socket.gethostbyaddr(c)
  66.         d2=d[2]
  67.         d2=str(d2)
  68.         d2=d2[:-2][2:]
  69.         e="IP-Adresse:\t"+str(d2)
  70.         textfenster.insert(END, \n + e)
  71.         textfenster.insert(END, \n\n + line)
  72.  
  73. ###whois:
  74. #########
  75.  
  76. def whois():
  77.         geteingabe=eingabe.get()
  78.         d=socket.gethostbyaddr(geteingabe)
  79.         d2=d[2]
  80.         d2=str(d2)
  81.         d2=d2[:-2][2:]
  82.         e=os.popen("whois "+str(d2)+" 2>&1")
  83.         file.close
  84.         for i in e:
  85.                 textfenster.insert(END, "\n " + str(i))
  86.         textfenster.insert(END, \n\n + line)
  87.  
  88. ###ping host:
  89. #############
  90.  
  91. def ping():
  92.         geteingabe=eingabe.get()
  93.         ping = os.popen(‘ping -c 3 -i 1 ‘+geteingabe+‘ 2>&1′)
  94.         data = ping.read()
  95.         textfenster.insert(END, "\n" + data)
  96.         textfenster.insert(END, \n\n + line)
  97.  
  98. ###get HTTP header:
  99. ###################
  100.  
  101. def header():
  102.         geteingabe=eingabe.get()
  103.         h=httplib.HTTP(geteingabe)
  104.         h.putrequest(‘HEAD’, ‘/ HTTP/1.0′)
  105.         h.endheaders()
  106.         errcode, errmsg, headers = h.getreply()
  107.         f = h.getfile()
  108.         data = f.read()
  109.         f.close()
  110.         textfenster.insert(END, "\n" + str(headers))
  111.         textfenster.insert(END, \n\n + line)
  112.  
  113. ###traceroute:
  114. ##############
  115.  
  116. def traceroute():
  117.         geteingabe=eingabe.get()
  118.         trace=os.popen(‘traceroute -n -m 15 ‘+geteingabe+‘ 2>&1′)
  119.         data=trace.read()
  120.         textfenster.insert(END, "\n" + data)
  121.         textfenster.insert(END, \n\n + line)
  122.  
  123. ###nmap(ports:21,22,23,80,443,3306,3389:
  124. ########################################
  125.  
  126. def nmap():
  127.         showinfo(‘nmap info’, "If you are not running this program as root, you have to change the SUID flags to 4751\n\ndebian/*buntu:\tsudo chmod 4751 /usr/bin/nmap")
  128.         geteingabe=eingabe.get()
  129.         mapit=os.popen(‘nmap -sT -p 21,22,23,80,443,3306,3389 -R ‘+geteingabe+‘ 2>&1′)
  130.         data=mapit.read()
  131.         textfenster.insert(END, "\n" + data)
  132.         textfenster.insert(END, \n\n + line)
  133.  
  134. ###clear:
  135. #########
  136. def clear():
  137.         textfenster.delete("1.0", END)
  138.  
  139.  
  140. ###buttons:
  141. ###########
  142.  
  143. butGetIP = Button(root,background="green",text=‘getIP’, command = hole)
  144. butGetIP.pack(side = LEFT)
  145. butWhois = Button(root,background="green",text="whois",command = whois)
  146. butWhois.pack(side = LEFT)
  147. butTrace = Button(root,background="green",text="traceroute",command = traceroute)
  148. butTrace.pack(side = LEFT)
  149. butPing = Button(root,background="green",text="ping",command = ping)
  150. butPing.pack(side = LEFT)
  151. butNmap = Button(root,background="green",text="nmap",command = nmap)
  152. butNmap.pack(side = LEFT)
  153. butHeader = Button(root,background="green",text="header",command = header)
  154. butHeader.pack(side = LEFT)
  155. butClear = Button(root,background="white",text="clear",command = clear)
  156. butClear.pack(side = LEFT)
  157.  
  158. root.mainloop()


DOWNLOAD
MD5: eaec3043e17bf24e7aeca75675fa36c8

what you can do with this script:

  1. URL to IP
  2. whois
  3. traceroute
  4. ping
  5. nmap
  6. get HTTP header
  7. save the content

what you need for this script:

  1. httplib2
  2. Tkinter
  3. whois
  4. nmap
  5. traceroute
  6. ping
  7. nc(netcat)

how to install:

  • sudo apt-get update && apt-get install nmap netcat whois python-tk python-httplib2

normaly ping and traceroute is installed.

much fun with it =]

EDIT:

first of all, thanks to ap0calypse for the feedback!
i had a look at the source and i changed it(yes, you are right)

as you can see, i changed the lines 64-69 from:

  1. d2=d[2]
  2. d3=str(d2)
  3. d4=d3[:-2]
  4. d5=d4[2:]
  5. ip=str(d5)
  6. e="IP-Adresse:\t"+ip

to:

  1. d2=d[2]
  2. d2=str(d2)
  3. d2=d2[:-2][2:]
  4. e="IP-Adresse:\t"+str(d2)

and the lines 79-90 from:

  1. d2=d[2]
  2. d3=str(d2)
  3. d4=d3[:-2]
  4. d5=d4[2:]
  5. ip=str(d5)
  6. e=os.system("whois "+ip+" >> ip.txt")
  7. file=open("ip.txt","r")
  8. f=file.readlines()
  9. file.close
  10. for i in f:
  11.      textfenster.insert(END, "\n " + str(i))
  12. os.system("rm -r ip.txt")

to:

  1. d2=d[2]
  2. d2=str(d2)
  3. d2=d2[:-2][2:]
  4. e=os.popen("whois "+str(d2)+" 2>&1")
  5. file.close
  6. for i in e:
  7.         textfenster.insert(END, "\n " + str(i))

also the MD5 checksum has changed, upload complete.

greetz chaos