Python Ask.fm IP of Anonymous Questions - python

I got much anonymous questions that attack my friendship.
Is there a way to get the IP-Adresss of these Questions with a Python script?
I have little more than normal Python knowledge, so you mustn't show me complete Code, just 1-5 lines or just explain something.
I hope you'll help me!

If the IPs are not logged by ask.fm, there is not much you can do about it. And if it's logged, you probably don't need any script to extract it, as it should be presented somewhere along with the questions or separately in some list.

In addition to #Michael's answer, even if you might be able to get the IP you won't be able to do much. Most of people also use dynamic IP addresses.
You may want to contact ask.fm to get more informations, it's very hard they will give you them though.

Related

How can you higher your Ping with the help of Python

My friend asked me as a Joke if I can make a "programm" that will higher your ping.
So that you will have a little delay.
The Problem is that i want to this in python cause i want to learn it.
And I have less to no experience in python.
Everybody that had a clue how python works wanted me to reset the whole program to do that (like System.Threading.Thread.Sleep(1000)). But when I told them that I want to reset or delay the Internet on my computer so if I send a package to the server the answer needs +5sec to get back they had no Idea.
I have no code that could help you help me cause I only have the GUI and some irrelevant and independet other features ready.
So if anyone can show me how this in python could work or give me at least an idea how I could try it, it would be awesome.
Thanks for reading and maybe even helping :D
Leo

How to know if excel file has macros using python?

HI I am new managing excel files, I would like to know if there is any variable in xlutils, xlrd, xlm, etc libraries that give true or false in case Macros are activated or now? Is there any way to know it from metadata before open? Wat is the best approach for know it?
Thanks a lot in advance.
It's technically possible but very unlikely that Excel is calling any Python functions.
A quick Google Search shows lots of people asking if VBA can use Python, and a few theoretical responses, but nothing solid.
What I would do to confirm, is move all the "mystery python scripts" to another folder. If someone complains that things suddenly don't work any more, then move them back.
If a couple months pass and everything's still working properly, it's unlikely that anyone needs them.
Edit:
Figures... as I was writing that answer someone posted a VBA/Python question!
...but out of curiousity, I queried SE Data Explorer:
Questions with tags like %vba% or %excel%: 212,299
Questions with tags like %python% and (%vba% or %excel%): 5,808 (2.7%)

How to allow allow more than one download at the same time

I'm developing an application that will send files to an user, but I need to send more than one at the same time and what is happening is that when he is downloading the first one, the page still loading until the first one has finished so then it starts...
Wha I'd like to know what can I do to send more than one at the same time. Is that some sort of nginx/apache configuration? Does anyone has some tip for me study or something like that?
Thank you!
Is there anyway you could have the file delivery system use threads?
http://docs.python.org/2/library/threading.html
Any threading documentation will be better that what I will be able to explain, but essentially you'll have
class MyMainThing(object):
def __init__(things):
#everything in your site
def user_clicked_download(self):
threading.Thread(target=download_file(arg),).start() # threading takes tuple arg
def download_file(arg):
# your downloading stuff.
Sorry for the vague example, if you include code I might be able to explain better, but you asked for something you can research, and threading seems like it would definitely help you out here. Also, it's basically mandatory if you want to do multiple things at once.
Let me know if you need a better explanation or have any questions. I'll answer as best I can!

How to use SVG DOM in Python

This question may sounds dumb, but I can't manage to find a correct answer on my own.
I am trying to use the SVG DOM interface in my python script. I would like to use getComputedTextLength but I can't find how even if I firstly thought it would be available thanks to modules or a packages like python-svg or something like that.
I am sure there is something I miss, but I can't find what.
Any help would be appreciated.
Thank you.
EDIT: I forgot to talk about what my script actually does. It's a Python script used to generate a SVG file from data grabbed on the Internet. My script needs to write texts and repeat them all along a path. Also, as I know the exact length (in pixels) of the path I need to know the length of the text in order to repeat it only what I need to. That's why a method like getComputedTextLength would be helpful.
Try this: http://www.gnu.org/software/pythonwebkit/
I don't think this is possible. DOM is one thing and calling browser's function is other thing. I only saw Python module which help you to create tree structures like HTML or SVG but they don't provide any other additional functionality. (Btw., last time I look even browsers had problems correctly computing getComputedTextLength but that was some time ago...)
You could try better luck with fonttools.

How to encrypt files in twisted?

I'm using twisted to create a server.
Problem is, I must protect my code. Since I don't want to publish it, I'm not really interess into obfuscation or compilation of the python code.
My problem is, my twisted application must run with root uid and a lot of people have root access to this server.
I don't care if they can read it, but I want sure they can't modify it!
What is the best solution, knowing I'm using twisted? I've seen in twistd, tapconvert and mktap that twisted can "encrypt" my code, but I didn't find any good documentation about that.
Anybody to help me?
Thanks in advance for any answer =)
Have a nice day!
/!\ EDIT:
I got another question, I've wrote my code following this part of twisted documentation: http://twistedmatrix.com/documents/current/core/howto/application.html so I launch my server using a command like twistd -y server.py --logfile ...
Since I'm doing that, I assume I can't use software like cx_Freeze to hide my code right ?
You have a number of problems here.
my twisted application must run with root uid
This is bad. If there are vulnerabilities in your application, then they will be made more serious by running as root. You should consider finding a way to not run as root. For example, if you only run as root so you can bind to a low numbered port, consider using authbind instead.
a lot of people have root access to this server
Perhaps you should limit privileged access to those people who actually need it. If that isn't an option, then perhaps you should at least limit access to people you can trust. Someone who has root on a machine can do anything they want on that machine, and defeat any scheme you dream up.
I don't care if they can read it, but I want sure they can't modify it!
You should ask them not to modify it, then.
I've seen in twistd, tapconvert and mktap that twisted can "encrypt" my code, but I didn't find any good documentation about that. Anybody to help me?
You shouldn't bother trying to use the encryption features of twistd and mktap. These don't prevent anyone from changing your code. At best they might prevent someone from reading some of it. As you said, this isn't even your goal. Even if it were your goal, someone with root access will be able to decrypt these files easily, so it doesn't even help there.
If you give code to someone, expect them to be able to do anything and everything they want with it. If you put code on a server, you are effectively giving it to everyone with root access to that server.
So, stop thinking about encryption and other technical issues and think of some other way to achieve your goals - fire the untrustworthy administrators, use an appropriate license on the code, get an actual contract, etc.
AFAIK, there is no way to prevent a root user from modifying a plain text file. Root is just that, they can do anything they want with it including modifying. Why do so many people have root access to the machine anyway?
If you're concerned, you really have two options:
Encrypt the files in whatever way you want (I don't know if Twisted does it or how)
'Compile' the code for your platform. There are a few Python compilers out there but I don't know if they work with Linux. I'm a free software guy so I want people to read and modify my code. Protecting it doesn't concern me.
I guess you do have a third option of protecting it legally with a license. But if they violate your license then there's the cost of taking them to court over it.
Not many options. Sorry.
Anthony

Categories

Resources