Export CSV from MySql Database via SSH

August 19, 2008 · Filed Under Linux · Comment 

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.

Simple copy through SSH

June 25, 2008 · Filed Under Linux · 1 Comment 

Copying files between remote machines can be easily done
using SCP command.

The syntax is:

copy from a remote machine to my machine:

scp user@192.168.0.1:/home/file.txt /home/x.txt

copy from my machine to a remote machine:

scp /home/x.txt user@192.168.0.1:/home/x.txt

copy all x*.txt from a remote machine to my machine (x01.txt, x02.txt, etc.)

scp “user@192.168.0.1:/home/x*.txt” /home/x.txt

copy a directory from a remote machine to my machine:

scp -r user@192.168.0.1:/home/folder /home/

Dell Wireless and Ubuntu Hardy Heron

May 31, 2008 · Filed Under Linux · 18 Comments 

dellbuntu.jpg

I have a Dell Inspiron 1520 with the Dell Wireless 1390 WLAN Mini-Card, one that has given many Linux users big headaches.

After trying many different approaches suggested all over the web, and gathering clues in many Ubuntu forum posts, I finally worked out this solution:

First of all you must check if you have the correct card:

lspci -nn | grep 14e4

Result: 05:00.0 Network controller [0280]: Broadcom Corporation BCM94311MCG wlan mini-PCI [14e4:4311 (rev 01)]

Then proceed to the first step:

1. blacklist bcm43xx

echo blacklist bcm43xx | sudo tee -a /etc/modprobe.d/blacklist

2. install ndiswrapper and related files

sudo apt-get install ndiswrapper-common ndiswrapper-utils-1.9 ndisgtk

Read more

Dell Inspiron 1520 linux sound too low

May 24, 2008 · Filed Under Linux · Comment 

When volume of the sound captured is too low, even with system sound volume set to maximum level, do the following:

1. Open the GNOME volume control tool:

$ gnome-volume-control

2. Select Edit -> Preferences and verify the following tracks are visible: PCM, Front, Capture, Mux and Digital. Click Close when done.

3. In the Options tab, verify that the Input Source is set to “Mic”.

4. To maximize volume of recorded sound: In the Recording tab, adjust the “Capture”, “Mix” and “Digital” sliders higher to raise the volume level of the captured audio. Click on the microphone icon on the bottom if it has a red cross on it to unmute it.

5. To maximize volume of playback sound: In the Playback tab, adjust the “PCM”, “Front” and “Surround” sliders higher to raise the volume level.


When the overall sound volume is too low, you should:

1. Right click on speaker icon in system tray, and select “Open Volume Control”

2. Go to Edit: Preferences

3. Put a check next to Front. Hit OK

4. Turn Front volume all the way up.

5. Now the master volume control raises and lowers the volume between much greater extremes.

  • Powered by: