Archive for the 'linux' Category
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 […]
posted by pedro mg at 6:42 pm
& filed under linux, ubuntu, unix, postgres, postgresql, database | 2 Comments »
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 […]
posted by pedro mg at 1:31 am
& filed under linux, shell, windows, unix, postgres, postgresql, database | No Comments »
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 […]
posted by pedro mg at 5:24 am
& filed under linux, os, ubuntu, apple, ruby, code, debian, vimblog.vim, vimblog, merb, osx, postgres, postgresql, datamapper | 3 Comments »
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.
posted by pedro mg at 4:31 pm
& filed under tech, log, linux, code, open source, git, github, unix | No Comments »
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 […]
posted by pedro mg at 1:27 am
& filed under tech, web, rss, linux, os, ubuntu, ruby, standards, vim, gvim, s3, ec2, mac osx, debian, mvc, rspec, TODO, git, github, vimblog.vim, vimblog, merb, couchdb, aws | 6 Comments »
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. […]
posted by pedro mg at 3:22 pm
& filed under linux, ruby, shell, code, vi, vim | 2 Comments »
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
posted by pedro mg at 12:48 am
& filed under linux, ruby, code, twitter | 1 Comment »
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 […]
posted by pedro mg at 2:53 pm
& filed under linux, code, git | 3 Comments »
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 […]
posted by pedro mg at 1:10 am
& filed under linux, postgres, postgresql, database, dbms | 5 Comments »
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 […]
posted by pedro mg at 12:42 am
& filed under , tech, web, linux, os, file, shell, code, vi, vim, gvim, ssh | 1 Comment »
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. […]
posted by pedro mg at 3:48 am
& filed under , linux, ruby, code, vi | 2 Comments »
July 4th, 2007
10 years of Debian Social Contract… July 5, 1997 - July 5, 2007.
posted by pedro mg at 5:03 am
& filed under linux, debian | 2 Comments »
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 […]
posted by pedro mg at 1:49 am
& filed under linux, ubuntu, vim, etch, debian | 2 Comments »
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… […]
posted by pedro mg at 1:20 am
& filed under tech, google, linux, vim | No Comments »
June 10th, 2007
Vim color scheme for the next weeks:
:colorscheme desert
posted by pedro mg at 10:34 pm
& filed under linux, code, vi, vim | No Comments »
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 […]
posted by pedro mg at 3:54 pm
& filed under tech, mail, linux | 2 Comments »
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.
posted by pedro mg at 1:27 am
& filed under tech, web, linux, life, digital-life, ruby, shell, code, api, vi, vim, gvim, blog, open source, mac osx | No Comments »
April 30th, 2007
Bug #1 in Ubuntu
blogged with VIM
posted by pedro mg at 9:45 pm
& filed under tech, linux, ubuntu | No Comments »
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 […]
posted by pedro mg at 7:35 pm
& filed under tech, linux, life, digital-life, apple, blog | 1 Comment »
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. […]
posted by pedro mg at 10:01 am
& filed under tech, linux, os, ubuntu, shell, xp | 1 Comment »
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 […]
posted by pedro mg at 11:52 pm
& filed under tech, web, linux, ruby, code, api, vi, Wordpress, xmlrpc, vim, gvim, mac osx | No Comments »
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 […]
posted by pedro mg at 12:50 am
& filed under tech, web, linux, ubuntu, gnome, digital-life, ruby, shell, code, textmate, api, Flickr, vi, Wordpress, xmlrpc, vim, gvim, blog, screenshot, iccf, open source, GPL | 4 Comments »
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 […]
posted by pedro mg at 11:09 pm
& filed under tech, web, linux, ubuntu, gnome, ruby, php, shell, code, api, vi, MovableType, Wordpress, xmlrpc, vim | No Comments »
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
posted by pedro mg at 12:20 am
& filed under tech, web, linux, ubuntu, ruby, shell, code, api, Flickr, switter, twitter, vi, rubyforge | No Comments »
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 […]
posted by pedro mg at 5:12 pm
& filed under tech, web, jabber, linux, ruby, shell, code, api, Flickr, switter, twitter, vi, rubyforge | No Comments »
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’)
posted by pedro mg at 12:16 am
& filed under tech, linux, ubuntu, ruby, shell, code, vi | No Comments »
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 […]
posted by pedro mg at 11:40 pm
& filed under tech, linux, ruby, shell, code, api, Flickr, switter, twitter, rubyforge | 3 Comments »
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!
posted by pedro mg at 11:59 pm
& filed under tech, web, mail, linux, perl, mutt | No Comments »
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 !!
posted by pedro mg at 4:59 pm
& filed under tech, mail, linux, ubuntu, digital-life, Epiphany, Flickr, mutt | No Comments »
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…
posted by pedro mg at 11:30 pm
& filed under linux, shell | 5 Comments »
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 […]
posted by pedro mg at 8:54 pm
& filed under tech, web, linux, digital-life, ruby, perl, python, php | No Comments »
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 […]
posted by pedro mg at 10:59 pm
& filed under linux, gnome, abiword | 7 Comments »
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.”
posted by pedro mg at 7:54 pm
& filed under google, linux | No Comments »
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 […]
posted by pedro mg at 1:46 pm
& filed under tech, linux, os, ubuntu, 6.06 LTS, gnome | No Comments »