Posts Tagged ‘Command’

19
Aug

Export CSV from MySql Database via SSH

   Posted by: Vlad    in Linux

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.

Tags: , , , , , , , , , , , , , , , , , , , , ,

25
Jun

Simple copy through SSH

   Posted by: Vlad    in Linux

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/

Tags: , , , , , , , , , , , , , , , , , , , , , , , ,

11
Jun

“RUN” Command in Windows Mobile

   Posted by: Vlad    in Mobile

“Run” Command in Windows Mobile does not exists in the menu, but it can be raised by holding the action middle button (for my Eten X800 this is the joystick) and simultaneously taping and holding the clock icon in the upper toolbar. When you release the action button you will have a context menu with Run and Clock. By taping run you will have a standard “Run” box in which you can enter any path to any executable on your mobile device.

Tags: , , , , , , , , , , , , , , , , , , , , ,

21
May

Command Window in Vista Setup

   Posted by: Vlad    in Windows

If you found yourself in the position of needing something from the Vista installation disk, you can always raise a Command Prompt Window, and navigate to that location. For example you need the product key so you can copy - paste it rather than typing it by hand.

During the GUI phase of the installation you can press the SHIFT + F10 keys, and you will have yourself a Command Window. From this you can navigate to a text file, or run regedit.exe or any other executable Vista copied to the installation folder on the hard disk.

Thank you Daniel Petri, for this information.

Tags: , , , , , , , , , , , , , , , , , , , , , , ,