Archive for the 'linux' Category

PostgreSQL custom Restore

December 7th, 2011

On dumping and restoring PostgreSQL databases, there may be the case for restoring selected tables from a global db dump.
For this to happen one needs to have the right options when dumping the data.
pg_dump
$ pg_dump -Fc -U username database_name > db_dump
Now, we have a “restore customizable” compressed dump of the database.
From the postgres documentation:
  -F format
  –format=format
    Selects […]


Convert SQL Server database to PostgreSQL via CSV

December 2nd, 2011

Needed to convert a client Microsoft SQLSERVER database to our PostgreSQL database server.
Lots of tables, severall Gigabytes of data.

In Windows:

open the SQL Server administration console for the databae and do a DIR > tables.txt to get a file with all the table names;
remove all the tables you will not be needing from the file;
now to […]


install do_postgres on OSX Leopard

March 3rd, 2010

Install notes for Datamapper do_postgres driver ruby gem on severall operating systems:
Apple OSX Snow Leopard
System Version: Mac OS X 10.6.2
Kernel Version: Darwin 10.2.0
(No Macports; No Homebrew)
PosgreSQL 8.4
I wanted to have PosgreSQL server working on the mac so that development is easier.
There is a .dmg package from the guys at EnterpriseDB that is a single click install. Check […]


Revision Control Software workshop

November 23rd, 2009

Last saturday the local Linux group, PortoLinux had a meeting at the engineering faculty of Porto University to discuss about usage of diferent SCM’s.
Main systems covered, centralized vs distributed:
- Subversion
- Git
It was a good tech event, spent a good time there.
Some photos here.


on work…

January 15th, 2009

3 or 4 new projects ahead.
One of them will be  CouchDB and Merb (no DataMapper, no ActiveRecord). The db schema is modeled by each user and upon criteria decisions.
All of them Git managed, as been doing for the last year.
Served by a Debian based Linux distro, coded under Debian, UNR (my lovely little netbook), and […]


blog with Vim script

April 10th, 2008

… after severall exchanged emails between me and Andrei Thorp about the Vim blogging ruby script, we made some changes. So instead of the initial test for Vim compiled with +ruby message s:ErrMsg, we now have an echo.
Andrei’s git (yep, they are git fans too, git rocks!) commit was calling another Vim from his machine. […]


Twittershoes: programming in Shoes.rb

February 22nd, 2008

I have to share this piece of code, wich results look indeed nice. You’ll see in the next blog post…

def string_alert
  c = (LIMIT-@iSay.text.length)
  @remaining.style :stroke => “#3276BA”
  c > 10 ? (@remaining.style :stroke => orange) : (@remaining.style :stroke => red) if (c < 21)
  c > 0 ? “#{c.to_s} chars” : “Too Long!”
end

[update]: Twittershoes.rb is born: screenshot here


first repo at github.com

February 15th, 2008

… just got my github.com invitation and proceeded to the registration.
They say its free while in Beta. Hosted in Engine Yard.
I created my first repo there, and the design seems clear, simple, effective.
Info is presented clearly, and i enjoyed the way they went after the creation of my repo, showing “Next Steps”. Nice.
I’ll work there […]


pg_upgradecluster 8.2 main

February 12th, 2008

PostgreSQL 8.3 is here. After apt-get’ing it, the upgrade didn’t move the 8.2 cluster up. Having 8.2 running in a custom port, made 8.3 go use the standard 5432 port.
8.3 created a main cluster.
Check ports:
$ sudo netstat -anput | grep postgres
Check wich configuration files and wich versions are running:
$ ps -Af | grep postgres
pg_upgradecluster when […]


Edit remote scipts on local VIM under SSH generated RSA keys

September 28th, 2007

Passphrases, when used the good way, present a higher level of security over passwords, but what if you are editing scripts on a remote server using a local Vim ? For every open, write, explore, you are asked for it. After a certain amount of times, it starts making no sense, and you’ll end up […]


Ruby REXML::CData RDOC page

July 12th, 2007

… one can read this is in the official REXML::CData RDOC page:
ie_hack: Internet Explorer is the worst piece of crap to have ever been written, with the possible exception of Windows itself. Since IE is unable to parse proper XML, we have to provide a hack to generate XML that IE‘s limited abilities can handle. […]


</short post> Debian 10Y Social Contract

July 4th, 2007

10 years of Debian Social Contract… July 5, 1997 - July 5, 2007.


Debian CUT

July 3rd, 2007

Joey Hess proposed some months ago an interesting slight realign for the Debian release model. Basically he proposes the formation of a team to ensure a Constantly Usable Testing (CUT) allowing for some (lots of) users to have access to a well formed and current packaged version of… Testing. CUT would enforce that Testing should […]


Linus Torvalds on git

July 1st, 2007

Linus talked on Google about his source control management system, with questions from the audience. 70 precious minutes… with humour, smart ideas, good explanations on the theory of team software development, focusing on building a trust network, on performance, on centralized vs distributed systems, security, etc.
(by minute 60, this guy kicks Google Code (SVN) ass… […]


</short post>

June 10th, 2007

Vim color scheme for the next weeks:
:colorscheme desert


MTA Comparison

May 17th, 2007

… this page is a good and simple comparison page for different MTA’s like Exim, Postfix, qmail and Sendmail.
“One scenario is to use Postfix and Exim. The logic for Postfix is that an MTA facing the Internet needs to be as secure as possible it must perform as few functions as possible. For Exim, an […]


Blogging from Vim

May 11th, 2007

… i finally set up the page for the download of the vimblog.vim vim-ruby script. It will allow you to manage your blog posts from *the* editor VIM, very easilly. Learn one single command and, at maximum, seven simple parameters. So go ahead and blog with vim.


</short post>

April 30th, 2007

Bug #1 in Ubuntu
blogged with VIM


“All the computer people use Macs or Linux now”

April 9th, 2007

… this is Paul Graham’s version of why Microsoft is dead. There are some interesting parts in it. One thing he does not state, is that Microsoft never drove the internet trends. They get always late, and sometimes very late. Then, the huge ammount of monetary units and a very confortable monopolistic position in the […]


Linux recovers XP boot sector(s)

March 16th, 2007

Well, a post about Windows… who’d say about that…
The thing is: is have a HP desktop that after a good BIOS update, got its motherboard dead. Good BIOS update. Pretty much dead motherboard. Not only happened to me. There are foruns about these HP BIOS updates for this motherboard series that gave lot’s of problems. […]


Blogging from VIM (timezone insanity)

February 25th, 2007

Blogging from VIM is now possible using this script. This post is being written using it. But one problem is making me loose a great ammount of time: dateCreated, meaning TMZ headache.
Wordpress XMLRPC wants a datetime timestamp for the dateCreated field. I give it an ISO8601 format as stated in XMLRPC specs.
The post is sent […]


Vi blogging bundle

February 21st, 2007

… well the name reminds Brad Choate’s Textmate blogging bundle Brad is an excellent developer and like me, was once a Delphi (Borland great product) developer. I based this on his Textmate work. I’m coding a Vi / ViM / GViM script for a plugin that has some nice results already, exclusively for […]


Wordpress XMLRPC::Client.new()

February 18th, 2007

… when coding switter, using lot’s of command line, vim, bash, i felt the need to blog from vim. Some readings (quite a few availlable, actually) later, i was testing Wordpress xmlrpc using MovableType (Six Apart) calls to it. Vim allows ruby scripts (when compiled with that directive) use to create new commands, just like […]


switter on rubyforge.org

February 12th, 2007

…now, switter was accepted on rubyforge.org. I’ll try to put source and some docs there (rdoc does wonders) soon. Meanwhile, and with threahds now working for continuous message post/get, it just needs some tickles on the readline method.
switter on a maximized shell window receiving public timelines
switter on a normal sized shell window receiving public timelines


switter as a remote controller

February 8th, 2007

Had a new idea for the switter (twitter shell client) client.
What if you had a switch that enabled you to secretly send commands to the shell via twitter service ? Now, that can be (is) dangerous. But what if you defined an hash with predefined actions, and “secret” (remember, unsafe connection) codes ?
./switter -u test […]


Environment vars

February 8th, 2007

ENV is the hash that contains environment variables:
ENV.collect { |key, val| puts “#{key} ==> #{val}” }
ENV.each_pair { |key, val| puts “#{key} ==> #{val}” }

Need to know $HOME of the current user (needed for config files, say)?
puts ENV[’HOME’] if ENV.has_key?(’HOME’)
puts ENV[’HOME’] if ENV.key?(’HOME’)
puts ENV[’HOME’] if ENV.include?(’HOME’)
puts ENV[’HOME’] if ENV.member?(’HOME’)


switter: ruby twitter shell client

February 5th, 2007

been having some fun coding a twitter client for the *nix shell in (pure) ruby.
Soon will post source file for anyone to play with it.
Cool libraries used, include:
require ‘net/http’
require ‘rexml/document’
require ‘optparse’
require ‘yaml’
Configuration file created for user defs;
Command line switches prioritized over config. file;
Timeline options;
Working now on a minimal (shell) UI, message posting […]


muttrc builder

January 13th, 2007

Luke Ross built this Perl web app to help build your ~/.mutt/muttrc file.
Dropdown control helps select pages to fill out. The last page gives you the resource file ready for copy/paste.
…Mutt rocks!


… back on Mutt

January 7th, 2007

…broken computer motherboard made be use an older laptop, Celeron 1Ghz 256MB RAM.
Linux with XFCE and Mutt to read IMAP mail accounts. Mutt is cool !!


shell addiction…

September 29th, 2006

pedro@dapper:~$ history|awk ‘{print $2}’|awk ‘BEGIN {FS=”|”} {print $1}’|sort|uniq -c|sort -rn|head -10
based on Gunnar Wolf geeky script. See your shell trends…


Randal ‘Perl’ Schwartz, Guido ‘Python’ van Rossum,… on FLOSS

September 27th, 2006

Chris DiBona, open source program manager at Google, maintains a Netcast at TWiT.TV with Leo Laporte called FLOSS Weekly (Floss as Free Libre Open Source Software). Here’s a list of some of the most interesting ones:
#13: Eben Moglen on GPL 3.0
#12: PHP Creator Rasmus Lerdorf, on origins of PHP, challenges, …
#11: Guido van […]


Abiword saves th’day

September 23rd, 2006

a call from a friend asking for some help on a Word doc recovery. That’s how it started. On a 300km train travel, working important docs on a laptop makes the journey happen in a twist. But when adding non redimensioned images to it makes Word crash and take away the file, well, things go […]


The Google Culture

September 17th, 2006

This is an interesting page on Google Corporate Information website. Fun to see the equipment brief description:
“Equipment - Most Googlers have high powered Linux OS workstations on their desktops. In Google’s earliest days, desks were wooden doors mounted on two sawhorses. Some of these are still in use within the engineering group.”


Yet another day…

September 4th, 2006

I am now awake for almost 24 hours. Most of the time was spent with my beloved daughter and this laptop. I spent a good portion of my working day updating to a new release of Ubuntu Linux. This one is still in “Beta” phase, but i could not wait more. So I’m typing this […]