Category:To categorize

From campisano.org
Jump to: navigation, search

Links

Google

DNS Server

Functions

Statistics

Finance

Others

Browsers

JRE plugin for browsers
Firefox
Tips

After 6x.x version (Quantum?), there is no option to disable the update alert

open about:config and search for app.update

- set app.update.auto = false

- set app.update.checkInstallTime = false'

- set app.update.silent = true

- set app.update.url as empty

the other attributes should be default

note: app.update.url as empty make Firefox unable to know that there is a new version

additional info in

https://support.mozilla.org/en-US/questions/1232918#answer-1176526

https://superuser.com/a/1392487

Plugins




Seamonkey
Plugins

Mac OSX

NTFS

From techbytesxpress.com

  • Install OSXFuse. Make sure to select installing MacFuse during installation for backwards compatibility.
  • Install NTFS-3G.
  • Reboot

CSS

Commands

Split/Merge large files

from http://magazine.redhat.com/2007/10/24/tips-from-an-rhce-splitting-tar-archives-on-the-fly/

  • Split:
user@host:~$ cat bkp-audio.tar | split -b3GB -d - bkp-audio-
user@host:~$ ls -sh
total 16G
2.8G bkp-audio-00  2.8G bkp-audio-01  2.8G bkp-audio-02  2.8G bkp-audio-03  2.8G bkp-audio-04  1.9G bkp-audio-05
  • Merge:
user@host:~$ cat bkp-audio-* >> bkp-audio.tar
user@host:~$ ls
bkp-audio-00  bkp-audio-01  bkp-audio-02  bkp-audio-03	bkp-audio-04  bkp-audio-05

Encrypt/Decrypt files

from http://linuxpoison.blogspot.com.br/2009/01/encrypt-decrypt-files-using-mcrypt-on.html

  • Encrypt:
user@host:~$ tar -cf - dati | mcrypt > dati.crypted
Enter the passphrase (maximum of 512 characters)
Please use a combination of upper and lower case letters and numbers.
Enter passphrase: 
Enter passphrase: 

Stdin was encrypted.
  • Decrypt:
user@host:~$ cat dati.crypted | mcrypt -d > dati.tar
Enter passphrase: 
Stdin was decrypted.

Remote ssh backup and transfer

user@host:~$ tar -czf - /etc | ssh root@YOUR_DEST_HOST 'cat - > /tmp/bkp-etc.tgz'
### optionally, TO WORK IN BACKGROUND:
CTRL+Z
user@host:~$ bg
user@host:~$ disown -h %1
### now you can exit
user@host:~$ exit

Algebra relacional / SQL

Schema

  • Algebra relacional
Fornecedores(fid:integer, fnome:string, end:string)
Pecas(pid:integer, pnome:string,cor:string)
Catalogo(fid:integer,pid:integer,preco:real)
  • SQL
CREATE TABLE Fornecedores
(
  fid     INT,
  fnome   VARCHAR(32),
  end     VARCHAR(32),
  PRIMARY KEY (fid)
);

CREATE TABLE Pecas
(
  pid     INT,
  pnome   VARCHAR(32),
  cor     VARCHAR(32),
  PRIMARY KEY (pid)
);

CREATE TABLE Catalogo
(
  fid     INT,
  pid     INT,
  preco   DOUBLE,
  PRIMARY KEY (fid, pid),
  FOREIGN KEY (fid) REFERENCES Fornecedores(fid),
  FOREIGN KEY (pid) REFERENCES Pecas(pid)
);

INSERT INTO Fornecedores VALUES (1, 'forn1', '');
INSERT INTO Fornecedores VALUES (2, 'forn2', '');
INSERT INTO Fornecedores VALUES (3, 'forn3', '');
INSERT INTO Fornecedores VALUES (4, 'forn4', '');
INSERT INTO Fornecedores VALUES (5, 'forn5', '');

INSERT INTO Pecas VALUES (1, 'peca1', 'vermelha');
INSERT INTO Pecas VALUES (2, 'peca2', 'vermelha');
INSERT INTO Pecas VALUES (3, 'peca3', 'verde');
INSERT INTO Pecas VALUES (4, 'peca1', 'amarela');
INSERT INTO Pecas VALUES (5, 'peca1', 'verde');

INSERT INTO Catalogo VALUES (1, 1, 100);
INSERT INTO Catalogo VALUES (1, 2, 100);
INSERT INTO Catalogo VALUES (1, 3, 150);
INSERT INTO Catalogo VALUES (1, 4, 120);
INSERT INTO Catalogo VALUES (1, 5, 120);
INSERT INTO Catalogo VALUES (2, 3, 90);
INSERT INTO Catalogo VALUES (2, 2, 110);
INSERT INTO Catalogo VALUES (3, 3, 100);
INSERT INTO Catalogo VALUES (3, 4, 110);
INSERT INTO Catalogo VALUES (4, 4, 100);
INSERT INTO Catalogo VALUES (5, 5, 150);

Subtração

Consulta: Obtenha o nome das peças que são fornecidas pelo fornecedor 'fonr1' e não são fornecidas por nenhum outro fornecedor.

  • Algebra relacional
( P pnome ( Pecas |><| ( P pid ( Catalogo |><| ( S fname = 'forn1' ( Fornecedores ) ) ) - P pid ( Catalogo |><| ( S fname <> 'forn1' ( Fornecedores ) ) ) ) ) )
  • SQL
SELECT DISTINCT pnome
FROM   Pecas
NATURAL JOIN Catalogo
NATURAL JOIN Fornecedores
WHERE  fnome = 'forn1'
AND    (pid) NOT IN
(  
  SELECT pid
  FROM   Catalogo
  NATURAL JOIN Fornecedores
  WHERE  fnome <> 'forn1'
);

Divisão

Consulta: Obtenha o nome dos fornecedores que fornecem todas as peças

  • Algebra relacional
( P fnome ( Fornecedores |><| ( P fid, pid ( Catalogo ) -:- P pid ( Pecas ) ) ) )
SELECT DISTINCT fnome
  FROM Fornecedores NATURAL JOIN Catalogo AS R1
WHERE NOT EXISTS
(
  SELECT pid
    FROM Pecas AS S
   WHERE NOT EXISTS
  (
    SELECT fid, pid 
      FROM Catalogo AS R2
     WHERE R1.fid = R2.fid
       AND R2.pid = S.pid
  )
);

Ideas

  • true tables
  • cep vs address
  • brute hash table break 1 2
  • voice chat utility









Text

from stackoverflow.com apache default vhost

http://httpd.apache.org/docs/1.3/vhosts/name-based.html

(Should be true for 2.x also)

"If no matching virtual host is found, then the first listed virtual
host that matches the IP address will be used.

As a consequence, the first listed virtual host is the default virtual
host. The DocumentRoot from the main server will never be used when an
IP address matches the NameVirtualHost directive. If you would like to
have a special configuration for requests that do not match any
particular virtual host, simply put that configuration in a container
and list it first in the configuration file."




from http://wiki.apache.org/httpd/PerformanceScalingUp

Requests for dynamically generated content usually take significantly
more resources than requests for static content. Static content
consists of simple filespages, images, etc.-on disk that are very
efficiently served. Many operating systems also automatically cache
the contents of frequently accessed files in memory.

outro link interessante: http://wiki.apache.org/httpd/PerformanceScalingOut

o que acredito: client pede uma página para o apache, o apache avalia o percurso (virtualhost), se o client usa cache o apache verifica a data do file, de qualquer jeito pega o file e entrega; o varnish recebe a requisição, gera um hasmap e verifica na cache dele, se tem na cache entrega, senão pede para o apache.

Em caso de disponibilidade de memória, conteúdo muito requisitado tem muita probabilidade de já estar na cache RAM do OS, nesse caso uma leitura de um file resulta de uma leitura em um setor de memória já preenchido na leitura anterior; em caso não esteja na memória, o tempo de carregamento de file no disco deveria ser parecido. O apache poderia ter uma sobrecarga para coisas que faz amais do varnish (segurança, sessão, rewrite..)...

Um pequeno ganho vezes muitas requisiçoes pode dar resultados, mas do monitoramento que temos não parece perceptível.




para ver as portas abertas

   netstat -tulpn


para ver o trafico em entrada, o comando a seguir da para entender:

   tcpdump -n -i eth0 host 187.126.64.20 and not tcp port 22 and not tcp port 80


count dos processos do apache

   ps ax | grep httpd | wc -l




from http://www.coderanch.com/t/224682/Web-Services/java/Facade-design-pattern-web-services

In terms of general design patterns you are actually dealing with
issues usually addressed by at least three design patterns:
Facade - Define a higher-level interface that makes the subsystem easier to use.
Decorator - Attach additional responsibilities to an "object"
(possibly dynamically) without any modification of the underlying
"class".
Adapter - Let "classes" work together that couldn't otherwise because
of incompatible interfaces.


Ultimately you are using the Facade Pattern because you are trying to
present one simple unified interface for a whole mess of pre-existing
business logic. The purest form of the facade pattern applied to web
services is a web service that simply delegates the work to more basic
web services.

see also http://www.coderanch.com/t/100717/patterns/Stratergy-vs-Factory-method-vs

Pages in category "To categorize"

This category contains only the following page.