Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Useful Linux command line tips

0 comments

Linux has become extremely easy to administer. And can be administered using GUI applications or using the Command line Interface (CLI)
As a professional Linux administrator, you’ll have to know how to administer the OS via the CLI
Linux supports multi-tasking, several users using the OS simultaneously.
By default 7 users can work simultaneously (without anyone logging out). 6 Commandline users and 1 GUI user. To switch use CTRL + ALT + F1 (F2,F3,F4,F5,F6,F7) . CTRL+ALT+F7 takes you to the GUI one
From the GUI, you can always access the command line via “Terminal”

Below are very useful command line tips

Understanding the different file types in Linux

0 comments

Ever wondered why you see different colors when you do ls in linux?
In this post I'll show you what each color stands for. 

In the screenshot below, I did ls -l which will show extra details - file type, file permission, file owner, owner's group, date of creation/modification and file name.
'Cos I did this on my android phone which runs a stripped version of Bash shell, the colors aren't showing. If you do this on a Linux PC, the file names will be colored differently.



Learn Unix/Linux

0 comments

Want to put your Unix/Linux skills on steroid?
Checkout the presentation below


Making programs and commands run on user login

0 comments

This week while installing Oracle 11g on Oracle Linux Server, I needed to automatically start some programs when the user logins in.

Here is why. Oracle Linux boots, by default, into a command line terminal or console. But to use the Oracle 11g Database Control application, you'll need to start the GUI X window. The command to do that is $ startx
The other issue is, the GUI launches into a blank desktop, no applications center or start menu bar. To start any program you'll have to right click, launch the Terminal and start you program via the command line.
For me this is no issue, but the intended end user of this Oracle 11g aren't that Linux savvy. I wanted them to just start the system and the X window would start automatically once they login and the dbconsole would be started too and finally Firefox would launch and open http://localhost:1158/em automatically.

Well, it was easy to accomplish. All I did was to edit the ~/.bash_profile file. I added the following lines -
startx
emctl start dbconsole
firefox http://localhost:1158/em

And voila, that did it.

How to set system environments permanently for a user

0 comments

I finally got Oracle 11g installed on Oracle Linux Server, it was no easy task. I had to edit so many kernel or system settings files.

To run Oracle, I had to set $ORACLE_UNQNAME to orcl each time I login to the Linux. And the command to start up the dbconsole, aarghh, it was a pain to type out - /u01/app/oracle/product/11.2.0/dbhome_1/bin/emctl start dbconsole
I'm yet to forget it.

Well, I decided to fix this once and for all. And all I did was to edit the ~/.bash_profile, added the following lines -
export ORACLE_UNQNAME=orcl
export PATH=$PATH:/u01/app/oracle/product/11.2.0/dbhome_1/bin

So now I no longer need to set the ORACLE_UNQNAME=orcl anymore as it is been done for me. And the long path to emctl command has been added permanently to the system PATH. All I now do is type
emctl start dbconsole
and voila, I'm done.

How to install the wireless driver for D-link RaLink 5360 dwa 525 on Ubuntu 12.10

0 comments

Recently, my boss has been having issues with his Windows 7 OS and decided to change to Linux. So as a pilot test, he installed Ubuntu 12.10 on his work PC and plans to install it on his laptop too.

Well, his PC has a D-link wireless card dwa 525 with RaLink chipset 5360 and to my surprise Ubuntu 12.10 doesn't have its driver preloaded. But Ubuntu 13.04 has. So in this post I will show you how I fixed the issue with special help from chili555 on this Ubuntu Forum Thread

I couldn't access the internet from the PC, so I had to download the driver from another PC connected to the internet.

Very useful Linux administration commands

0 comments

Love Linux Live Linux (c) www.sahipasand.com

I primarily use Linux on my laptop, I have both Ubuntu 12.10 and OpenSUSE 12.2 running on the laptop. And been having at least 2 linux distros on the laptop since 2009.

In this post I will share with you, some very useful linux commands -

man any_command  the manual for target command>
pwd  
ls files in current directory>
ls  –a maximum information about all files, including hidden>
mv source destination  a file or directory>
rm target 
cp source destination  file or directory>
mount /dev/device_name /media/device_name filesytem>
umount /media/device_name <Unmount>
df –h filesystem and available disk space  in KB, MB, GB>
du 
ps – ef all running processes, with full details>
top system monitor showing a more extensive view of all processes and system resources>
nohup command & a process in the background and have it keep running after you log off>
~/  user's home directory>
ifconfig  network interfaces>

iwconfig  wireless network interfaces>
ssh username@ip_address  to a remote server>
ping ip_address  to see if target is online and responding>
traceroute6 ip_address  network route to target>
netstat  
iptables –L  firewall rules>
adduser a new user>
usermod user privileges (be very careful with this one)>
deluser  
chmod <# Change privileges over file or directory >
chown user_name:group_name directory_name owner of a file or directory>
su username  become a different user>
users usernames of logged in users>
Infact, you can administer your mysql database directly from the CLI
CREATE DATABASE databasename; 
CREATE USER username@localhost IDENTIFIED BY 'password'; a new user>
show tables;  database schema>

Know other useful Linux commands? Please share via the comment box.

Learning Linux? Free online books and practical help tips

0 comments

Well just in case you still do not realize that I am typing this post on a Linux OS. Checkout the following screenshot.

Yes, I am typing out this post from my Ubuntu Linux OS, and I also have OpenSUSE, Windows 7 RC & Windows 8 RC(no $ to buy commercial version) all running on the same laptop, my venerable SONY VAIO.

So how did I learn to use Linux?
It all started in 2008. I started from ground zero. I was at the peak of my IT certification frenzy and I heard of this Linux + certification, so I decided to attempt the certification. I had done Oracle 10g Certified Administration Associate (OCA 10g) and Cisco Certified Network Associate (CCNA). 

I spoke with a senior colleague, and he was too busy to even hear me out. I proceeded to help myself, I downloaded Ubuntu 8.04 alternate CD (my greatest mistake in IT, so far) and ended up irreparably crashing my Windows. The problem was that I downloaded an alternate CD, fortunately Ubuntu no longer makes alternate CDs (I think). Alternate CD is purely a commandline based installation CD, and I knew nothing about Linux file structure - root folder, home folder, ext2 file system, swap space... I got stuck for what seemed like an eternity at specifying root file and choosing file system, it won't let me choose NTFS and I knew jack about the other options. Finally, after trying out so many combinations, it finally accepted one. I had installed my first Linux OS all by myself, without any help. I was extremely happy, even though my Windows was gone.


Ever since, I have grown in my understanding and use of Linux. I have installed Linux for over 20 people, installed nearly all the free distros and have been quadri/penta-booting OSs on my laptop since 2009. And I now train people on how to use Linux.

How did I achieve my expertise?
I read all I could on Linux. I kept practicing, sharing my knowledge and helping people solve their computer problems with my Linux knowledge. It got me the fix-it guy status among my friends.
Reading and practicing is the only way to learn Linux.

Where can you get good Linux books for free?
Linux prides itself as being free. And so many people have put up their Linux how-to books for free online. And a good starting point will be -
http://www.linux.org/tutorial/view/beginners-level-course 

Introduction to Linux 
http://tille.garrels.be/training/tldp/index.html

Linux Newbie Administration Guide 

http://lnag.sourceforge.net/downloads/LinuxNewbieAdministratorGuide.pdf

Bash Guide for Beginners 

http://tille.garrels.be/training/bash/

Ubuntu Pocket Guide & Reference

 http://ubuntupocketguide.com/download_main.html

I assure you that reading this book and practicing on a real Linux system, you'll become a Linux guru too.


You too can write Unix/Linux scripts

0 comments


Are you new to the world of Unix/Linux and hitherto have been impressed by the flexibility of the operating system?
Have you been considering scripting as a very cryptic task reserved for those that earn a living making them?
Well, it's time you hear the truth! Linux scripting is extremely easy and you too can start exploiting the benefits they offer.
Without much ado, let's see an example of a script.

#!/bin/bash
echo "Hello World"

Vital Linux tips

0 comments

I remember the first time I installed Linux, I had never seen Linux on a system before, didn't want to use a virtual machine and I was going to install it on my new laptop. On top of all these, I downloaded Ubuntu 8.04 Alternate CD image, which has no live-booting feature or even a graphic user interface for the installation, everything was console configuration. I spent hours doing the installation, there were over 10 steps (I strongly think) and I knew less than nothing about ext, ext2, ext3, swap space, grub and root. I got terribly stuck at the mount point, swap file and home partition configuration, I wasn't allowed to get to the next step until I had tried nearly all the options. I was sweating inside and couldn't wait to finish and see if the laptop will recognize its power button. Fortunately, God answered my Jonah modelled prayer, the laptop responded when I pressed the power button. It spent so much time on the VAIO logo display, my heart did a short sprint. Finally, it moved on and into the Ubuntu and my feelings were so mixed I couldn't breathe steady. I was extremely happy I had installed a Linux OS and also miserable that I had wiped off my Windows Vista before making a recovery disc.

That was about 3 years ago, though it's not a long time but in computer world it's like half a century. I, definately, have moved ahead and even installed Linux (several distros) over 30 times on over 10 laptops (most probably). So in this post I will share with your two vital Linux tips, or should I say keyboard shortcuts that I have been overusing.


TIP 1
Arguably the best feature of Linux (for enthusiasts) is that you can can install tens of full feature softwares on a disk space size Windows will use to install just one of those softwares. Take me for instance, my Fedora is installed on a 4GB partition (inclusive of swap space and Home) and yet I run out of space on my 50GB Windows XP partition nearly every month without ever running out of space on my Fedora (please, don't take this literally). In the end I get to have all the applications I want on my Linux, so it is often a task (medium size one) to search out the the application I want to run. This is where the Tip 1 comes to the rescue.
I just press the ALT and F2 key (on the keyboard) at the same time, then a small box come on screen and I type the name of the application I want to run. The best part of this is that it guesses the application as I provide the characters of the name, making it more than easy when I'm not sure of the application's name.










TIP 2
When we first get to know about Linux, we strongly believe it is all keyboard and blackscreen, no mouse pointer or GUI. Actually it used to be, and can still be (if you make it be). So the easiest (or cheapest) way to make it be is by installing a fancy GUI linux distro and booting into the dummy's galaxy of no more, then go further by using the key combination --


CTRL + ALT + F1






CTRL + ALT + F2



CTRL + ALT + F3






CTRL + ALT + F4



CTRL + ALT + F5



CTRL + ALT + F6



CTRL + ALT + F7



On some distros (like Fedora), the GUI is on F1 not F7.



Thanks for reading my blog, if you have any comment feel free to use the comment box. Have a great day.

How to share internet access on your android phone with other phones and computers via wireless connection (wifi)

0 comments

I have been hearing about a “Wireless Tether” app for months now and even tried installing it, but to my disappointment it requires me to have rooted my phone so I couldn't use it. Then last week I finally rooted my phone and was amazed by the quality of connectivity I got between my phone and my laptop. And another amazing thing about this wireless tethering than makes it far desirable than the USB tethering (that comes along with the android OS 2.2) is that it allows multiple computers to connect and even phones that have wifi. And you can also create an access list to allow internet access for only selected devices (computers, phones and maybe, printers).

So in this post, I am going to explain extensively to you how to use the wireless tether app to share internet access on your android phone with other phones and computers.

PREREQUISITE: A rooted android phone (if you are not sure yours is, then it most probably isn't, but for more info search google)

STEP 1
The first thing you'll do is to install the Wireless Tether app, go to the android market and search for “Wireless Tether” it has this unique logo of a green wifi signal. Download and install it.

STEP 2
Open the Wireless Tether app, tap the screen close to the middle (where there is the prompt – Press to start tethering) to start the wireless tethering. 

It will ask for Superuser permissions which you will need to grant and if you prefer, tick the remember this selection. Now don't bother if you do not notice your wifi turning on, as long as the wireless tether notification is showing on your notification bar, you are good to go.

STEP 3
On your computer (or phone) turn on the wireless adapter and search for wireless networks and you will notice an open network named AndroidTether. Connect to it, you should see “Acquiring network address” and then “Connected”.

 Now check the notification bar of your phone, and you should see a notice about a device trying to access your internet. But if this notification doesn't popup on yours, do not worry just follow on. On the the wireless tether app screen, press the menu button to reveal hidden options, tap on Setup, under Security make sure the Enable Access-Control is ticked. Now go back to the app's homescreen and press the menu button again, then tap on Access Control and Tick only the devices you want to grant access.



STEP 4
Go to your internet browser and start surfing the internet, it's as easy as that!


TROUBLESHOOTING
If you are unable to access the internet on your computer but can on your phone, it's most probably because your wireless adapter has been manually configured. Make sure the wireless adapter IPv4 address is set to automatic and not manual, you can check my former post on doing this. If you are still experiencing this problem, them go to the internet/netweork settings of your internet browser and make sure you are not connecting via any proxy.
If you need any further help or clarification, feel free to ask via comment.

Live Booting Linux from CD-ROM, DVD-ROM and USB Flash

0 comments

Step 1
Download or copy from someone who has, the Linux OS image (always in .iso format)
Step 2
If you do not have a software that can burn CD or DVD image, then download active@ ISO Burner, it is free. (Most CD burning utilities can burn images, I know of Nero and Roxio)
To make USB flash images, dowload liveusb-creator-3.7 free utility.
Step 3
Install these softwares and run them. The liveusb-creator-3.7 does not need installation, just extract the zip file and run the application
From Drop Box

Step 4
Insert the empty CDor DVD into your drive and set the parameters on the active ISO burner to that shown below

But if your CD or DVD drive is not very strong, set the Speed to 10x for CD and 4x for DVD. In fact, those settings are recommended even if your drive is new. This prevents error in the data burned since you will end up burning till the edge of the CD or DVD considering the size of the images which nearly equals the total capacity of the CD or DVD.
Then browse to the directory of the Linux OS image file and select it in the source box below.
From Drop Box

For the USB flash image,

click the browse button and select the image file. Indicate the Target Device and create live USB.
Step 5
Reboot your computer and set the boot sequence to use DVD/CD drive and USB drive before Hard Disk.
Voila! Your computer will boot into the Linux OS, just make sure you do not install the Linux yet, and choose 'Boot without installing' or 'Run without any changes to your computer'. Now you can tryout the Linux OS without installing it on your hard disk.

 
Follow me on Twitter | About me | Terms of Service | Privacy Policy