terça-feira, 29 de julho de 2008

How to flash BIOS

wget http://www.fdos.org/bootdisks/autogen/FDOEM.144.gz
gunzip FDOEM.144.gz
mount -t vfat -o loop FDOEM.144 /mnt/temp
cp 1400_A09.EXE /mnt/temp (Dell Vostro 1400 BIOS A.09)
umount /mnt/temp
mkisofs -o bootable_freedos.iso -b FDOEM.144 FDOEM.144
cdrecord -v dev=0,0,0 speed=4 -eject bootable_freedos.iso

sexta-feira, 18 de julho de 2008

Java: Fix JDK6 on Xorg

Locking assertion failure. Example: Linux + JDK6 + Netbeans.

Try this as root:

export LIBXCB_ALLOW_SLOPPY_LOCK=true

Or this:

sed -i 's/XINERAMA/FAKEEXTN/g' /opt/java/jre/lib/i386/xawt/libmawt.so

Or:

export LIBXCB_ALLOW_SLOPPY_LOCK=1

Shell: external variable in awk

awk -v x=0 'NF != 6 { ++x } END { print x, NR }' out.lst

This time we're passing awk an external variable. When you do this you have to tell awk what you're doing be prefixing the variable with -v. So we've initialized x to be equal to zero before actually starting our awk program.

Shell: Killing child processes from a pid


for child in $(ps -o pid,ppid -ax | \
awk "{ if ( \$2 == $pid ) { print \$1 }}")
do
echo "Killing child process $child because ppid = $pid"
kill $child
done

Shell: Length of a string

$ expr length "nixcraft"
8

$ myVar="nixcraft"
$ echo ${#myVar}
8

$ echo nixcraft | awk ‘ { print length } ‘
8

$ echo nixcraft | perl -nle ‘ print length ‘
8

Linux: Optimize Directories ( File Access Time ) in ext3 Filesystem

Linux: wget ignores robot.txt entry

on the command line: -erobots=off

http://cygwin.com/ml/cygwin/2003-02/msg00944.html

Linux: How to Tunnel X Windows Securely over SSH

Linux: Disk Cloning

Serve the disk image:

$ dd if=/dev/hda | nc -l -p port

Receive the image:

$ nc -w3 hostname port | dd of=/dev/hda

OR

On the receiving end do:

$ netcat -l -p 7000 | tar x

And on the sending end do:

$ tar cf - * | netcat otherhost 7000

Linux: Dividindo arquivos tar em múltiplos volumes

$ tar -c -M --tape-length=700000 --file=cd1.tar arquivao.tar.gz

Onde a opção "--tape-length" é multiplicada por 1024 bytes (por arredondamento: 700000 x 1024 = +- 700Mb)

Quando o primeiro arquivo chegar a 700mb, o tar dará o seguinte prompt:

Prepare volume #2 for cd1.tar and hit return:

Para começar a escrever no segundo arquivo, digite:

$ n cd2.tar

Caso você saiba previamente quantos volumes o arquivo irá gerar, o seguinte comando não precisará de interação:

$ tar -c --tape-length=700000 -f cd1.tar -f cd2.tar arquivao.tar.gz

A opção "--tape-length" também pode ser substituída por "-L"

Para restaurar o arquivo:

$ tar -x -M --file=cd1.tar --file=cd2.tar arquivao.tgz

Linux: Getting SSH daemon to start

Getting SSHD to start involved fixing this error:

$ fatal: daemon() failed: No such device

which was fixed by deleting the FILE:

$ /dev/null

that yum or something had created, and then running the command:

$ mknod /dev/null c 1 3

Once that was done, SSHD started up OK again.

Problema: Acentuacao+Java+Linux

http://my.opera.com/CrazyTerabyte/blog/2007/02/02/poor-interface-design

Recuperando partições e corrigindo sistemas de arquivos

http://www.guiadohardware.net/tutoriais/recuperando-particoes-corrigindo-sistemas-arquivos/

Answering Novice Shell Questions

http://www.samag.com/documents/s=10118/sam0703g/0703g.htm

Parallelize applications for faster Linux booting

http://www-128.ibm.com/developerworks/linux/library/l-boot-faster/index.html?ca=drs-

Shell: Cutting last line

tac teste.txt | awk 'NR > 1' | tac

Shell: Inserir uma linha no inicio de arquivo

(echo "hoge"; cat hoge.txt)

insege hoge no inicio do arquivo hoge.txt

How to display or show information about a Linux Kernel module or drivers

http://www.cyberciti.biz/tips/how-to-display-or-show-information-about-a-linux-kernel-module-or-drivers.html

Host multiple SSL sites on a single network card with IP aliasing

http://www-128.ibm.com/developerworks/library/wa-multissl.html?ca=drs-

Usando screen

# .profile (Usuario)
# Adicionar a seguinte linha:
screen -d -R

# .screerc (Usuario)
# Adicionar as seguintes linhas:
multiuser on
acladd root

# Para acessar o screen:
screen -r Usuario/

sudo FAQ

http://polishlinux.org/first-steps/root-account/sudo-faq/

How to install SystemRescueCd on an USB-stick

http://www.sysresccd.org/Sysresccd-manual-en_How_to_install_SystemRescueCd_on_an_USB-stick

Replacing A Failed Hard Drive In A Software RAID1 Array

http://www.howtoforge.com/replacing_hard_disks_in_a_raid1_array

Para criar um arquivo morto

dd if=/dev/zero of=10.smk bs=1024 count=$N

onde $N*1024=tamanho em bytes do arquivo necessario.
Use echo 0 >> 10.smk para acrescentar 2 bytes no arquivo.

Format MBR

dd if=/dev/zero of=/dev/hda bs=446 count=1

Copying mass amounts of data over a network with bash, rsync

rsync -ave ssh srcpath user@host:/dstpath

or you could even tar over ssh for super-fast synching and no file list delay by doing a:

tar -cf - /srcpath | ssh -c blowfish-cbc user@host '(cd /dstpath; tar xf -)'

Ref: http://corneliusroot.blogspot.com/2006/12/copying-mass-amounts-of-data-over.html

Zerando a senha da BIOS

# printf "\x2E" | dd bs=1 seek=112 of=/dev/port
# printf "\xFF" | dd bs=1 seek=113 of=/dev/port

O "printf" converte o texto em hexadecimal no byte correspondente e repassa este byte para o comando dd que por sua vez escreve este byte na porta 0x70 (112) e 0x71(113).

Ref: http://linuxabordo.com.br/blog/jonnyzone.php?title=zerando_resetando_a_bios_pela_linha_de_c

Accelerating OpenSSH connections with ControlMaster

Add this lines to ~/.ssh/config:


Host *
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p


Referência: http://www.linux.com/articles/54498

Shell Obfuscator

http://comp.eonworks.com/scripts/obfsh

Drunk Penguins

Drunk Penguins
Drunk Penguins