Symfony2 error page in 2 mins
by Dark_Mafia on Apr.11, 2012, under Ah ? :S
i wanted to create a error page for symfony. but the way mentioned in symfony docs doesnt work http://symfony.com/doc/master/cookbook/controller/error_pages.html#customizing-the-404-page-and-other-error-pages
so heres a simple way i found
copy the “Exception” folder from vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/resources to app/Resources/Views
then
edit vendor\symfony\src\Symfony\Bundle\TwigBundle\Controller\ExceptionController.php
and replace Line 86 from
$template = new TemplateReference(‘TwigBundle’, ‘Exception’, $name.$code, $format, ‘twig’);
to
$template = new TemplateReference(”, ‘Exception’, $name.$code, $format, ‘twig’);
and replace Line 93 from
$template = new TemplateReference(‘TwigBundle’, ‘Exception’, $name, $format, ‘twig’);
to
$template = new TemplateReference(”, ‘Exception’, $name, $format, ‘twig’);
and finally edit the files in app/resources/view/exceptions
How to setup a vmware host-only network with internet
by Dark_Mafia on Mar.30, 2012, under Ah ? :S
- create a host-only adapter
- share your computer’s network adapter to host only adupter
- set up ipv4 ipaddress
- set the default gateway to gateway address of pc’s gateway address
- then restart the host network adapter
- setup the network connection of the vm to dhcp and gateway to the ipaddress of the host ip adapter
JOB DONE !!!
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



