sexta-feira, 20 de fevereiro de 2009

Exim - Linha de comando

Numero de mensagens na fila

# exim -bpc

Mensagens na fila, detalhado

# exim -bp

ou

exim -bp | exiqsumm

Para saber que o Exim está fazendo neste instante...

# exiwhat

Exibir configuração do Exim

# exim -bP


Exibe uma lista de todos os IDs da fila

# exiqgrep -i

Força o envio das mensagens da fila

# exim -q -v

Força o envio das mensagens da fila, para endereços locais

# exim -ql -v

Para remover uma mensagem da fila

# exim -Mrm

Para remover mensagem da fila, com mais de 5 dias (86400 * 2 = 172800 seconds).

# exiqgrep -o 172800 -i | xargs exim -Mrm

Visualizar o cabeçalho de uma mensagem

# exim -Mvh

Visualizar o corpo de uma mensagem

# exim -Mvb

Visualizar o log de uma mensagem

# exim -Mvl


quarta-feira, 18 de fevereiro de 2009

quarta-feira, 11 de fevereiro de 2009

Sudoers

# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults env_reset

# Host alias specification

# User alias specification
User_Alias ADMINS =pirulito, mané

# Cmnd alias specification

# User privilege specification
root ALL=(ALL) ALL
ADMINS ALL=(ALL) ALL

# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
# %sudo ALL=NOPASSWD: ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

quarta-feira, 28 de janeiro de 2009

Balanceamento mysql

http://imasters.uol.com.br/artigo/11161/mysql/balanceamento_de_carga_no_mysql_-_parte_1/
http://imasters.uol.com.br/artigo/11319/mysql/balanceamento_de_carga_no_mysql_-_parte_02/

SQL e Rails

http://simplesideias.com.br/executando-sql-no-rails/
http://simplesideias.com.br/dica-rapida-3-sanitizando-queries-com-activerecord/

domingo, 30 de novembro de 2008

WMA to mp4

I don't know why I am so dumb that I spent so much time scouring the Web to look for a utility to convert between different audio file formats. In fact my favourite video player, VLC can do it right under its hood.

Why would I want to do this conversion business? Because I have a bunch of WMA files which I can't import into my iTunes (but it works on M$ Windows though).

The weird thing is that I didn't manage to coerce VLC to convert it to MP3 for me so in the end I just did MP4 anyway since iTunes support it.

Here are the steps that you need to take:

  1. Start up VLC
  2. Click File and select "Streaming/Exporting Wizard..."
  3. Select "Transcode/Save to file", click "Next"
  4. Select a file and click "Next"
  5. Check the "Transcode audio", and select "MPEG 4 Audio", select the bitrate that you want and click "Next"
  6. Select "MPEG 4/ MP4" and click "Next"
  7. Choose a filename and path to store the new file and click "Next"
  8. Click "Finish"
  9. Wait for it to be done

You can also choose other audio file formats and its pretty easy. Although I wish there is a better interface for this.

sexta-feira, 28 de novembro de 2008

Função nova do Rails 2.1 - Parte 1

Função nova do Rails 2.1:

change_table

Funciona quase igual ao método create_table, o qual aceita um bloco e dentro nós definimos novas colunas. Mas esse método novo permite fazer outras operações como rename, remove, etc.

A lista completa é:

  • t.column – a maneira antiga, migration não-“sexy”
  • t.remove – remove uma coluna
  • t.index
  • t.remove_index
  • t.timestamps – adiciona created_at e updated_at
  • t.remove_timestamps – remove created_at e updated_at
  • t.change – muda o tipo da coluna
  • t.change_default – muda o valor default de uma coluna
  • t.rename – renomeia uma coluna
  • t.references – adiciona uma coluna que serve de chave estrangeira com a convenção [nome_da_tabela]_id
  • t.remove_references – remove a chave estrangeira
  • t.belongs_to – atalho para :references
  • t.remove_belongs_to – atalho para :remove_references
  • t.string
  • t.text
  • t.integer
  • t.float
  • t.decimal
  • t.datetime
  • t.timestamp
  • t.time
  • t.date
  • t.binary
  • t.boolean