1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# In the postgres console or pgAdmin #-h: host #-p: port #-U: database user #-d: database name psql -h 127.0.0.1 -p 5432 -U database_user -d database_name \COPY (SELECT * FROM mytable) TO E'/home/a/data/export.csv' CSV DELIMITER ','; One Liner from the command line # CSV psql -h 127.0.0.1 -p 5432 -U database_user -d database_name -c "COPY (SELECT * FROM mytable) TO E'/home/a/data/export.csv' CSV DELIMITER ',';" # Header psql -h 127.0.0.1 -p 5432 -U database_user -d database_name -c "COPY (select column_a,column_b from mytable limit 10) TO STDOUT WITH CSV HEADER;" > home/a/data/export.csv |
Monthly Archives: November 2013
Ubuntu – XnView – Installation – image viewer
XnView is a great image viewer popular under Windows and now available in Ubuntu ... Read more
Ubuntu – Linux Process Explorer – GUI – Installation
A process monitoring tool which looks like Sysinternals Process Explorer
Troubleshooting
1. ... Read more
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# download directory mkdir -p ~/build/process-explorer cd ~/build/process-explorer # download wget http://optimate.dl.sourceforge.net/project/procexp/bin_v1/procexp_1.5.275-0ubuntu1_all.deb # install dependancies sudo apt-get install -y python-configobj # install process explorer sudo dpkg -i procexp_1.5.275-0ubuntu1_all.deb # start sudo /bin/sh /usr/bin/procexp.sh # => more errors, doesn't work # => aaargh, i give up! |
Ubuntu – Installation of Great Little Radio Player
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# install dependencies - gstreamer sudo add-apt-repository -y ppa:gstreamer-developers/ppa sudo apt-get update sudo apt-get install -y gstreamer1.0* sudo apt-get install -y libgstreamer* #sudo apt-get install -y libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev # download #wget http://downloads.sourceforge.net/project/glrp/v1.4.4/greatlittleradioplayer_1.4.4_i386.deb wget http://downloads.sourceforge.net/project/glrp/v1.4.4/greatlittleradioplayer_1.4.4_amd64.deb # install sudo dpkg -i greatlittleradioplayer_1.4.4_amd64.deb # start greatlittleradioplayer |
Ubuntu – 64 bits or 32 bits – Determine the Computer Architecture using bash in the terminal
Using a bash function to determine the CPU architecture: amd64 or i386, x86_64 or ... Read more