php filemanager
by Dark_Mafia on Sep.26, 2011, under Cutting edge
i’v been trying to find a filemanager without a mysql backend and single login
Sum up: couldnt find one
Sooo i made one
https://github.com/oshanrube/php-Filemanager
Btw this is my first project with git feel free to join in with development,
i day job expect it to be crappy
Rip the mp3 from a video
by Dark_Mafia on Sep.16, 2011, under Linux Related
if you dont have ffmpeg installed yet install it by putting
# yum install ffmpeg or # apt-get install ffmpeg
if it says ffmpeg is not found you should add fusion repos
ffmpeg -i {video} -ac 1 {output}.mp3
Slice a image using mogrify
by Dark_Mafia on Aug.25, 2011, under Linux Related
Mogrify is a tool which uses commandline for image manipulation.
Just enter the pixel width and height to the script,rename the image to Diagram.png and just run the script
#chmod +x slice.sh
#./slice.sh
Put 2 websites in the same server and configure the document roots without a Cpanel
by Dark_Mafia on Apr.27, 2011, under Ah ? :S
As you may all know Cpanel is very important tool when it comes to web hosting. but its very expensive as well, specially if you have a dedicated server so now im gonna show you how to add another domain to the same server and run two different sites.
its a simple thingy, you all know the “httpd.conf” file right?? if not, its located in “/etc/http/conf/” if ur in a windows it must b smewhre in config folder.
k found it?? k good now add the following lines to section 2(‘Main’ server configuration) or end of the file will work too
NameVirtualHost *
ServerName {domain1}
DocumentRoot /var/www/html2
ServerName {domain2}
DocumentRoot /var/www/html
Order Deny,Allow
Allow from all
AllowOverride All
and restart important!
sudo /etc/init.d/httpd restart
update mysql table column with boolean toggle
by Dark_Mafia on Apr.24, 2011, under Ah ? :S
I recently came across a situation where i had a column in a boolean type and i have to set it 0 if its 1 and 1 if its already 0
so instead of running two queries where 1st one selects the value and running it through a if and determining the value i found this in a stackoverflow answers . pretty impressive huh??not to say this saves awful lot of performance too
update tab set `delete`=NOT `delete`
URL’s for streaming your favorite sri lankan rad stations
by Dark_Mafia on Apr.21, 2011, under Multimedia
http://76.73.5.190/yesfm
http://50.30.32.76:8090/
http://91.208.136.5:8980/

TNL Rocks
http://72.20.21.194:88/tnlrocks
joomla pdf button does not work in Internet Explorer
by Dark_Mafia on Apr.18, 2011, under Ah ? :S
this is a default joomla bug as mentioned in here (http://docs.joomla.org/Why_doesn’t_the_PDF_button_work%3F).while i was searching for a solution i got this file which WORKS !!!
so give it a try, theres a readme file which’l tell you what to do
Add a new ftp account to VSFTPD
by Dark_Mafia on Apr.13, 2011, under Linux Related
/usr/sbin/useradd -m -G users,ftp,wheel joe -s /bin/bash
passwd joe
chown -R joe /var/www/
and then add the username to /etc/vsftpd/chroot_list
echo "joe" >> /etc/vsftpd/chroot_list
Joomla pdf doesnt work “TCPDF error: Can’t open image file: “
by Dark_Mafia on Apr.13, 2011, under joomla
in the default joomla installation you might have come across situation like this when you click on print pdf icon
TCPDF error: Can’t open image file: images/schools/MACS/images/for%20web.png
Reason:
basically there are 2 situations which this may occor
1.Is the article has a fake image(where the image is really not found in filesystem
2.if the file names doesnt match
in this specific case the error is in the file name as u may knw joomla encodes all the url’s in the articles so when the tcpdf prints the article if searches the filesystem for the specific file name in this case ‘for%20web.png’ but the actual filename is ‘for web.png’ . oh lala now u can see right? so i just add a urldecode function before it phase the image
then for the error i mentioned in 1. i just check whether that image exists if not, IGNORE haha simple right?
ok cut to the chase just download this file and replace it {joomla}/libraries/tcpdf/tcpdf.php (BTW rename the file)
heres a simple “diff tcpdf-old.php tcpdf.php”
1908a1909
> echo $this->_getfontpath().$file;
1912c1913
< $this->Error('Could not include font definition file');
---
> $this->Error('Could not include font definition file'.' '.$this->_getfontpath().$file);
2801a2803,2804
> //replace spaces
> $file = urldecode($file);
3134,3137c3137,3142
< if(!defined('K_PATH_FONTS') AND is_dir(dirname(__FILE__).'/font')) {
< define('K_PATH_FONTS', dirname(__FILE__).'/font/');
< }
< return defined('K_PATH_FONTS') ? K_PATH_FONTS : ''; --- > //if(!defined('K_PATH_FONTS') AND is_dir(dirname(__FILE__).'/font')) {
> //define('K_PATH_FONTS', dirname(__FILE__).'/font/');
> //}
> $path = JPATH_SITE.DS.'language'.DS.'pdf_fonts'.DS;
> return $path;
> //return defined('K_PATH_FONTS') ? K_PATH_FONTS : '';
3236c3241
< set_magic_quotes_runtime(0); --- > //set_magic_quotes_runtime(0);
3274c3279
< set_magic_quotes_runtime($mqr); --- > //set_magic_quotes_runtime($mqr);
3673a3679,3683
> $file='/var/www/html/'.$file;
> $a=getimagesize($file);
> }
> if(empty($a)) {
> return null;
3695a3706,3710
> $file='/var/www/html/'.$file;
> $a=getimagesize($file);
> }
> if(empty($a)) {
> return null;
3718a3734,3738
> $file='/var/www/html/'.$file;
> $f=fopen($file,'rb');
> }
> if(empty($f)) {
> return null;
As a Joomla Developer
by Dark_Mafia on Apr.13, 2011, under joomla
In my life as a intern i’v been working on a joomla project. technically its 5 sites which combines but runs on 5 different databases.anyway in my experience i’v been working on pretty serious developments with joomla framework. most of them are custom components going beyond the capabilities of joomla framework.
so here on i will be putting up errors which i found with 1.5 version of the joomla framework(its old but still its pretty solid compaired to 1.6) some of you may b familier with thease errors but still with no solution. no worries i’m here with some answers. BTW if you find any errors pls do post them up to me
Thanks c ya ltr.



