RSS
 

Embed PHP Code in CSS files.

26 Mar

Have you been embedding CSS Styles into PHP files just for the sake of making the styles dynamic?
Ever wished to add PHP codes in CSS files itself.

Here is a simple trick which will do the magic.

Create a .htaccess file in your project directory preferably inside the directory where CSS files are stored. Open .htaccess file and add following line

AddType application/x-httpd-php .css

Now you can include php codes in CSS files. Here is a small example

#container {
background: <?php echo $userColour; ?>;
}
 
 

Ubuntu: get notified after a terminal based process ends

20 Dec

So u have given a SVN Checkout command or apt-get install command which will take unexpected time to end.

Here is a way to get notified when process ends. Just append notify-send “Complete”; to the command

For example
You want to execute

sudo apt-get install -big-software-

and want to get notified after installation.Then use following command

sudo apt-get install -big-software-; notify-send “installation complete”;

and you will be notified using ubuntu’s notification-daemon once the installation completes.

Cheers

 
No Comments

Posted in Linux, ubuntu

 

Installing Linux in pen drive

25 Sep

Last night my computer’s hard disk crashed. Thankfully it was under guarantee period so I gave it for repairing. Computer’s hardware was lying worthless in my desk, and I got a rare chance of experimenting. So I decided to install linux in a pen drive, although I could do that even if HDD was present, but who has time for that ? huh !

I had a bunch of linux distros with me, thanks to to linux for you magazine. I took out ubuntu’s DVD (10.04) which is my favorite Linux flavor and started installing it in my 4Gb pendrive. Unfortunately I could not succeed due to unknown reason.
I tried Mandriva Spring 2010 next, but its partition manager (I suppose GParted) crashed prior to installation. My bad luck.

Although I had no expectation from Fedora (this is personal, don’t draw any conclusion), It worked. Installation process was exactly same as installing on a hard disk, the only difference was the freaking slow progress rate, reason being slow transfer rate of pen-drive.  At least it was done successfully, that was all I needed to be “happy”.

For the first time in my life I logged into a fedora system. It looked similar to ubuntu (this is what happens when you keep using one destro, being afraid of the time you would waste making yourself comfortable with other). Then I realized, if looks are the only thing you care about in Linux then choose between Gnome and KDE not among deferent linux flavors. So I started diving deep into finding at least one difference that matters a lot and that does not include ubuntu has ubuntu software center and fedora does not.

Well the search is ON, I might find something when I use my computer again, hopefully before repaired hard disk arrives. Till then I am using my Laptop and babuji is using that freaking slow PC. He he he

 

Solve kaspersky’s “blacklist of licenses is corrupt” problem

31 Aug

Ever faced the problem that kaspersky’s blacklist licenses is corrupt and even updating antivirus does not solve the problem.
It generally happens due to power failure which sometimes corrupt license data.

Here is a quick solution

First disable “Self defense” capability of kaspersky from settings.
Then pause kaspersky and delete blacklist files.
You can find the files in
C:\Documents and Settings\All Users\Application Data\Kaspersky Lab\AVP[version]\Bases\bl00*.dat
If you are an XP user and

C:\ProgramData\Kaspersky Lab\AVP[version]\Bases\bl00*.dat
If you are using Vista/win7

Note: Replace [version] with your kaspersky version. Its 11 in my PC.
Note: bl00*.dat means very file with name bloo[something-something].dat

You can then resume kaspersky and enable self defense.
Now update kaspersky and it will download the blacklist files again.

Thats it. Problem Solved.

Cheers

 
8 Comments

Posted in Softwares

 

Hack windows password

22 Aug

Here is a small trick to hack your friend’s password.
You wont be able to know old password but you surely will be able to change it.

Step 1: Just start Command Prompt as an administrator.
Goto Start >> All programs >> Accessories >> Command Prompt (Right Click) >> Run as administrator

Step 2: You will be presented with a black screen.  Type
Net user
You will get a list of users.

Step 3: Now write
Net user <username> <new password>
(without < and > ofcourse)

Voila ! Password changed. Now u can ask him ransom to tell his new password.

Troubleshooting
1. I got an Error 5, access is denied.
>> This happens when you are not running command prompt as an administrator.

 
6 Comments

Posted in Windows

 

Restore your firefox session whenever you want.

22 Aug

Ever clicked on Start new session by mistake?

Don’t panic, you can still get your session back. Goto navigation bar and type about:sessionrestore and wow you are presented with last session restore screen.

Cheers.

 
1 Comment

Posted in Firefox

 

Restore ubuntu after installing windows

20 Aug

Hello,

I saw an article on recovering lost ubuntu after installing windows. I was pretty confident and installed windows 7 on my box. After that I started following the article and I was stuck with a blank grub menu during startup.

I booted from ubuntu live DVD and started reading more about restoring grub. Here is a solution I came up with.

Its a step by step guide to restoring ubuntu.
(Note: Its for Grub2. I am using Ubuntu 10.04)

Step1: Boot using Ubuntu Live CD/DVD.

Step2: Open terminal. (Press Alt+F2 and write gnome-terminal)

Step3: Now you need to mount your root partition. You can see a list of partition by typing
sudo fdisk -l

Step4: Now mount the root partition
sudo mount /dev/sdXY /mnt
Example: sudo mount /dev/sda6 /mnt
Where sda6 is the partition where I had my ubuntu’s “/” installed.

Step5: If you had a separate boot partition. Then mount it in /mnt/boot
sudo mount /dev/sdXZ /mnt/boot
Ex: sudo mount /dev/sda8 /mnt/boot

Step6: Now install grub
sudo grub-install –root-directory=/mnt/ /dev/sdX
Ex: sudo grub-install –root-directory=/mnt/ /dev/sda
where sdX is your first hard disk from where your system boots Or where MBR is located.

Step7: Restart your computer.It will automatically boot into your old ubuntu.

Step8: Open terminal and execute
sudo update-grub

Step9: Restart your system.

DONE. Cheers

 
 

SEO: Quick tutorial

31 Jan

Here is a letter I wrote to my brother telling him how to do search engine optimization for his website for fast result. I thought I must share it to world so people can  learn and suggest some ammendment(s).

_________________________________________________

Hello brother,

Here is the tutorial on Site Engine Optimization as you requested.

Before website is complete

0. Domain name
Your domain name must contain the most relevant keyword related to your site.
1. Keywords
Identify the keywords related to your site which users will search for.
Let the keywords be A, B, C, X, Y ,Z (in decreasing order of priority)
2. Meta Tag
Add these keywords to meta tag of your site. (Remove unwanted keywords)

Read the rest of this entry »

 
2 Comments

Posted in SEO

 

Javascript Tutorial: Gray-out the screen, Focusing on a box by darkening background content

30 Jan

In this tutorial you will learn about using Javascript DOM to Disable the page content by covering it with a layer (of div tag) or simply Graying out the screen.

A little Blah Blah

You might have seen on many websites, when you click a link, the whole page darkens and you are focused on a specific box. Here is the tutorial on how to create it.
Example www.pixel2life.com (click on login button)

Lets begin

Here is a code of the page which we are going to modify.
Old HTML code comes here

<html>
<head><title>Title</title></head>
<body>
<div id="outsider">
<div id="IEcenterFix">Some text here</div>
<div id="initiator">Click me</div>
</div>
</body>
</html>

Read the rest of this entry »

 

Firefox tweak: How to download embedded videos from website without using any additional software

18 Jan

In this tutorial you will learn about copying embedded videos from website without using external software. The only thing you need to perform this operation is “the world’s most famous browser”, Firefox.

To download a video open the webpage on which video is embedded and let the video play. When it is over, open a new tab, write “about:cache“  in the address bar and hit enter. From the opened page copy the cache directory of disk cache device.

about:cache

Now open my computer and in the address bar paste the address you just copied from firefox’s about:cache page. This is the directory where firefox stores its cache.
List its content in detail view and sort it in descending order of file size.

Read the rest of this entry »

 
3 Comments

Posted in Internet