[HowTo] Increase Fervens’ (wordpress theme) width

Fervens is an extremely attractive and excellent theme for wordpress. After trying numerous themes, I settled for this and its really really amazing.

The only shortcoming was that its main content area was too small. On larger posts, the content would span upto numerous pages which would’ve not taken so much space if it had been a little bit wider.

I tried to experiment with the theme and modify it for greater width. It was not a difficult task and moderate knowledge in CSS is enought to make it accomplish. For the rest of you, I will teach you how to do it.

These are the steps:
Goto your admin panel and click on ‘Appearance’ and then ‘Editor’.
The default file ‘Style.css’ will open. If it doesn’t click on style.css from right hand side column.

Change these:

#bg { width: 960px; margin: 0 auto;}
add how much width you want to add. I’ve added 100px to mine. So 960+100 becomes 1060.
#bg { width: 1060px; margin: 0 auto;}

.con { width: 960px; float: left;}
.con { width: 1060px; float: left;}

.scs1 { float: left; width: 650px; margin-right: 10px;}
.scs1 { float: left; width: 750px; margin-right: 10px;}

.sc-all { width: 480px; background:#fff url(images/sl-top.png) no-repeat top; float: right;}
.sc-all { width: 580px; background:#fff url(images/sl-top.png) no-repeat top; float: right;}

.sc { padding: 20px; width: 440px; background: url(images/sl-bottom.png) no-repeat bottom;}
.sc { padding: 20px; width: 540px; background: url(images/sl-bottom.png) no-repeat bottom;}

Save the CSS. And see the changes. Width of middle column must’ve increased by 100px.

Its not done yet. You still have to make the rounded corners.
They’ve used 2 images – 1 for top and 1 for bottom. Thats not a good practice. You should always use 4 images so that you can change the width without modifying the pictures.

Save the two files namely:

To save the files:
Run this in your web browser. You may not see anything as it is almost white. So, just go to File-> Save.
Save the file.
Do this for the other file too.

Fire up your image editing software (I used photoshop).
Open both the images on it. You can just simply resize it to 581px which was 481px originally. Note that simply resizing won’t look that neat.

To truly resize it expand the canvas width by 100px. Cut a portion consisting of right-side of the corner and paste it over the image and line it up at the right edge and save the image.
Flip this image vertically and you have the other image.

Upload both the edited image to the same folder from where they were download ie. {your-domain}/wp-content/themes/fervens-a/ferevens-a/images/

Reload the webpage and give a pat on your back.

Note: This method has been tested with Fervens A but it must work with B and C versions too.
Also note that I’ve increased 100px width, so I’ve put the references. If you want to increase width in greater or smaller amount, please add the corresponding width to original width.
#bg{width: 960px
#bg{width: 1010px
for increasing width by 50 pixels. I hope you got the idea.

Any queries will be answered here.
Thanks and regards

Why not to encrypt your files using EFS or any other encryption

EFS or NTFS encryption can turn out to be your life’s worst nightmare in case you don’t fully read about it. I advice everyone not to use it unless you really know what you are doing and backup your certificates.

I had many folders of mine encrypted and I forgot about them completely as encryption is transparent to user who encrypted the file. It was a usual day. I was working on my computer when I wanted to access some files from ‘My Documents’ (yes, I encrypted whole My Documents folder, idiot me.) and was denied access. I thought it might be with just that file. I tried accessing other files, other folders but it gave same error. It dawned upon me. In an instant, I knew what was going on. I was shocked and confused at the same time. I didn’t know what was happening.

I remember opening a PDF file and I started getting spybot registry prompts. But PDF files were safe, weren’t they? Seems like that one wasn’t. It had a virus. I don’t know what it did, but this PDF created all the problems.
I wasn’t able to access my files only after the infection. Also, it took away my admin rights. I couldn’t use softwares like Nero.. they gave me messages that I needed admin rights to run it. I found a site to remove encryption using hex modifications of registry and some files. This is the site:

Its good and this guy was the first one to have found a way to recover. But the tutorial didn’t help much and I still didn’t have any way to get my files back. I downloaded Elcomsoft Advanced EFS recovery but it said that it needed admin rights. I tried Passware EFS key recovery and it gave “Error decrypting file”.
I couldn’t do anything. I couldn’t even format my computer. That’d have made the problem worse. My encryption certificates which might have been stored somewhere on computer would’ve gone forever rendering my encrypted files useless.

I tried running chkdsk and it found many errors. I scheduled it to run at startup as C drive was locked but it didn’t start. I was stuck from everywhere. Nothing was working. I ran Event Viewer to check any errors and wasn’t surprised to see Error 7 which said “Bad block on hard drive”. I assumed that the block on harddrive which had the SAM file and my certificates went bad. Also, virus made the matters worse by removing my rights. I was no longer known to computer as the same user. I was different user for my computer.

I didn’t know what to do. Fortunately, I had another computer and I downloaded Vista Recovery CD, burned into a DVD using another computer. I booted it on my laptop, and ran chkdsk. It found and repaired errors. I rebooted into Windows XP and checked but it didn’t solve any problems. I tried using chkdsk C: /B in recovery disk again but it was of no use too.

I had lost almost all hopes when I browsed to C:\Windows\system32\config and saw automated backups stored there. The latest one was of 24th may. I thought of giving it a shot. I booted into recovery disk again, and restored the backup and booted into Windows XP again and got my admin rights back. The problem wasn’t solved – I still couldn’t access my encrypted files. I quickly ran the Elcomsoft EFS recovery and it ran without any error. I was so happy. At least, I got some hope. I had my rights back. I ran the software and recovered a test file and it succeeded.

I was in bliss. I had recovered the encrypted file. I spent next 5-6 hours recovering all the files. This nightmare was not as bad as some people who forget about the encryption and format their drives only to discover it later. At least, I hadn’t formatted the computer. I had the certificates somewhere on my filesystem but I didn’t know where.

So, it was really a nightmare.

Moral of the story: Do not encrypt files unless you really know what you are doing and be prepared to face the consequences when the worst happens. Do not encrypt the files unless absolutely necessary. Always back up your keys/certificates.

[Solved] Windows XP login logoff loop caused by a virus

Yesterday, I was infected with probably the ugliest breed of virus in computer history (atleast, for me). What it did was nothing serious. I downloaded something off the internet and ran it. Spybot gave me a warning about a registry entry and I knew it was virus. I simple denied it. It again popped up after few minutes. It confirmed that it was a virus because no other software would prompt again for the registry entry. I denied again and no matter how many times I denied, it came back again after a few minutes. So, I knew it was a time for scanning. I scanned and deleted atleast 12 virus executables created in various system folders. I deleted them all. I think the virus injected itself into some system executables too. And I deleted those files too. Everything was going fine. The virus was listed as Win32/Kryptic.AA trojan and WIN32/Rootkit.Agent by my NOD32 AV.

My AV prompted me to restart to delete some files which were too stubborn to get deleted in windows. I think those were the system files which were not being deleted. I restarted and I couldn’t login into windows anymore. On the login screen I typed my password and as soon as I logged in, it logged me out. I was in a login – logout loop. Fortunately, I had another computer. I started looking for solutions. I found solutions like editing the registry which was not possible as I wasn’t able to login even in safemode. Other methods needed me to copy some system files from WIN XP CD to the system folders. I tried all linux live CDs but none of them worked on my Laptop as it had widescreen and X won’t recognize it. Finally, PCLinuxOS worked. I copied the system files from another computer to a pen drive and put the pendrive back onto my laptop but PCLinuxOS won’t recognise it. I was out of luck. Damn! Thiks linux.

I tried googling for editing registry in Linux and found a small distro for just that. I downloaded it. I tried it but it was no good. It edited the registry successfully but it didn’t repair the computer. I was still into login-logout loop.

I tried using UBCD (ultimate boot CD) and tried to boot into DOS with CD-ROM support. I burnt a DVD with all system files from my second computer. I tried copying the files from DVD to the system32 folder using DOS but it gave an error. All the doors seem closed. I could only think formatting in my mind.

Just when I had lost all hopes, something clicked in my mind. I thought to myself, why not try another pen drive on PCLinuxOS as it was the only OS which booted perfectly on my computer. I inserted another pendrive and by God’s grace it worked. I quickly copied all the system files (The main file was userinit.exe which I think got deleted by NOD32 in the process of removing the malware. So, it was not the malware/virus that had caused the login-logoff boot but the AV which caused it) from the second computer to this pendrive. Inserted it into my laptop… copied all the system files to their respective folders and restarted and Voila! I was into windows. I felt stupid and proud at the same time. Stupid for not thinking of using another pendrive before. And proud to mend my computer without formatting (I bet most of them would’ve formatted it).
The problem wasn’t over. As soon as I booted into windows, the spybot started showing those prompts again. I knew if I restarted again, I would have to face the same all over again. So, I downloaded Malwarebytes Anti-malware which is known a very good anti-malware software. Updated it and did a full scan but it seemed to take too much time. So stopped it when it had already scanned 1,00,000 files and found only 2 infections. I did a quick scan, and it found over 50 infections in under a minute. I cleared them all. Scanned again to confirm if they were removed.

For even greater security, I type sfc/scannow in command line. Its an application which checks system files integrity and if any file has been tampered, it replaces it with the original file. It didn’t find any problems.

I still haven’t rebooted my computer. But I am confident that the virus is gone. This how I mended the login logoff loop.

UPDATE: The computer logged in fine. I just restarted it.

How I bought techmindz.com

How I bought www.techmindz.com is quite interesting. Okay, I always wanted a .com domain for my forum but lack of paypal money and credit card compelled me to use a free domain.

So, I seriously started working to collect some money. I already had 2-3 projects given to me by guys in US, but I being lazy didn’t bother to complete them. I contacted them and asked if the project was still open. One of them replied and I completed his project working hard day and night. The project was about implementing AJAX on a site. He paid me $20 on paypal. I was very happy. This was my first earning online. I decided that I will choose the domain name very carefully as it is the first thing a visitor enters in his address bar.
I posted on mazzako forum but didn’t get any nice replies.
This was 2 days ago.

Today, I searched for a new project and found one. It was about merging and compressing javascript. It sounded simple and hence I mailed a proposal. And to my amazement, the project was quite hard. Compressing the script was rendering it in errors here and there.
I tried to solve every error manually but couldn’t figure out much of the code because it was base 62 encoded.
I, finally, somehow managed to solve the problem using another compressor and few manual correction of errors.

The project was done to his full satisfaction. I hadn’t quoted him the price. I thought of quoting him $20 but it was hard work so I thought of quoting $30. I thought that would be just too much coz $30 equals to 2400 NPR. So, I quoted him $25. I was prepared for revolt. I thought he would bargain but he didn’t. Nice guy. He paid me $25 instantly.

I had $45 in my paypal account in 3 days. I was so happy. I was high. My talent was paying. Up until now, people cursed me for using computers day and night and remaining disconnected from rest of the world but my talent was starting to pay. You could very well imagine my happiness. I was euphoric.

After that, I went straight to my Bluehost cPanel. I clicked on domain manager and I searched for techmindz. I didn’t know techmindz.com was available. I had not bothered to search for it because I was quite sure that it won’t be available.

I clicked on ‘Buy’. It brought me to the next page where I had to write my payment details. I didn’t want to buy a domain. I was just fiddling around. Being evil minded myself, I thought that there must be a hidden field where subtotal was stored. I searched for hidden field on the page source and I found a hidden field which stored $10. I knew javascript injection and I changed that value to 0. I clicked next and it bought me to the paypal page. On the paypal page, there was no mentioning about the price. I thought it might be on the next page and clicked next. And guess what? It confirmed my purchase and $10 was reduced from my account. And before I knew what happened, techmindz.com was already mine.

This is how www.techmindz.com was bought. Interesting, isn’t it.

So guys, attempt to hacking can get you hacked too. ;)

[HowTo] Extend phpmyadmin session expiration time

Recently, I got frustrated being logged out every few minutes (24 minutes, to be precise) from phpmyadmin on my localhost. I make some db changes, write some code and when I get back to phpmyadmin, I would see my session had expired. To fix this, I changed the configuration so that my session would expire only after 24 hours of inactivity.

Steps to follow:

  • Copy the following code at the end of /etc/phpmyadmin/config.inc.php:

    $cfg[‘LoginCookieValidity’] = 60*60*24;
    ini_set(‘session.gc_maxlifetime’, $cfg[‘LoginCookieValidity’]);

This will let your session expire only after 60*60*24 seconds, that is one day.