Fixing the Desktop Resolution in Ubuntu Linux

Wednesday, October 28, 2009
This is one of the lessons i learned on my own by screwing up the display configuration of my GUI of Ubuntu (Linux). So what happened is that i changed the refresh rate and resolution to match my TV (It's a HDTV which supports VGA) and everything was messed up, here is what i did

I suggest you backup your display settings before making any changes otherwise you will be sitting like an idiot like me :P

1. Either boot in recovery mode OR you can simply press CTRL+F1 to go in the CLI (Command Line Interface)

2. go to /etc/X11

[code]cd /etc/X11[/code]

3. Baclup your config file

[code]sudo cp xorg.conf xorg.conf.backup[/code]

4. Fortunately for me ubuntu had already kept my last configuration file so all i had to do was to over write the current one

[code]sudo cp xorg.conf.1 xorg.conf[/code]

5. Than had to reboot the machine [code]sudo reboot[/code]

there were couple of backup configurations in the folder so it was trial and error procedure till i found the configuration which was working for me

this was a hap hazard way of describing things but what the heck, hopefully it will help someone out or perhaps me in the future to recall my footsteps to solve the problem :P

Ubuntu Solving The Problem Of Disappearing Disc Space

For past few days i was puzzled by this problem that i kept deleting files but there was no difference in the hard drive space, so by searching and reading i figured out a way to solve this problem,I thought about writing this small tip/guide for newbies like me

Problem / Symptom

I delete files from my hard drive (it can be linux partition or it can be NTFS partition) yet the space on hard drive remains the same as it was before deleting the files.

Solution

What happens when you delete a file in GUI is that Linux moves the files to a Trash folder instead of actually deleting the file,

For Linux Partition i would suggest you open the terminal go to

Code:
cd /home//.Trash
Replace the with your user name e..g


Code:
cd /home/baqai/.Trash
now to see if you have any hidden files in the directory


Code:
ls -a
this will show you all the hidden / non hidden files in the directory

now for deleting the files


Code:
rm 
If you want to remove a directory than use


Code:
rm -R 
For Windows Partition

Say you have a windows partition mounted and the volume of that drive is "Downloads" you can follow the same principals as above with slight twist

First lets go to your partition


Code:
cd /media/Downloads
Now lets find those files which you deleted


Code:
cd .Trash-
e.g. in my case i typed


Code:
cd .Trash-baqai
Now you will enter a new directory


Code:
ls -a
You will be again shown a list of files, now you can follow the steps above to get rid of the files once and for all and can recover your hard drive space.

On windows partitions you will also have another directory by name of .Trash-root which you should also check just in case you deleted some files by your root account and they are there, For most of the new users like me it should not be a case normally

Creating A Simple Button In Photoshop!

Few of my friends were asking me how i manage to work in photoshop, Well i am learning on my own and consider myself as a "noob" and as far as i am concerned photoshop is not rocket science anyone can learn it provided time and effort is given.

So i thought about writing this small tutorial for a friend of mine, i will try to cover the steps to create a simple button in photoshop from scratch

Note :

1. I am NOT an expert in photoshop
2. This is roughly the way i do work, there would be dozens of other ways to reach the same effects, feel free to explore
3. The "button" or all the images were taken soley for purpose of creating this tutorial so i haven't bothered with any refiniements or any other thing, they are just to provide the user with some basic knowledge and than its upto his or her's creativity to explore. :)



I assume you already have started photoshop, for this tutorial and all the images i have used photoshop cs 2, your interface might vary with the version you are using. First thing is to create a new document, you can do this either by going to File -> New or simply press CTRL+N on Windows. A window will open looking similar to the image below, enter the dimensions as indicated by the image i.e. 300 x 300. For this exercise i had my background color as black (i love working with black or white)


When you are done click OK to proceed

Now you will be presented with a small window, we now will proceed to make the basic shape of the button, we want to be rectangular with rounded edges, so as indicated in the image below click in the toolbar and select "Rounded Rectangle" or you can use the keyboard shortcut "U"


We want to modify the settings so that our "button" will have more rounded edges for that find the setting in the top most menu bar and modify the setting for "Radius" the default value is 10 we want to make it 20, you can see it illustrated in the image below


Now go ahead drag your mouse (press left button and move the mouse) and create yourself a vague rectangular shape something like in the image below



Now the fun part starts, we will now convert this boring looking rectangle into something more "fancy". Right click on the shape layer and you will be presented with a menu



Click on "Blending Options" and you will be presented with a new window with different options, we will explore different options one by one to see their effects

First click on "Drop Shadow" and make the settings as per the image below, while you are playing around with different settings feel free to explore and learn what impact they do on the image


Next we will explore settings of "Satin" and make the settings in accordance to the image below


Now we have a general "shape" of a button, its time to give it some edges and bevel it, we will now check the settings for "Bevel And Emboss", As before try to match the settings as per image below, like i have mentioned before feel free to explore what impact different settings do to your image


Now go to Filters -> Artistic -> Plastic Wrap, PS will ask you if you want to resterize the layer blah blah blah, press okay, you will be taken to a window which will resemble something like the image below, make the settings accordingly



Now its time to add some text to the "button" press T and type something and it will look something like the image below (provided your text color is white)



Again right click on the text layer select Blending Options and give the text some drop shadow so it looks nicer like the image below



There you go a simple way to create an average looking button in photoshop, its not good or anything but at least it shows you certain ways of getting things done, hopefully it will come in use for someone out there :)

Simple Photoshop Tip For You

Have you ever thought how these big names such as Jimmy, Dossani, Studio-9 etc manage to come up with such kick ass pictures? Ever wonder how come you managed to look so good in that picture? well welcome to the amazing powers of Photoshop. I am a hobbyist and i use Photoshop from time to time. Today i am going to introduce you to few tips and tricks to give that UMPH! to your images.

I am in no means an expert and I will try to explain things in simple language (no techie lingo) etc in this tutorial (if you decide to call it that)


Black And White Effect

A simple color photograph can have beautiful impact by simply making it black and white, for that purpose what you need is a color photograph and photoshop (i am using version CS2)

1. Open photoshop and open any image in it, for the purpose of this tutorial i have choose this picture of a very cute baby.



2. Once the image is open go to Image -> Mode -> Gray Scale



3. Photoshop will ask you "Discard Color Information" select Yes and you are done and will be presented with the image looking like this


There you go it was so simple to convert a color picture into black and white



We will further explore and see how we can exploit this effect to create even more further effects such as sepia and all

Security Is A PAIN

Monday, October 26, 2009
In my previous post i mentioned "Security is A PAIN" and i mentioned that i would cover it in a future post. Well i will try to explain it to you. The statement should be read as "Security is A.P.A.I.N" and it stands for,

A : Authentication
P : Privacy
A : Authorization
I : Integrity
N : Non Repudiation

Authentication

Authentication means to authenticate a person or to proove someones identity. We need to be sure that the person is who he claims to be. In our daily life we use our ID Card or Driving License for purpose of Authentication or "Proof Of Identity". Authentication places an important role for Authorization

Privacy

Privacy means that conversation or content exchanged among two or more parties should remain confedential. When it comes to electronic medium this is normally achieved by encryption.

Authorization

Authorization is the access level a person has, It is based on the Authentication performed e.g. a person claims to be Mr.X whose designation is Manager and based on his proper authentication he is granted his rights. Mr Y another person can be in the very same department at lower designation and would be gratned a lower acecss level / rights to information based on the authentication.

Integrity

In simple language Integrity means that the content of a message/conversation/document should remain intact and no unauthorized changes are being made. That means if the CEO of the company dispatches an email sayinig "1000 $ bonus to everyone" it shoud reach down the hierchy as 1000 $ not 100 or 10 or 10,000. I hope i am gettiing my poin clear here? If not do feel free to message me!

Non Repudiation

Non Repudiation means something which could be proved in the court of law and cannot be denied, In terms of electronic channels it mostly means that a person cannot deny that he/she send an email, alter/created a document etc.

The above were the five pillars of security which needs to be achieved in order to get "Security", but at the end of the day there is no such thing as "Fully Secured".

Securing Your Work Place From Industrial Espionage

Industrial Espionage, Data theft, Stealing of ideas etc are something not out of a James Bond movie anymore, these are few hard facts in today's fast moving world and we should take them seriously. Have you ever moved in your conference room to find the white board with diagrams and figures from a high profile meeting which just ended? I won't be surprised if you have experience such thing in your proffesional careare. The simple fact is that we just don't respect the value of "data" and the fact that a simple figure/value/chart which may be garbage to us can be useful for our competition.

There are few things one can do to minimize the probability of such events happening, One will have to enforce few hard policies in order to make sure risk is at minimum and we have to make sure there is SOMEONE or SOME GROUP (better if you have more people at stake in my opinion) accountable for any such unforseeable events.

1. Meetings

Meetings are a norm in our office life, Reminds me of a joke "Society: a group of people collectively deciding that nothing can be done.", Anyways there should be general rules for meetings.
  • The person who called the meeting should be the last person to leave the conference room or the area of the meeting.
  • He/She shall be responsible to see that the area is clear of any notes, papers, company asset. 
  • He/She should be responsible to ensure that any unneccessary lights,fans,A/C are turned off. (Nothing to do with context of this scenario but never hurts to include this in your SOP).
2. Phone Cameras

Phone Camera's can be pain in behind for security personal, Almost everyone carry a cell phone now days and even the cheapest ones are coming with a measly excuse for a camera may it be VGA resolution. But even a low resolution 640x480 VGA picture taken of your data center layout or anything else critical can set you back a lot. People have already started giving policy not allowing people to bring phone camera's, If you ask me I would go one step ahead and take the following extra steps,

  • Identify the mission critical area.
  • Identiy the people with access to such areas.
  • Issue all of these people a company issued cell phone without camera and make it mandotory for them to use it.
  • Any personal cell phone other than the company issued / with camera should be deposited at a help desk / reception before entering a mission critical area.
Having a company issue cell phone might sound like an expensive proposition but there are many dirt cheap Nokia, SE, Samsung and even LG's alternatives out there to keep the budet low.
    • Everyone regardless of the designation carries the same phone so that creates harmony.
    • They get a company issued free phone (Hey at the end of the day its FREE). 
    • It's upto company if they want to give them company SIM (as per job designation) or they can use their existing SIM card to continue their connection. 
    • Those Blackberry carrying snobs who claim to get email every second of their life can might as well be kept outside such mission critical places. (With all due respect to BB users but i have found more than 75% users to be snobs who pretends to be Mr Important than using the BB for being in touch with business/work.) 

3. Segregation Of Work

Distribution of work is always an good idea, It's makes it hard for any ill intentioned employee to pull something off. Lets assume there is one person with access to everything that means that person can provide your competition mission critical information due to any reasons.

Even expanding the segregation of work to access level can provide extra level of security of your assets. For example there is a Data Center with a Server inside (What Else?) a locked rack.

  1. You have a person who have access to data center.
  2. You have another person who have access to the rack.
  3. You have a third person who knows the password to the server.
  4. You have fourth person who knows password to the applicaiton / is responsible to do the work on the machine.
Now this may sound tedious to you but hey security is never achieved without pain, In fact if you have not heard before than there is a popular saying in the information security industry that "Security Is A PAIN". I will be covering this in a upcoming post soon.

Photoshop Small Tutorial # 1 (B&W Over Color Effect)

Saturday, October 24, 2009
Here is another not so short tutorial on photoshop, this time we will see how to use the B&W effect (like in the previous post) and mix & match it with simple cut and paste to make a cool picture

As usual you will require a copy of photoshop and a picture to play around with, for purpose of this small tutorial i have decided to use this picture of a cute little kitten so lets get started shall we



1. Open the image in photoshop and press CTRL+A (to select all) than press CTRL+C (Copy) once you have copied the image press CTRL+N (To open new image) here what you will do is set the color mode to gray scale, see the following image for illustaration.



Once you have a new blank window open press CTRL+V to paste the image into place, Notice it would be black and white now.

2. Now you have two images, one in color and one in black and white, go to black and white image select all by CTRL+A and than copy it to clip board by CTRL+C now go to the color image and paste the image there by pressing CTRL+V. You will notice in the layers dialogue box (towards your right as in the image below) two layers one in b&w (on top) and the original image in color below it. Refer to the image below



3. Now select magic wand (either by pressing W on your keyboard or by clicking on the icon in the toolbar as shown in the image above) What magic wand does is select pixels by color matching and it selects an area with matching color. There are other methods of selecting and editing image but we shall use magic wand in this tutorial.



Once you click magic wand and click on the image it will result in a abrupt selection such as shown in the image above, It may look complicated but don't freak out.

5. You will notice that a lot of places outside and even inside the kitten are selected, Our aim in this excersise is to roughly select the outline of the kitten, For that purpose we will now edit our selection. For this purpose at least my favorite way of achieving it is to use Marquee tool (Press M on the keyboard). Once you have the tool selected you can Add further area to your selection or you can Remove area from the selection, This can be achieved by press ALT (You will see a small - sign) to remove selection or you can use CTRL (You will see a small + sign) to add to your selection. Play around by adding and subtracting the selection till you approximately have the outline of the kitten selected. It may sound hard but it is not give it a shot. Refer to the image below.




6. Now the hardest part is over so congratulate yourself, You can pull off two effects here,

    1. You can make kitten black and white and background colored
    2. You can make kitten colored and background black and white.

We shall see both of the effects

6.1 With the selection which you made back in step 5 simply press the DEL key and you will get a nice black and white kitty cat with colored background like the image below



6.2 Now lets revert back and try another effect, For that purpose locate the "History" box on your right, History keeps track of all the changes you have to your image, You can set how much do you want to keep in history by changing the photoshop preferences. For this excersise you need to go one step back so simply click on the previous item in the history box to go back to previous state. Refer to the image below




6.3 Now we have to try the other effect, Go to SELECT menu and than select INVERSE, Now simply press the DEL key and presto you will see the kitten in black and white while having the kitten in color like in the image below.



It's not rocket science, What we did was simply delete something from the black and white layer so that we can see what is underneath that layer (which would be identical color copy) so it gives you the effect of having black and white over color and vice versa. This is a very popular effecct widely used by many studios and they charge you an ample amount of money to do something simple as this.

This was a very vague overview how to pull this effect off, If you have any questions or querries than do let me know will be happy to answer! :)