<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7519206865613686147</atom:id><lastBuildDate>Fri, 22 Jan 2010 20:19:59 +0000</lastBuildDate><title>A pile of sysadmin notes!</title><description>My blog contains crib sheets about system administration tasks. You will find here some notes about cvs/svn repositories, firewalls, scripting, policies, security. This source of knowledge is very useful for me, I hope you find it useful too.</description><link>http://pileofnotes.blogspot.com/</link><managingEditor>noreply@blogger.com (randradas)</managingEditor><generator>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/blogspot/pileofnotes" /><feedburner:info uri="blogspot/pileofnotes" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7519206865613686147.post-1733523473023532043</guid><pubDate>Mon, 02 Jun 2008 11:34:00 +0000</pubDate><atom:updated>2008-06-02T13:35:44.556+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">shell</category><title>Find your most sized files</title><description>It is very easy with 'find' unix tool:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ find / -size +100000k -exec ls -lh '{}' \;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7519206865613686147-1733523473023532043?l=pileofnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/blogspot/pileofnotes/~3/9EigtKoCUnc/find-your-most-sized-files.html</link><author>noreply@blogger.com (randradas)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://pileofnotes.blogspot.com/2008/06/find-your-most-sized-files.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7519206865613686147.post-1157657866162393075</guid><pubDate>Wed, 23 Apr 2008 23:11:00 +0000</pubDate><atom:updated>2008-04-24T01:14:27.246+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">benchmark</category><title>Hard disk benchmark</title><description>HD benchmarking is easy with bonnie++&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# apt-get install bonnie&lt;br /&gt;# mkdir /store/bench&lt;br /&gt;# chown randradas:randradas /store/bench &amp; chmod 755 /store/bench&lt;br /&gt;# bonnie++ -d /store/bench -s 6600 -x 5 -u randradas:randradas -q -f 2&gt;&amp;1 | tee bonnie++.LOG &amp;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Change 6600 to two times your ram to get a good result.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7519206865613686147-1157657866162393075?l=pileofnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/blogspot/pileofnotes/~3/Q-DkUgnBJHY/hard-disk-benchmark.html</link><author>noreply@blogger.com (randradas)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://pileofnotes.blogspot.com/2008/04/hard-disk-benchmark.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7519206865613686147.post-9198442354310604216</guid><pubDate>Tue, 15 Apr 2008 20:17:00 +0000</pubDate><atom:updated>2008-04-15T22:26:02.909+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">apache</category><category domain="http://www.blogger.com/atom/ns#">proxy</category><title>Forwarding proxy with Apache</title><description>Edit prx.confwith the next Apache directives and adapt it to your port and directory requirements:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so&lt;br /&gt;LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so&lt;br /&gt;LoadModule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so&lt;br /&gt;&lt;br /&gt;Listen 8887&lt;br /&gt;&lt;br /&gt;ProxyRequests On&lt;br /&gt;#put &lt; and &gt; to the next directive&lt;br /&gt; Proxy *&lt;br /&gt;   Order Deny,Allow&lt;br /&gt;   Deny from all &lt;br /&gt;   Allow from 10.0.0.0/24&lt;br /&gt;#put &lt; and &gt; to the next directive&lt;br /&gt; /Proxy&lt;br /&gt;&lt;br /&gt;LogLevel warn&lt;br /&gt;CustomLog /home/randradas/prx/access.log combined&lt;br /&gt;ErrorLog /home/randradas/prx/error.log&lt;br /&gt;PidFile /home/randradas/prx/apache.pid&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Run the proxy with as normal user:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ /usr/sbin/apache2 -f prx.conf&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And then connect to the proxy from your http client, the server is listening in the 8887 port.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7519206865613686147-9198442354310604216?l=pileofnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/blogspot/pileofnotes/~3/Y_c30txNVag/forwarding-proxy-with-apache.html</link><author>noreply@blogger.com (randradas)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://pileofnotes.blogspot.com/2008/04/forwarding-proxy-with-apache.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7519206865613686147.post-4511531358518544771</guid><pubDate>Wed, 02 Apr 2008 10:49:00 +0000</pubDate><atom:updated>2008-04-02T19:02:00.966+02:00</atom:updated><title>Resize Xen disk image</title><description>&lt;pre&gt;&lt;br /&gt;losetup -f&lt;br /&gt;losetup /dev/loop0 disk.img&lt;br /&gt;e2fsck -f /dev/loop0&lt;br /&gt;resize2fs /dev/loop0 6G&lt;br /&gt;   resize2fs 1.40-WIP (14-Nov-2006)&lt;br /&gt;   Resizing the filesystem on /dev/loop0 to 1572864 (4k) blocks.&lt;br /&gt;   The filesystem on /dev/loop0 is now 1572864 blocks long.&lt;br /&gt;e2fsck -f /dev/loop0&lt;br /&gt;losetup -d /dev/loop0&lt;br /&gt;&lt;br /&gt;losetup /dev/loop0 disk.img&lt;br /&gt;fsck -n /dev/loop0&lt;br /&gt;fsck 1.40-WIP (14-Nov-2006)&lt;br /&gt;e2fsck 1.40-WIP (14-Nov-2006)&lt;br /&gt;/dev/loop0: clean, 112769/786432 files, 458389/1572864 blocks&lt;br /&gt;eddard:/xens/domains/beta.osor.eu# tune2fs -O ^has_journal /dev/loop0&lt;br /&gt;tune2fs 1.40-WIP (14-Nov-2006)&lt;br /&gt;eddard:/xens/domains/beta.osor.eu# e2fsck -f /dev/loop0&lt;br /&gt;   e2fsck 1.40-WIP (14-Nov-2006)&lt;br /&gt;   Pass 1: Checking inodes, blocks, and sizes&lt;br /&gt;   Pass 2: Checking directory structure&lt;br /&gt;   Pass 3: Checking directory connectivity&lt;br /&gt;   Pass 4: Checking reference counts&lt;br /&gt;   Pass 5: Checking group summary information&lt;br /&gt;   /dev/loop0: 112769/786432 files (0.6% non-contiguous), 425587/1572864 blocks&lt;br /&gt;&lt;br /&gt;For example, to create a 2GB sparse file-backed virtual block device (actually only consumes 1KB of disk):&lt;br /&gt;&lt;br /&gt;    # dd if=/dev/zero of=vm1disk bs=1k seek=2048k count=1 &lt;br /&gt;&lt;br /&gt;Make a file system in the disk file:&lt;br /&gt;&lt;br /&gt;    # mkfs -t ext3 vm1disk &lt;br /&gt;&lt;br /&gt;(when the tool asks for confirmation, answer `y')&lt;br /&gt;&lt;br /&gt;Populate the file system e.g. by copying from the current root:&lt;br /&gt;&lt;br /&gt;# mount -o loop vm1disk /mnt&lt;br /&gt;# cp -ax /{root,dev,var,etc,usr,bin,sbin,lib} /mnt&lt;br /&gt;# mkdir /mnt/{proc,sys,home,tmp}&lt;br /&gt;&lt;br /&gt;Tailor the file system by editing /etc/fstab, /etc/hostname, etc. Don't forget to edit the files in the mounted file system, instead of your domain 0 filesystem, e.g. you would edit /mnt/etc/fstab instead of /etc/fstab. For this example put /dev/sda1 to root in fstab.&lt;br /&gt;&lt;br /&gt;Now unmount (this is important!):&lt;br /&gt;&lt;br /&gt;    # umount /mnt &lt;br /&gt;&lt;br /&gt;In the configuration file set:&lt;br /&gt;&lt;br /&gt;    disk = ['file:/full/path/to/vm1disk,sda1,w'] &lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7519206865613686147-4511531358518544771?l=pileofnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/blogspot/pileofnotes/~3/HhN0ag5JAA0/resize-xen-disk-image.html</link><author>noreply@blogger.com (randradas)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://pileofnotes.blogspot.com/2008/04/resize-xen-disk-image.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7519206865613686147.post-4529755025280479724</guid><pubDate>Fri, 07 Mar 2008 16:33:00 +0000</pubDate><atom:updated>2008-03-07T17:41:36.553+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">X11</category><title>Export X11</title><description>Scenario: Mac OS X (nieve)/server, Debian Etch (stark)/client&lt;br /&gt;Objetive: Run a X application in my Mac OS&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Run X11 in Mac OS&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Open a terminal:&lt;/li&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;nieve:~$ xhost +stark_ip    (this step allows your client to connec to your server)&lt;br /&gt;nieve:~$ ssh -X randradas@stark_ip&lt;br /&gt; ..&lt;br /&gt; ..&lt;br /&gt; Welcome to stark&lt;br /&gt; ..&lt;br /&gt;stark:~$ export DISPLAY=nieve_ip:0.0&lt;br /&gt;stark:~$ evolution &amp;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;Now you have Evolution running in your X11 server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7519206865613686147-4529755025280479724?l=pileofnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/blogspot/pileofnotes/~3/9G3zXP6KQgM/export-x11.html</link><author>noreply@blogger.com (randradas)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://pileofnotes.blogspot.com/2008/03/export-x11.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7519206865613686147.post-3133276105046426286</guid><pubDate>Thu, 21 Feb 2008 19:24:00 +0000</pubDate><atom:updated>2008-02-21T21:38:40.910+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">subversion</category><category domain="http://www.blogger.com/atom/ns#">ssl</category><category domain="http://www.blogger.com/atom/ns#">apache</category><category domain="http://www.blogger.com/atom/ns#">svn</category><title>Apache2+SSL+SVN</title><description>&lt;pre&gt;&lt;br /&gt;# apt-get install apache2 openssl ssl-cert&lt;br /&gt;# mkdir /etc/apache2/ssl&lt;br /&gt;# make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache2.pem&lt;br /&gt;# chmod 600 /etc/apache2/ssl/apache.pem&lt;br /&gt;# cd /etc/apache2/sites-available/&lt;br /&gt;# cp default ssl&lt;br /&gt;# a2ensite ssl&lt;br /&gt;# a2enmod ssl&lt;br /&gt;# vim /etc/apache2/ports.conf&lt;br /&gt;   ..&lt;br /&gt;   Listen 443&lt;br /&gt;   ..&lt;br /&gt;# vim /etc/apache2/sites-available/svn&lt;br /&gt;   ..&lt;br /&gt;   NameVirtualHost *:443&lt;br /&gt;   VirtualHost *:443&lt;br /&gt;      SSLEngine On&lt;br /&gt;      SSLCertificateFile /etc/apache2/ssl/apache.pem&lt;br /&gt;      ..&lt;br /&gt;   VirtualHost&lt;br /&gt;&lt;br /&gt;# /etc/init.d/apache2 restart&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;At this point you have an Apache server with SSL. Follow the next commands in order to integrate svn with Apache+SLL&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# cd /&lt;br /&gt;# mkdir /svnroot&lt;br /&gt;# chown www-data /svnroot/&lt;br /&gt;# su www-data -c "svnadmin create /svnroot/repository"&lt;br /&gt;# su www-data -c "htpasswd -c -m /svnroot/.dav_svn.passwd testuser"&lt;br /&gt;  ..&lt;br /&gt;  ..&lt;br /&gt;# vim /etc/apache2/sites-available/svn&lt;br /&gt;  ..   &lt;br /&gt;  Location /svn&lt;br /&gt;       DAV svn&lt;br /&gt;       SVNParentPath /svnroot/&lt;br /&gt;       AuthType Basic&lt;br /&gt;       AuthName "LibreForge Subversion Repository"&lt;br /&gt;       AuthUserFile /svnroot/.dav_svn.passwd&lt;br /&gt;       Require valid-user&lt;br /&gt;  Location&lt;br /&gt;  ..&lt;br /&gt;# /etc/init.d/apache2 restart&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now you can use your repository with the testuser created recently:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ svn co https://your.domain.tld/svn/repository&lt;br /&gt;$ cd repository&lt;br /&gt;$ touch testfile&lt;br /&gt;$ svn add testfile&lt;br /&gt;$ svn ci -m "restfile added"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Or see your repository through https, https://your.domain.tld/svn/repository&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7519206865613686147-3133276105046426286?l=pileofnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/blogspot/pileofnotes/~3/d1ddMGNhixE/apache2ssl.html</link><author>noreply@blogger.com (randradas)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://pileofnotes.blogspot.com/2008/02/apache2ssl.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7519206865613686147.post-4373193098903751720</guid><pubDate>Sat, 05 Jan 2008 15:35:00 +0000</pubDate><atom:updated>2008-01-05T17:04:00.464+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">google search hack</category><title>Google hack</title><description>You can search indexed directories with Google using the next chain:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;-inurl:(htm|html|php) intitle:"index of" +"last modified" \&lt;br /&gt;+"parent directory" +description +size +(avi|mpg) "Kickboxer"&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7519206865613686147-4373193098903751720?l=pileofnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/blogspot/pileofnotes/~3/DGgD3iq1VOI/google-hack.html</link><author>noreply@blogger.com (randradas)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://pileofnotes.blogspot.com/2008/01/google-hack.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7519206865613686147.post-2621687447565442964</guid><pubDate>Sun, 02 Dec 2007 13:44:00 +0000</pubDate><atom:updated>2009-01-12T12:13:44.502+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">vim</category><title>Substitute chains with VIM</title><description>:%s/pattern/newchain/&lt;br /&gt;&lt;br /&gt;This will substitute the first chain that matches the pattern, if you want to substitute all the chains that match the pattern the correct syntax is:&lt;br /&gt;&lt;br /&gt;:%s/pattern/newchain/g&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7519206865613686147-2621687447565442964?l=pileofnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/blogspot/pileofnotes/~3/ZyxreKZceWw/substitute-chains-with-vim.html</link><author>noreply@blogger.com (randradas)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://pileofnotes.blogspot.com/2007/12/substitute-chains-with-vim.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7519206865613686147.post-1712497348052420331</guid><pubDate>Mon, 29 Oct 2007 13:38:00 +0000</pubDate><atom:updated>2007-10-29T17:55:25.160+01:00</atom:updated><title>Excluding a directory with tar</title><description>&lt;pre&gt;&lt;br /&gt;$ tar -cvf file.tar / --exclude "/path/to/directory"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You musn't to write / character and the end of the pattern you would like to exclude.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7519206865613686147-1712497348052420331?l=pileofnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/blogspot/pileofnotes/~3/eF-cWxT-0dM/excluding-directory-using-tar.html</link><author>noreply@blogger.com (randradas)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://pileofnotes.blogspot.com/2007/10/excluding-directory-using-tar.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7519206865613686147.post-8902900325209984042</guid><pubDate>Fri, 26 Oct 2007 13:09:00 +0000</pubDate><atom:updated>2007-10-26T16:27:06.471+02:00</atom:updated><title>MySQL tricks</title><description>New root password:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mysqladmin -u root password NEWPASSWORD&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Change root password:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mysqladmin -u root -p oldpassword newpass&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Create user account:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mysql&gt; GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'&lt;br /&gt;    -&gt;     IDENTIFIED BY 'some_pass' WITH GRANT OPTION;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7519206865613686147-8902900325209984042?l=pileofnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/blogspot/pileofnotes/~3/tvyozK3yZ2E/mysql.html</link><author>noreply@blogger.com (randradas)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://pileofnotes.blogspot.com/2007/10/mysql.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7519206865613686147.post-8648895336662015932</guid><pubDate>Thu, 25 Oct 2007 23:16:00 +0000</pubDate><atom:updated>2007-10-26T01:18:31.031+02:00</atom:updated><title>MySQL query to CSV</title><description>You again? uff.. well here is your reward.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;select * from example into outfile '/tmp/example.csv' fields \&lt;br /&gt;terminated by ',' lines terminated by '\n';&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I'll see you ASAP looser.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7519206865613686147-8648895336662015932?l=pileofnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/blogspot/pileofnotes/~3/LsCUnj1Uvdc/mysql-query-to-csv.html</link><author>noreply@blogger.com (randradas)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://pileofnotes.blogspot.com/2007/10/mysql-query-to-csv.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7519206865613686147.post-267877292879251760</guid><pubDate>Thu, 25 Oct 2007 23:02:00 +0000</pubDate><atom:updated>2007-10-26T01:15:41.362+02:00</atom:updated><title>CSV to MySQL</title><description>Have you tried to import a CSV file to your MySQL database without success ? :), ok I'll make your day (Clint Eastwood).&lt;br /&gt;&lt;br /&gt;prompt in your mysql console as create a table with the fields of your csv file, for example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mysql&gt; CREATE TABLE `test` (&lt;br /&gt;    -&gt; `fe` VARCHAR( 2 ),&lt;br /&gt;    -&gt; `fi` VARCHAR( 2 ),&lt;br /&gt;    -&gt; `fo` VARCHAR( 2 ),&lt;br /&gt;    -&gt; `fum` VARCHAR( 2 )&lt;br /&gt;    -&gt; );&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Ok? the next step is to import the file into the recent created table:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mysql&gt; load data LOCAL infile '/testfile' into table test \ &lt;br /&gt;fields terminated by ',' lines terminated by '\n';&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;/testfile is like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;aa,bb,aa,rr&lt;br /&gt;re,we,as,qw&lt;br /&gt;ty,qw,as,as&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7519206865613686147-267877292879251760?l=pileofnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/blogspot/pileofnotes/~3/2o6U0MIeXDw/csv-to-mysql.html</link><author>noreply@blogger.com (randradas)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://pileofnotes.blogspot.com/2007/10/csv-to-mysql.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7519206865613686147.post-1106455086398870296</guid><pubDate>Sat, 20 Oct 2007 03:06:00 +0000</pubDate><atom:updated>2007-10-25T01:25:53.761+02:00</atom:updated><title>Duplicate a directory structure, using rsync.</title><description>You can duplicate a directory structure without duplicate the contents of these directories using 'rsync'.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ rsync -avz --include='*/' --exclude='*' SOURCEDIR DESTDIR&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Obviously login as root in the remote computer is a requirement whether you want to preserve the ownership.&lt;br /&gt;&lt;br /&gt;Note: When I copy files to a remote computer I'm not capable of preserve the ownership of the files using this rsync options in spite of the rsync man says that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7519206865613686147-1106455086398870296?l=pileofnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/blogspot/pileofnotes/~3/2vIZUlVZmks/duplicate-directory-structure-using.html</link><author>noreply@blogger.com (randradas)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://pileofnotes.blogspot.com/2007/10/duplicate-directory-structure-using.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7519206865613686147.post-3659903606768191193</guid><pubDate>Sat, 20 Oct 2007 02:47:00 +0000</pubDate><atom:updated>2007-10-25T01:46:05.602+02:00</atom:updated><title>CVS to SVN</title><description>The next note is about migrate a cvs repository to subversion. Basically you need the 'cvs2svn' command in your system to do it.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# cd&lt;br /&gt;# mkdir project&lt;br /&gt;# cd project&lt;br /&gt;# cvs2svn --dump-only --dumpfile ./project.dump \ &lt;br /&gt;/cvsroot/project/&lt;br /&gt;# svnadmin create /svnroot/project&lt;br /&gt;# svnadmin load /svnroot/project &lt; ./project.dump&lt;br /&gt;# chown -R www-data:www-data /svnroot/project/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That's all&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7519206865613686147-3659903606768191193?l=pileofnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/blogspot/pileofnotes/~3/Sl4o-eXriyA/cvs-to-svn.html</link><author>noreply@blogger.com (randradas)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://pileofnotes.blogspot.com/2007/10/cvs-to-svn.html</feedburner:origLink></item></channel></rss>
