Thursday, February 10, 2011
Sunday, February 6, 2011
isset(), empty(), is_null(), == null
Despite using PHP every day, I had confusion among the above function (empty() and isset() are language constructs)
After some experience with Zend framework, I now use
After some experience with Zend framework, I now use
isset($var)
defined(CONST)and
null === func()i could have replaced that with
if (func())but none of my functions return false, 0, '' in case of an error
Monday, December 20, 2010
Speeding up torrents in uTorrent
Most common reason for slow torrents is that the number of seeds are low or the upload speed of the seeds is limited. To overcome this problem
right click the torrent in uTorrent and select copy magnet URI. The magnet URI is similar to
go to http://darkfader.net/toolbox/convert/ and convert the 32 bit hash code into 16 bit hash code. And search for the resulting 16 bit code. The search will give alternate download locations. Download the .torrent files add them to uTorrent and allow uTorrent to add trackers from the file.
This approach will be helpful if the availability of the torrent is low or to verify the authenticity of the torrent
right click the torrent in uTorrent and select copy magnet URI. The magnet URI is similar to
magnet:?xt=urn:btih:RB4BJJ65RL6OEA5STGYG4ER6WW2K5DFXhere RB4BJJ65RL6OEA5STGYG4ER6WW2K5DFX is a 32 bit hash code
go to http://darkfader.net/toolbox/convert/ and convert the 32 bit hash code into 16 bit hash code. And search for the resulting 16 bit code. The search will give alternate download locations. Download the .torrent files add them to uTorrent and allow uTorrent to add trackers from the file.
This approach will be helpful if the availability of the torrent is low or to verify the authenticity of the torrent
Labels:
torrents
Thursday, November 25, 2010
Take snapshot of an web page
After some searching i found CutyCapt to suit my needs.
After successful installation it gave me the error
After some searching i found out that that error means that QImage::__construct is failing.
The constructor is failing because i am behind a proxy and CutyCapt did not find any content to create an image
./CutyCapt --url=http://www.google.org --out=example.png --http-proxy=http://144.16.192.245:8080
worked finally
After successful installation it gave me the error
QPainter::begin: Paint device returned engine == 0, type: 3
After some searching i found out that that error means that QImage::__construct is failing.
The constructor is failing because i am behind a proxy and CutyCapt did not find any content to create an image
./CutyCapt --url=http://www.google.org --out=example.png --http-proxy=http://144.16.192.245:8080
worked finally
Labels:
linux
Sunday, November 21, 2010
Apache Mod Rewite
Apache Mod Rewrite is enabled and Rewrite Engine is on, yet rewrite is not working
Likely reason is that AllowOverride is set to None. Changing back to All will resolve the problem
If the problem persists try
Likely reason is that AllowOverride is set to None. Changing back to All will resolve the problem
If the problem persists try
RewriteLog logfileNo log means mod_rewrite is not executing
RewiteLogLevel level; 0 - no log 9 - highest
Labels:
Apache
Saturday, August 21, 2010
xmanager for linux
The title may seem stupid. But believe me that is what I have searched for. I wanted to run the applications of a far_away_computer on a local_computer as of they are applications of local_computer
The steps
Both ssh_config and sshd_config will be present in either /etc or /etc/ssh
The steps
- In the sshd_config if far_away_computer check for
X11Forwarding yes
- On the local_computer edit ssh_config to have
ForwardX11 yes
or use the -X flag every time u connect to far_away_computer - Once you are connected to far_away_computer from local_computer, start xterm on the far_away_computer.
Both ssh_config and sshd_config will be present in either /etc or /etc/ssh
Sunday, August 15, 2010
disable zend layout on home page
$this->_helper->layout()->disableLayout();
where $this represents the controller
where $this represents the controller
Labels:
Zend
Subscribe to:
Posts (Atom)