Showing posts with label hacks. Show all posts
Showing posts with label hacks. Show all posts

Sunday, November 20, 2011

Drupal 6 Pages and Feed RSS: set the offset and item's pagination.



If you have to change dinamically the number of items that are displayed on your feed page or do you need to set their offset via Drupal 6 Feed Rss Views Module, than this post could helps.

After googling for a couple of hours without find any solution to this issue, i tried to solve it by myself.
I would like to pass custom number of items and their offset as arguments of an url.

Something like this

http://www.yourdrupalwebsite.com/rss.xml?items-limit=5&items-offset=5

This page is a custom feed page created by the drupal's admin side .



/admin/build/views/edit/(rss-feed) (in my case)


After that you'll have to use this little hack that change a little piece of code inside the file

modules/views/plugins/views_plugin_display.inc

I found this piece of code on the line 1861. So i changed the following default settings:


$this->view->set_pager_element($this->get_option('pager_element'));$this->view->set_items_per_page($this->get_option('items_per_page'));
$this->view->set_offset($this->get_option('offset'));



and i replaced them with:


$this->view->set_items_per_page(($_GET['items-limit'] > 0) ? $_GET['items-limit'] : $this->get_option('items_per_page'));
$this->view->set_offset(($_GET['items-offset'] > 0) ? $_GET['items-offset'] :$this->get_option('offset'));



Save the file and you'll be ready to call your feed page with your custom arguments with it.

http://www.yourdrupalwebsite.com/rss.xml?items-limit=5&items-offset=5


and check the response.


Note:
You need to filter and sanitize your $_GET input values for security reasons.



Enjoy















Read more...

Sunday, March 21, 2010

[Solved] DocumentConverter.py via PHP on Linux RedHat Centos


This is a guide to fix the use of PYODConverter on linux RedHat Centos 5 box users.
If you wanna use DocumentConverter.py written by artofsolving, you have to follow those steps.

1)Install openoffice on your linux box or verify installation through commands:
Install Packages

yum install openoffice.org-xxx.

Check Packages

yum list | grep "openoffice".


2)Install python-uno bridge

3)Download DocumentConverter.py

4)Add the following line below "import uno"...

import sys
sys.path.append("/usr/lib/openoffice.org/program")


5)Run openoffice like a service with -headless and -nofirtstartwizard options.


/usr/lib/openoffice.org/program/soffice -nologo -nofirststartwizard -headless -norestore -invisible "-accept=socket,host=localhost,port=8100,tcpNoDelay=1;urp;"




The port 8100 must be the same for client and server obviously.


If you execute this php code



$cmd = "/usr/bin/python /var/www/html/DocumentConverter.py inputfile $outputfile.pdf 2>&1 | tee /var/www/html/mylog.txt"; // tee used to log output and errors of cmd
exec($cmd, $results);
printf("Exec Output: {".print_r($results).";}\n"); //print results of exec command


you'll probably get this error:


[Java framework] Error in function createSettingsDocument (elements.cxx).javaldx failed!

And other permissions problems on tmp dirs.

To solve this, simply add into your php script those lines of code

if (!file_exists("/tmp/ooohomedir"))
{
mkdir("/tmp/ooohomedir");
chmod("/tmp/ooohomedir", 0777);
}
putenv("HOME=/tmp/ooohomedir");







If you have another workaround about this please leave a comment below.
C u.


Read more...

Tuesday, January 13, 2009

Antenna Wireless Hacks

This video explains the easiest and cheapest way to hacks your wi-fi antennas.
The final result is that you could double signal strength and antenna's range for few cents and get a more omni-directional output (less fiddling with exact antenna placement) and a gain of 5 dB.





More infos and a step by step guide to hack your wifi antenna.


Read more...

Friday, December 12, 2008

Remote Nintendo Wii hacks

An amazing video in which Johnny Lee playing his Wii Remote hacks. He transform the $40 game piece into a digital whiteboard, in a touchscreen device and a head-mounted 3-D viewer.








Read more...

Thursday, June 5, 2008

Hacks iPhone and iPod Touch with Xeni

In this video Xeni checks in with the o'really authors of the "iPhone Hacks" (David Jurick, Adam and Damien Stolarz) for a demo on how to unlock, jailbreak and more other cool things that you'll can do with your iPhone or iPod Touch.








Via


Read more...

Wednesday, May 21, 2008

Make old extensions works with Firefox 3

The beta releases of Firefox 3.0 was released some days ago.




In Every release of a new beta version some of our old firefox extensions and add-ons become not more usable.
In the latest release of Firefox, exactly 3.0rc1 , almost none of them work.


There's an easy solution to this problem and it come from computerworld.com.au

THEY repeats:DO NOT TRY THIS unless you are comfortable editing the advanced preferences of your browser. And don't do anything until you've read through this entire post.


1) Type about:config in Firefox 3.0rc1
2) Add a new Boolean var
3) Type extensions.checkCompatibility
4) Set it to false
5) Restart Firefox

When the browser comes back up, version checking is disabled so the browser could warn you about this. You can double-check "Tools:Add-Ons" to make sure everything is activated once again.

If this procedure fails you have to go manually to your prefs.js and remove the var that you inserted in the step 3.


From Computerworld.com.au

Img credit


Read more...

Thursday, May 15, 2008

Video: HowToSearch Google Hacks: Find Any Song, Software and Movies

In this video you could see how to use google to find everything you want.
An example that show you how it works:
Go on google or click the link below:
"intitle:index of: " song MP3
"intitle:index of: " song swf

Google is your best friend if you know how to use it.



HowTo: Google Search Hack : Find Almost Any Song/Program/Movie


Read more...

Thursday, May 1, 2008

What's Hack?!?

Utrecht station: A guy hacks the monitor panel...
Enjoy it



Read more...

Thursday, April 24, 2008

how to increase wifi signal

A little "trick" on how to increase your wifi signal.


Read more...

hacking internet ip cameras

You could find IP webcam view live simple searching with Google:


Hacking Internet Cameras - video powered by Metacafe


Some examples on how to do this are the follows:

inurl:ViewerFrame?Mode=
inurl:ViewerFrame?Mode=Refresh
inurl:axis-cgi/jpg
inurl:axis-cgi/mjpg (motion-JPEG)
inurl:view/indexFrame.shtml
inurl:view/index.shtml
inurl:view/view.shtml
liveapplet
intitle:”live view” intitle:axis
intitle:liveapplet
allintitle:”Network Camera NetworkCamera”
intitle:axis intitle:”video server”
intitle:liveapplet inurl:LvAppl
intitle:”EvoCam” inurl:”webcam.html”
intitle:”Live NetSnap Cam-Server feed”
intitle:”Live View / - AXIS”
intitle:”Live View / - AXIS 206M”
intitle:”Live View / - AXIS 206W”
intitle:”Live View / - AXIS 210″
inurl:indexFrame.shtml Axis
inurl:”MultiCameraFrame?Mode=Motion”
intitle:start inurl:cgistart
intitle:”WJ-NT104 Main Page”
intext:”MOBOTIX M1″ intext:”Open Menu”
intext:”MOBOTIX M10″ intext:”Open Menu”
intext:”MOBOTIX D10″ intext:”Open Menu”
intitle:snc-z20 inurl:home/
intitle:snc-cs3 inurl:home/
intitle:snc-rz30 inurl:home/
intitle:”sony network camera snc-p1″
intitle:”sony network camera snc-m1″
site:.viewnetcam.com -www.viewnetcam.com
intitle:”Toshiba Network Camera” user login
intitle:”netcam live image”
intitle:”i-Catcher Console - Web Monitor”



Others:

/view/view.shtml axis
sample/LvAppl/
control/userimage.html
“(c)copyright 1999-2003 VICTOR COMPANY OF JAPAN, LIMITED. All rights reserved”
“V.Networks [Motion Picture(Java)”
“Control the Pan/Tilt and move to the Preset Position”
/app/idxas.html
“Saving & Retrieving Mode”
/ViewerFrame?Mode=Motion
“TOSHIBA Network Camera - User Login”
/home/homeJ.html
“my webcamXP server!”



Also websites groups those live webcam and list them.

http://www.theone.se/linkto/axiscams.html

http://www.butterfat.net/goocam/

http://www.griffid.com/?page=livecams


Read more...