Sunday, December 14, 2008

Export CSV from MySql Database via SSH

There is a time when you need to export a specific table from a mysql database. Through SSH this is made very easy using the following command:

echo “select * from table_name;” | mysql -u root -pyourpassword database_name | sed -e ’s/^Mn/r/g’ > /home/exported.csv

Of course you can make a small script that adds the date or other usefull information to the filename:

#!/bin/bash
#This scripts adds date to the exported CSV
NOW=$(date +”%m_%d_%Y_%H_%M_%S”)
echo “select * from table_name;” | mysql -u root -pyourpassword database_name | sed -e ’s/^Mn/r/g’ > /home/exported_$NOW.csv

Save this script as export_csv.sh and make it executable, and that’s it.

Wednesday, December 3, 2008

VPN for Linux Installation

VPN for Linux
Installation

These steps have been tested on recent versions of RedHat, Fedora, Ubuntu, and Slackware.

1. Obtain the IPSec Group Name and IPSec Password for either on campus use or off campus use by clicking the following link: VPN Account Information.
2. If prompted, enter your SacLink User ID and Password. If you have not created your account or have forgotten your account ID or password, see SacLink Information for details.
3. Obtain the VPN client from the Software Distribution Web Site by clicking the following link: http://software.csus.edu/
4. Click on the Obtain Software link in the left navigation bar.
5. Read and agree to the terms of distribution by clicking the I Agree link at the bottom of the page.
6. Log in using your SacLink username and password.
7. Locate the Cisco VPN Client for your operating system and click the Download link.
8. Click the Download Now button.
9. Save the file to your home directory. The file could take a few minutes to download depending on your connection speed.
10. Once the file is downloaded, close your browser.
11. Open a terminal session. How this is done depends on your distribution of Linux and whether or not you are running X windows.
12. Change directory to where you downloaded the file. If you downloaded the file to your home directory, simply type cd
13. Unpack the file that you have downloaded by typing
tar xvzf vpnclient-linux-4.0.1.A-k9.tar.gz
14. Change directory to the newly unpacked directory
cd vpnclient
15. You need to be the root user (superuser) to run the install script.
Type su and press enter.
16. Enter the root password.
17. To install the client type: ./vpn_install
18. Accept all the default selections by pressing the Enter key.
19. Restart your computer, or type (as root)
/etc/rc.d/init.d/vpnclient_init start
to start the vpn client without restarting.

Configuration

The following instructions assume you are using the vi (vee-eye) text editor. But you can use any text editor, such as emacs or pico (the instructions will vary slightly depending on your choice of editor).

1. Open a terminal session and become root (superuser).
2. Type su and press enter. Enter the root password.
3. Create a User Profile for the VPN Client. The default location of the sample profile is /etc/CiscoSystemsVPNClient/Profiles/.
4. Type cd /etc/CiscoSystemsVPNClient/Profiles/
5. Type ls
6. You must copy the sample.pcf file and rename it. To do so, type
cp sample.pcf oncampus.pcf
(offcampus.pcf for off campus connections).
7. Typevi oncampus.pcf
8. Using the arrow keys on the keyboard, place the cursor after the = sign at the Description prompt.
9. Press the esc key and then the x key, to delete the previous information.
10. Press the esc key and then the i key, to enter the new information.
11. Type Sac State On Campus VPN Connection or Sac State Off Campus VPN Connection at the prompt for the Description.
12. Using the arrow keys on the keyboard, place the cursor after the = sign at the Host prompt.
13. Press the esc key and then the x key, to delete the previous information.
14. Press the esc key and then the i key, to enter the new information.
15. Type vpn.csus.edu at the prompt for Host.
16. Using the arrow keys on the keyboard, place the cursor after the = sign at the GroupName prompt.
17. Press the esc key and then the x key, to delete the previous information.
18. Press the esc key and then the i key, to enter the new information.
19. Type the IPSec Group name you obtained from the VPN Account Information document.
20. Using the arrow keys on the keyboard, place the cursor after the = sign at the Username prompt.
21. Press the esc key and then the x key, to delete the previous information.
22. Press the esc key and then the i key, to enter the new information.
23. Type your SacLink login name at the Username prompt. The file should look like the On Campus or Off Campus sample.
24. Save the new profile by pressing the esc key followed by a colon and letters wq and then press enter (esc :wq enter).

Running the Client

1. Connect to the Internet.
2. Open a terminal session.
3. Type the following:
vpnclient connect profile
(where profile for on campus connections is: oncampus; and for off campus connections is: offcampus ).
4. It will prompt you to enter the group password.
5. It will display your SacLink user name.
6. At the password prompt, type your SacLink password.
7. The VPN services should now be enabled.
8. Connect to the Internet.

Saturday, November 29, 2008

CCNA: List of Simulator Tool

Followings are CCNA simulator tool for practicing CCNA

Packet Tracer - Packet Tracer 5.0 is the latest version of Cisco Networking Academy’s comprehensive networking technology teaching and learning software. Innovative features of Packet Tracer 5.0, including powerful simulation, visualization, authoring, assessment, and collaboration capabilities, will help students and teachers collaborate, solve problems, and learn concepts in an engaging and dynamic social environment. Moreover, it's totally free! You can download this software but you need to register first or you can find a mirror download with google (with keyword "download packet tracer")

Screen shots:


SemSim - The free trial version (2.3MB) offers some CCNA exam router simulation labs & 20 flash cards

Screen shots:



Boson NetSim - Boson offers three certification-focused products, NetSim for CCENT 7.0, NetSim for CCNA 7.0 and NetSim for CCNP 7.0. The NetSim for CCNA 7.0 product contains CCNA-specific lab exercises that cover the skill set you will need to prepare for your CCNA exam. The demo version (21.58MB) is a good choice to get started.

Screen shots:



CertExams offers advanced network simulators including router / switch / terminal simulator. The simulators help in preparing for networking exams such as ccna or jncia. It would also be very helpful for those who want to get started with configuring Cisco or Juniper routers in a simulated environment. The demo version (6.95MB) is limited to:

- Six lab exercises

- Router simulator is limited to User EXEC, Previleged EXEC, and Global Configuration mode commands.

Screenshots:


RouterSim's CCNA Network Visualizer - You can design, build and configure your own network. The demo version is 44.49MB. It is ideal for:

- Anyone studying for the Cisco® CCNA™ 640-802 exam

- Deployment over a LAN network

- Distance education and deployment on a Citrix server or Microsoft Terminal Services

- Corporate trainers and employees

- Students at colleges, universities, and technical institutes

Screen shots:


Your Ad Here