[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;}
to
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;}
to
.con { width: 1060px; float: left;}

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

.sc-all { width: 480px; background:#fff url(images/sl-top.png) no-repeat top; float: right;}
to
.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;}
to
.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:
{your-domain}/wp-content/themes/fervens-a/ferevens-a/images/sl-top.png
{your-domain}/wp-content/themes/fervens-a/ferevens-a/images/sl-bottom.png

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.

Optional:
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.
Eg;
#bg{width: 960px
becomes
#bg{width: 1010px
for increasing width by 50 pixels. I hope you got the idea.

Any queries will be answered here.
Thanks and regards
Cheers!

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:
http://www.beginningtoseethelight.org/efsrecovery/index.php

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.

Cheers!

CSS4, What’s coming

About CSS specification

The CSS team recently published first commercial working draft of CSS4. The CSS spec changed just after the release of CSS3. As we know CSS3 is making its way slowly and suddenly W3C launched first official draft of CSS4. So, CSS3 and CSS4 may go hand in hand. Demand for new module makes CSS4 to start their release early. Selector module is an example of it.

New things about CSS4

Pseudo-elements

The first thing we can notice in CSS4 is Pseudo-elements are absent. Don’t worry though, pseudo elements will be there in the future releases of CSS4. New spec might come into different module, or they can merge it into previous modules itself.

UI state pseudo-classes

This class allows you to implement style elements depending on their state and checked items like radio elements, checkbox elements and half a dozen more.

Determining the subject of a selector

In CSS3, if single selector comprises of several other compound selectors, then the last one is considered as its subject. The main function of subject is to determining rules to the elements. But in CSS4 you can make any compound selector as a subject. This is the biggest news in a stream breeze of CSS 4.

The nth-match function

The nth-match() function gives you a freedom to apply a rule to n-th match to the given selectors.

e.g :nth-match(an+b of selector-list)

In early versions, we could only able to give rules to n-th child only. With CSS4 we have more flexibility.

Styling the links

In CSS 4 we have newly designed pseudo class :local-link which allows us to style links based on domain. For example we could actually style each internal link with the help oflocal-link(0).

Reference combinators

These combinators allow us to select elements that are referenced by ID of another element. With the help of different types of combinators that are present in CSS4 we can reference to corresponding element easily.

Reference element pseudo-class ‘:scope’

We can use selectors to query for elements, and then search starts by means of iterator searching one element at a time. And ‘:scope’ is a holder of current searched element.

The :matches()Selector

With the help of :matches selector class we can greatly reduce the complexity level of writing nested CSS. The syntax of :matches()eliminates the need to write outarticle h1,section h1 and many more. We can also use this selector in simple nesting examples but its handy to use it in selecting element that are two or three level deep.

Summary

Above are some specifications that come with the release of first official draft of CSS4. Above specifications were absent in CSS3. With release of first draft and having lot many changes we can expect much more changes in future releases of CSS4. The CSS 4 spec is brand new and no web browser will support this spec. whatever may be the next release whether it is styling or coding, it’s always been helpful for CSS users. This is case whether you endorse a new standard or not.

 

About the author:

Brianne is a blogger by profession. She loves writing on environment and technology. Beside this she is fond of books. She recently did an article on Windows 8 tablet pc. These days she is busy in writing an article on backyard design ideas.

[Solved] “is not co-installable with” errors on Ubuntu

I installed 32bit wine on 64bit Kubuntu but for some reason it didn’t install properly so I tried reinstalling wine 64 bit and got the following error:

dpkg: error processing /var/cache/apt/archives/wine1.2_1.2.3-0ubuntu1~ppa1_amd64.deb (–unpack):
wine1.2: 1.2.3-0ubuntu1~ppa1 (Multi-Arch: no) is not co-installable with wine1.2:i386 1.2.3-0ubuntu1~ppa1 (Multi-Arch: no) which is currently installed

You can’t simply remove 32bit wine using apt-get remove wine1.2. To fix the issue suffix the package name with ‘:i386’.

Therefore, I solved the problem by:

sudo dpkg -r wine1.2:i386

[Solved] Unadjustable brightness on laptops having i915 kernel module

I recently purchased a new laptop HP DV6121tx and installed linux on it. Apart from the muxless switchable graphics and openGL (HP will release a BIOS update to fix it soon), and brightness control, everything worked. I couldn’t change the brightness using the Fn Hotkeys. They displayed the brightness applet on pressing but nothing happened.

After scavenging, what seemed like the whole WWW, I finally found a modified kernel by Kamal Mostafa which fixed the issue. You can see the bug reports and patch here.

The issue seemed to be with i915 kernel module and how it handled brightness on certain laptops which had different ACPI implementation.
Only install this kernel if you are using i915 kernel module. You can check if its active by executing:

lsmod | grep i915

If it gives you output, it means you’re using the i915 kernel module and you can proceed further. If it doesn’t give any output, you should leave this page.

Fix the brightness issue by installing kernel debs provided in Kamal’s PPA.

sudo add-apt-repository ppa:kamalmostafa/linux-kamal-mjgbacklight
sudo apt-get update
sudo apt-get dist-upgrade

This will install the modified kernel. Alternatively, you could do (not recommended):

sudo add-apt-repository ppa:kamalmostafa/linux-kamal-mjgbacklight
sudo apt-get update
sudo apt-get install linux-headers-2.6.38-10 linux-headers-2.6.38-10-generic linux-image-2.6.38-10-generic linux-libc-dev

Reboot into the modified kernel to confirm the brightness keys work. Cheers!

[Solved] Disqus causing admin panel issues in wordpress

Disqus comment system was causing javascript errors, which in chrome console looked something like this:

Uncaught Syntax error, unrecognized expression: [href=edit-comments.php?page=disqus]

It caused unmovable widgets, screen-options didn’t open and other related javascript issues in admin panel.

After some researching it turns out, there’s a simple fix.

In /wp-content/plugins/disqus-comment-system/disqus.php, find:

href=edit-comments.php?page=disqus

and replace it with:

href=”edit-comments.php?page=disqus”

Cheers

[How-To] Disable CPU cores in Linux

Although there’s no reason to do this, but some of you might have problem with apps not running well in multi-core environment or maybe looking to save some power (although disabling cores on sandy-bridge CPUs won’t save much power), I’ve written this simple tutorial to disable CPU cores in Linux.

I have i7 2630QM process which has 4 physical cores and 4 logical cores. I’ll show you how to make it act like a dual core machine instead.

Method 1:
This method is dynamic and doesn’t require a reboot. You can just open a terminal and try this out:

  • sudo sh -c "echo 0 > /sys/devices/system/cpu7/online"
    sudo sh -c "echo 0 > /sys/devices/system/cpu6/online"

    Repeat the above steps for cpu2 to cpu7 and it’ll leave you with cpu0 and cpu1 active which is essentially what we’re trying to achieve.

Method 2:
This method will make the linux boot with 2 cores which might make kernel more optimized for dual core environment than the method above.

  • Add maxcpus=2 to GRUB command line by doing the following:
    gksu gedit /etc/default/grub

    Find:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

    and change it to

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash maxcpus=2"
  • Then run:
    sudo update-grub

    When you reboot, linux will run on 2 cores.