Powered By Blogger

Tuesday, May 3, 2011

Working with Files in Linux

c r e a t i n g    f i l e s
syntax:
cat > filename
  content
  content
  content
e.g.:
cat > todo_list
  eat
  rest
  sleep
* use ctrl + D to denote the end of the line

d i s p l a y i n g    f i l e    c o n t e n t s
syntax:
cat filename
e.g.:
cat todo_list

r e m o v i n g    f i l e s
syntax:
rm filename
e.g.:
rm todo_list

c o p y i n g    f i l e s
syntax:
cp oldfilename newfilename
e.g.:
cp old.pdf new.pdf
* copy the contents of the file to another file

r e n a m i n g    f i l e s
syntax:
mv oldfilename newfilename
e.g.:
mv oldfilename.txt newfilename.txt

f i l e n a m e    c o m p l e t i o n
press Tab key

Sunday, May 1, 2011

Managing CentOS Users and Groups



c r e a t i n g    u s e r s
syntax:
useradd [options] {username}
e.g.:
useradd --home /home/john john
useradd dhee

a d d i n g    p a s s w o r d
syntax:
passwd {password}
e.g.:
passwd dhee
*** Without pw, user account will be in lock status.

s e t    a c c o u n t    d i s a b l e    d a t e
syntax:
useradd -e {yyyy-mm-dd} {username}
e.g:
useradd -e 2011-06-28 dhee

s e t    d e f a u l t    p a s s w o r d    e x p i r y
syntax:
useradd -f {days} {username}
3.g.:
useradd -f -1 john
*** Type man useradd for options

l i s t i n g    a l l    u s e r s
e.g.:
cat /etc/passwd | grep "/home"
cat /etc/passwd | grep "/home" |cut -d: -f1
cat /etc/passwd | grep "/bin/bash" |cut -d: -f1

d e l e t i n g    a n    a c c o u n t
syntax:
userdel {username}
e.g.:
userrdel john

d e l e t i n g    u s e r ' s    h o m e    d i r e c t o r y
syntax:
userdel --remove {username}
e.g:
userdel --remove john

r e m o v i n g    a n    e m p t y    d i r e c t o r y
syntax:
rm -rf userdirectory
e.g.:
rm -rf john

a d d i n g    a    g r o u p
syntax:
groupadd {group}
e.g.:
groupadd accounts

a d d    a    u s e r    i n    a    g r o u p
syntax:
usermod -G {group} {account}
e.g.:
usermod -G accounts,sales,support john
usermod -a -G accounts,sales,support john

v i e w i n g    a l l    m e m b e r s    o f    a    g r o u p
syntax:
egrep "groupname" /etc/group
e.g.:
egrep "personal" /etc/group

d e l e t i n g    a    g r o u p
syntax:
groupdel {group}
e.g.:
groupdel accounts
***A group cannot be deleted if it is the primary group for any user.

Tuesday, April 26, 2011

Mount an NTFS Partition in CentOS



  1. Log on to your root account.

  2. Type the following commands

    • rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

    • wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
      rpm -ivh rpmforge-release-0.5.1-1.el5.rf.i386.rp

    • These commands install the RPMForge repositories, which provide access to third-party
      CentOS software.



  3. Enter the command yum install fuse fuse-ntfs-3g to install NTFS support.

  4. Type the command "vi etc/fstab" to open the system-wide file system table.

  5. Add a new line for the NTFS file system. e.g. /dev/hda5 /mnt/ntfs ntfs defaults 0 0

  6. Use ":wq" to write and quit.

  7. Create an NTFS file directory on /mnt.

  8. Mount the NTFS file by typing "mount /mnt/ntfs". /mnt/ntfs is the same path entered into the file system table.

Monday, April 11, 2011

10 factors to consider when seeking an ISP

1: Uptime commitments.
Insist on specific wording that governs what happens when service fails. Does your organization receive credit off its bill? Will the ISP scramble a technician 24x7? Both?

2: Downstream speed
Test all new circuits' downstream speeds the day they're installed, a month later, and quarterly after that.

3: Upstream capacity
The increasing popularity of VPNs, remote access, and automated offsite backups place great premiums on an ISP's upstream capacities.

4: Port freedom
ISP A may block Telnet on networks on the east side of town, but not the west. ISP B, meanwhile, may not block Telnet at all.

5: SMTP flexibility
Be sure to check with the ISP to learn whether it supports open SMTP port 25 traffic.

6: Accessible technical support
Support hours are between 9am and 5pm Monday through Friday. That's unacceptable for an ISP.

7: Responsive field service
Be sure you know the ISP's field response policies, and be sure they match your organization's requirements, before signing a contract.

8: Equipment quality
When comparing two ISPs' bids, consider the quality of each firm's equipment. The less time an IT pro must spend on site administering, reconfiguring, or restarting network equipment, the better.

9: Equipment flexibility
it makes more sense to purchase network equipment, where possible, to achieve lower total costs of ownership.

10: Pricing
When factoring price, however, be sure to compare apples to apples.

Friday, March 11, 2011

Move Dropbox folder to another Directory

Recently, I got a problem on my Local Disk. My drive C only has 200MB of space left.
If you also have the same problem, you need to move your Dropbox folder to another directory. In my case, I saved at most 4GB of free space.

Here are the steps on how to do this:

- Right click the Dropbox icon on taskbar. Check it on the the bottom right corner.
- Select Preferences...
- Click the Move... button.
- Choose a new place to your Dropbox, then click Ok.
- Wait for a few minutes. File transfer depends on the number of files stored on your Dropbox folder.

Hope this helps. :)

Sync files from different PC's with Dropbox


If you haven't heard of Dropbox lately, Dropbox is the easiest way to sync and share your files.

For months of using Dropbox, the use of my flash drive was eliminated and sharing of files to my colleagues became efficient. Documents from my office PC are synchronized to a Dropbox folder on my PC/Laptop at home. Aside from file synchronization, Dropbox also serves as a back-up tool for my files. Isn't that amazing?

I suggest you should try it.

Just go to Dropbox website or you may use my link below to create an account.

www.dropbox.com

Once signed up, you'll have a free 2GB disk space. You'll have two options to increase your disk space; either upgrade to PRO or by referral. You'll get additional 250MB once your friends used Dropbox for their files. The next step is download the installer, then install it to your Office/School/Home computer.

After the installation, you'll see a Dropbox folder stored on your My Documents folder. You may now start adding files or create shared folders.

Dropbox made syncing and sharing of files easy!

GNS3 for Beginners



GNS3 is an an open source emulation program for anyone who want to pursue a career on Cisco Routing. It's build on dynagen and dynamips foundation.

I've provided you simple steps on how a topology works on GNS3:

  1. Download GNS3 from http://www.gns3.net/download.
  2. Install GNS3.
  3. Run the program and click option 1 on Setup Wizard. "Configure and test the path to Dynamips. Also check that the working directory is valid". If you exit the Set up wizard, go to Edit | Preferences.
  4. Select a Project Directory. This is the path where your projects are saved.
  5. Select an Image directory. This is the path where IOS images are stored.
  6. Select Dynamips and click Test button. This will return a Dynamips "successfully started" message if Dynamips is running.
  7. Select option 2. Add one or more uncompressed IOS images.
  8. You have to take note of this: The IOS image in BIN format are compressed. You can load IOS image UNPACKED file for faster booting.
  9. Drag and drop devices (with IOS image) to build a topology.
  10. Add router modules (Double click the image, select the device and add slot/s on Slots Tab).
  11. Cable the connections ( Click add a link button on GNS3's toolbar and select type of cable).
  12. Power the devices by clicking the play button on GNS3's toolbar.

Some helpful tips:

Use the Idle PC feature to lessen the CPU usage of dynamips when the device is idle. To do this:
Right click the device, select idle PC, select the best idlepc values and select ok.

You can use wireshark captures to check packet data. To do this:
Right Click on the link between two devices, select Capture, then select a source. Go to Edit | Preferences | Capture and modify the settings to make this one work.

Wednesday, March 9, 2011

Speed up Firefox


You can use pipelining to speed up Firefox if you have a broadband conection. Instead of loading multiple things one at a time,things will be loaded on a page at once.

Here's how:

1. Enter "about:config" on the address bar.
2. Type network.http in the filter field
3. Change the following settings:
  • network.http.pipelining to true
  • network.http.pipelining to true
  • network.http.pipelining.maxrequests to a number like 20 (will make 20 requests at once)
4. Right click anywhere in the window, select New > Integer
  • preference name : nglayout.initialpaint.delay
  • integer value: 0 (the time before the browser's action on the received information)

Sunday, March 6, 2011

An online tool for checking bandwidth


We always use speedtest.net to check our upload and download speed. But hey, I recently discovered another online tool for checking your upstream and downstream bandwidth.

Check this site: http://broadband.mpi-sws.org/transparency/#tools

To test your broadband link characteristics, go to http://broadband.mpi-sws.org/transparency/bttest.php. You can also test BitTorrent traffic manipulation from the site. :)

A vampire or a werewolf?

A must read article if you're torn between the two: Programmer or System Administrator?

http://www.codinghorror.com/blog/2010/08/vampires-programmers-versus-werewolves-sysadmins.html

An exerpt from the article:

"Programmers are like vampires. They're frequently up all night, paler than death itself, and generally afraid of being exposed to daylight. Oh yes, and they tend think of themselves (or at least their code) as immortal."

"System Administrators are like werewolves. They may look outwardly ordinary, but are incredibly strong, mostly invulnerable to stuff that would kill regular people -- and prone to strange transformations during a moon 'outage'."

So, are you a vampire or a werewolf? ;)

Troubleshoot: Can chat but cannot browse problem

You can chat but you cannot browse? Want to blame your ISP for this? But wait, before calling your ISP and blaming them, try to investigate first. The problem is probably from your side, from the client's side.

Here's a list of possible solution for that kind of problem.
  1. Check your firewall settings. Unblock ports needed for browsing, your firewall might be blocking them.

  2. Ping google's ip: 209.85.175..106. If you can ping google's ip, then it's a DNS issue. If DHCP is configured, run these commands:

    ipconfig /release -->release the IP address for the specified adapter.
    ipconfig /renew -->renew the IP for the specified adapter.

  3. A spyware is running on your computer that prohibits you from browsing. Kill it!