Showing posts with label how to. Show all posts
Showing posts with label how to. Show all posts

Friday, October 7, 2011

How to : Turn Autokey into super search application

First make script for "search invoke" and "search". There are 2 ways "search invoke", user input or direct search. For user Input I use this script:


result, text = dialog.input_dialog(title="Search", message="What do you want to search?")
if (result == 0  and text != ""):
    engine.run_script("search")


For direct search:



text = clipboard.get_selection()
if (text != ""):
    engine.run_script("search")



Please note that the text in blue is the name of the "search" script. You also have to bind keys to this script. As an example I use "super" + "space" for user input and "super"+"shift"+"space" for direct search because my experience on Gnome-Do, where they use the same button. But you can bind it any keys, that you find more comfortable.
The second part is the "search" script. The idea is actually pretty simple here. You have the text you want to search, you want to search that on the web and later your want web browser to open the page. Here is the default of my little super search application:

#First part - Youtube search

if(text[0:2]== "y "):
    text = text.replace(' ','+')
    system.exec_command("chromium-browser http://www.youtube.com/results?search_query=%s" %text[2:])
#Second part - default 
else:
    text = text.replace(' ','+')
    system.exec_command("chromium-browser http://www.google.de/webhp#q=%s" %text)   


Now I can search on specific website. But to do that I have to put some code to put it at work. In this case, to search on youtube I have to write "y " first, then after that the text I want to search. For default I will use google search.
These also some example of what it can do. Just copy paste it between first part and second part.

#Update computer

elif(text=="update"):
    system.exec_command("gksudo apt-get update && gksudo apt-get upgrade")

#Open multiple website
elif(text=="pack1"):
    system.exec_command("chromium-browser https://mail.google.com/mail/")
    system.exec_command("chromium-browser https://www.google.com/reader")
    system.exec_command("chromium-browser https://www.google.com/calendar/")

#Tell time or date
elif(text=="time"):
    date=system.exec_command("date +%T")    
    result, text = dialog.input_dialog(title="%s" %date, message="What do you want to search?")
    if (result == 0  and text != ""):
        engine.run_script("search")
elif(text=="date"):
    date=system.exec_command("date +%F")    
    result, text = dialog.input_dialog(title="%s" %date, message="What do you want to search?")
    if (result == 0  and text != ""):
        engine.run_script("search")

#Open application with our own keyword
elif(text=="terminal"):
    system.exec_command("gnome-terminal")


Please note that this code work if you have chromium browser. For another browser you have to change the word "chromium-browser" in the last line with another browser command.

Tuesday, September 13, 2011

How to : Recover forgotten password on windows

Resetarea parolelor Windows Pictures, Images and Photos
Good first two words
Yup, as it said, don't panic. If this case happen to you this maybe the answer.

Offline NT Password und Registry Editor


I have already used it, and it works great. You can download on their main page here. Don't forget to read the walkthrough, here.

Sunday, October 31, 2010

How to : solve resistor warming case mathematically

A magnetic coil, which made from copper have constant voltage. In operation the temperature is going higher from 12 degrees Celsius to 60 degrees Celsius. How much percentage has the electric current changed by the warming of the coil?
bonus. how much is the percentage of the resistor?
What we know?
voltage is constant
This function about how to search resistor from a certain temperature

= Resistor from temperature theta
= Resistor from referenced temperature
= coefficient from temperature which depend on the material
= referenced temperature (in most case 20 degrees Celsius)



what do we need to calculate


okay here is the answer


that is the way to search the resistor's percentage

then move to electric current


with that we can search for the percentage

thats all. 19% change on resistor and 16% on Electric current.

headfake from this post.

  • use Latex for this mathematic calculation
  • thanks to codecogs for letting me write latex on blogspot
  • i use lyx to get better view of what i calculate
  • it also give me another project about how to install latex plugin on Ubuntu