Wednesday, December 28, 2011

openvpn windows connect

http://mugurel.sumanariu.ro/windows/vista-and-win-7-openvpn-route-problem/


 OpenVPN+GUI (openvpn-2.0.9-gui-1.0.3) in client mode will connect to the remote OpenVPN server, but will not accept the routes. Error in the log is as follows:
ROUTE: route addition failed using CreateIpForwardEntry: One or more arguments are not correct. [if_index=18]
Route addition via IPAPI failed
Solution:
add the following to the end of the configuration (ovpn) file:
route-method exe
route-delay 2

how to add route?

Tuesday, December 20, 2011

enable tuntap on openvz container

http://wiki.openvz.org/VPN_via_the_TUN/TAP_device

storing url for my reference.

dependency problem xen from centos 5.3 to 5.7

http://www.centos.org/modules/newbb/viewtopic.php?topic_id=19677

i'm unable to update xen image (centos 5.3) using centos 5.7 repository.

the solution: yum --exclude=elfutils-libelf* --exclude=python* update

done this and finally i can do yum update. :)

http://www.linuxquestions.org/questions/linux-general-1/error-timeout-urlopen-error-timed-out-when-using-yum-on-centos5-2-a-722441/

finally i've found the problem
i think this error because of repository overload
so i edit /etc/yum.conf
and add line timeout=300 (default value is 30 sec)
now it's working...case closed


solution: #yum update yum

Sunday, November 20, 2011

[Howto] Astro Beyond Remote Control

Do you know that your white astro remote control able to control power off and volume control?
Here you go:

i'm taking this article from other website for my reference and faster search also.

1. Press power button + OK until remote indicator light blink twice. (Edit Mode)
2. Enter 4 digit TV Codes (Refer tables)
3. To reset, enter Edit Mode (1) and press 977




Astro Beyond TV Codes
SAMSUNG 0060 0812 0618 0178 0587 0009 0093 0556 1235 0108 0037 0217 0264 0370 0072 0156 1208 0766 0814 0216 0290 0821 0163
SONY 1825 1505 0011 1651 0036 0650 1010 0037 0056 0093 0170 0074
PHILIPS 0037 0556 1744 0772 1246 1304 0178 0108 0195 0087 0374 0760 0343 0595 0009 0200 0361 1521
PANASONIC 0650 0226 1650 1636 0108 1310 0037 0556 0163 1208 0508 0896 0361 0853 1335 0367 0516 0548 0001
TOSHIBA 1508 (MY TV) 0508 0060 0009 0714 0036 0156 1656 0070 0093 2060 0264 1935 0412 1164 0618 1582 0650 0821 1704 0217 0109 1457 1916 1908 0698 0037 0736 1556 1037
LG 1423 0001 0178 0037 0556 0876 0370 1768 0377 0009 0714 0060 0217 0108 0216 0290 0163 0606 0109 0689 0715 0823 0829 1556 1191 0247 0367 1681 1539
PIONEER 1260 0760 0011 1070 1457 0698 0109 0037 0287 0556 0428 0370 0343 0361 0486 0512
SHARP 0093 0009 1393 0036 0491 0818 0256 1819 0650 0294 0653 0412 0516 0200 0760 2214
JVC 0653 1818 0036 1153 0606 1653 0371 0508 0731 0683 0192 0218 0418 0093 0650
 

Alternatively:

To control volume press OK + Vol Up to control TV volume
or OK + Vol Down to use default astro setting.

article ref: http://stinkyfruit.wordpress.com/2010/02/13/astro-b-yond-volume-control/

Thursday, November 03, 2011

mysql index technique

http://www.w3schools.com/sql/sql_create_index.asp

My idea; field index just for frequently used table for searching. since updating is slow, (see note) no index for frequently updated data .

Indexes allow the database application to find data fast; without reading the whole table.


Note: Updating a table with indexes takes more time than updating a table without (because the indexes also need an update). So you should only create indexes on columns (and tables) that will be frequently searched against.

Monday, October 31, 2011

optimize mysql with index

if you want to join large table, indexing may help.

table1: 30,000 rows
table2: 40 rows

indexing for example user ID may speed up select query

SELECT name, phoneNo, address FROM table1 INNER JOIN table2 ON table1.userid = table2.userid

with no index, query takes about 8second
but with index query only 0.4second

Wednesday, October 26, 2011

convert image into ASCII

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx




This is me in Color Mode


::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::
::::::::::::::::.::+**+:::::::::::::::::
:::::::::::::::#########*:::::::::::::::
:::::::::::::+#@#@@@@#####*+::::::::::::
::::::::::::*#@@@#####@@@@##+:::::::::::
::::::::::::#@@#+::::::+*@@##:::::::::::
:::::::::::#@@*:.......::+#@@:::::::::::
:::::::::::@@*::........::+@@*::::::::::
:::::::::::@#:::........:.:#@*::::::::::
:::::::::::@*+::..........:+@*::::::::::
:::::::::::@++::.........::+#*::::::::::
::::::::.::@++:..,....,..:::#+::::::::::
:::::::::.:@+++**+...:+++:::#:::::::::::
::::::::::.@+++:+++.::+:+,::#.::::::::::
:::.....::.#:+**#*::+:+#:**+#......:::::
........:.+#++++::+..:::::+:+++:....::::
.........:+++::.:.:..+:..:::+.+......:::
.........:+++:::+::..:....::+:+.........
..........++++:..:::..:...:+............
..........:+++::.:**+*:...:+:+..........
...........:++::.:::::...::+:...........
............:++::++++++::::::...........
.............+++***:::*+::::............
.............++++:+**+:::++.............
..............*+++:...::+++.............
..............**++:::::++++.............
..............****+++++**++.............
..............+***####***+:.............
..............#+********++:#............
..............#+:+*+++++::,##+..........
..........*###@,::++++::::,#####:.......
........#######,+:::::::+,,########+....
.....:#########:,::::::+ ,.#########*#+.
..:*#*########## ,:.::+ ,,*#############
*#*#############, ...:,.,,##############
*###############, ,::,.*, ##############
################,+*,.,,::,##############
################*.,.,, ,,:##############
#################  ,    ,###############
################# ,     .###############
#################       :###############
#################,      *###############
######@##########.,,    ################
######@##########*,,    ################
################## ,    ################
##################    ,,################
@######@##########   ,,+################
@######@########## ,,,,###########@#####
@@################,,,,,#################
@@################:,,,,################@
@@######@#########*,,,.##########@#####@
@@@#####@##########, ,+###############@@



This is me in black and white ;)




get yours at:
http://speedfinger.org/html/modules/ASCIIArtist/exe.php?image=http%3A%2F%2Fspeedfinger.org%2Fhtml%2Fmodules%2FASCIIArtist%2Fimages%2Fkatok02.jpg&resolution=2&mode=1&color#000000&font-size=11&line-height=9&letter-spacing=0&fixed_char=W&new_window=on

Sunday, October 16, 2011

Javascript (remove character outside bracket)

i want to extract some information from text
for example. My Name Is Abu (19) years old

final output is 19

searching thru i found this code


pattern = /([a-z]+)([0-9]+)([A-Z]+)([0-9]+)/;
subject = 'test1234TEST1234';
matches = subject.match(pattern);
match1 = matches[1];
match2 = matches[2];
match3 = matches[3];
match4 = matches[4];
alert(match1);
alert(match2);
alert(match3);
alert(match4);

this is near but cannot add spaces or bracket on regex search

finally i remove space using this code


bb = "AAA AAA AAA(asdasd0 )asdasd asdasd";alert(bb.replace(/[\(\) ]/g,""));



reference: http://lawrence.ecorp.net/inet/samples/regexp-format.php


Thursday, October 06, 2011

install rrdtool centos

ref: http://www.cyberciti.biz/faq/howto-install-rrdtool-on-rhel-linux/


Step # 1: Install required dependencies

Login as root and type the following command:
# yum install cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel
Untar tar ball, enter:

Step # 2: Download latest rrdtool tar ball

# tar -zxvf rrdtool-1.3.1.tar.gz

Step #3: Compile and install rrdtool

You need to set PKG_CONFIG_PATH, enter:
# export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
Type the following commands:
Now compile and install RRDTool on RHEL:
# ./configure
# make
# make install
# cd /usr/local/
# ln -s rrdtool-1.3.1/ rrdtool/
# cd rrdtool
# ls -l
Type the following commands:
# cd /opt/
# wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.1.tar.gz

Saturday, October 01, 2011

read LVM from windows

i want to recover old files from server to new disk



http://www.chrysocome.net/explore2fs - use explore2fs to read data

reference: http://www.coderchris.com/linux/how-to-mount-a-linux-lvm2-partition-in-windows/2008/02/10 and google

updates: this software not works. i'm using vmware player with centos and mount using this

To mount xen guest image (with lvm)

1. Check the partition on the image
# fdisk -lu /path/to/image

2. You have to install kpartx to handle lvm partiton
# yum install kpartx

3. Run kpartx on the image
# kpartx -av /path/to/image

4. Run vgscan to scan volume group available
# vgscan

5. Run vgchange to activate the volume group in the image
# vgchange -ay VolGroup00

6. Use lvs to see what is the name of your low volume group
# lvs

7. Mount the low volume group
# mount /dev/VolGroup00/LogVol01 /mnt

8. You can access your lvm image at the mounted directory which is /mnt

9. To unmount it, a few commands have to be executed (umount for unmounting, vgchange -an to deactivate volume group, kpartx -d to delete device map and losetup -d to delete loop device used)
# umount /mnt/

reference: http://linuxwave.blogspot.com/2008/02/accessing-data-on-xen-lvm-guest-image.html

4gb seg fixup after reformatting


[root@linux ~]# rpm -q glibc.i386
glibc-2.5-65
[root@linux ~]# rpm -q glibc.i686
package glibc.i686 is not installed

it works as expected. now production server works but files gone. hope to get files back using backup disk.

Thursday, September 29, 2011

Wednesday, September 28, 2011

segmentation fault after glibc.i386

what de..
this is my production server. after successfull on test server now i'm trying into real server:

Kernel Panic. last resort reformat. ;)


I tried to updgrade glibc using
[root@demo1 RPMS]# rpm -ivh glibc-2.3.3-74.i386.rpm --force --nodeps
Preparing... ########################################### [100%]
1:glibc ########################################### [100%]
/usr/sbin/glibc_post_upgrade: While trying to execute /usr/sbin/iconvconfig child terminated abnormally
error: %post(glibc-2.3.3-74.i386) scriptlet failed, exit status 115


n now every thing gives a segmentation fault.
it is a dual xeon machine so i take it ..its i686. { pretty sure it doesnt support EM 64 }



now i cannot ls, cannot yum, cannot rpm, wget dammmm...


http://www.linuxquestions.org/questions/slackware-14/heeelp-glib-%2A-removed-335819/#post1707580

i hope to:
& i copied /lib from another machine with the same specs...


dam...

[tips] pord forward on windows XP

windows xp do not have internal function to do port forward. i found simple (super duper small) program to complete this task:

www.quantumg.net/portforward.php

you can download here: http://www.quantumg.net/portforward_bin.zip

source code also available at the website. thank you for the usefull tiny program.

[solved] 4gb fixup problem end

WARNING: try at your own risk.
2. not use this function when memory below 512MB
3. this break down my production server http://blog.apis17.info/2011/09/segmentation-fault-after-glibci386.html -reformat and reinstall solve the problem

finally 4gb fixup on xen is finally gone. (now i have openvz too :) 2.6.18-274.el5.028stab093.2xen

it fixed using i386 version of glibc

#yumdownloader glibc.i386

then yum downloading 'glibc-2.5-65.i386.rpm' package

#rpm -Uvh --force glibc-2.5-65.i386.rpm

it force 32bit glibc version. default my centos  use i686 even os 32-bit. you can read my previous entries. (thanks to cloudlinux forum)

after several hours recovering back from my lost glibc uninstall thanks to webmin saving my life.
and NEVER use this command rpm -e glibc


now i'm ready to get dangerous on production server. will update this post later.

Tuesday, September 27, 2011

4gb fixup again

http://www.cloudlinux.com/solutions/forum/forum18/topic41/

now trying another way:

[root@localhost ~]# rpm -q glibc.i386
package glibc.i386 is not installed
[root@localhost ~]# rpm -q glibc.i686
glibc-2.5-42

This means that you have i686 version -- and you need to install i386 version

[root@localhost ~]# yumdownloader glibc.i386 



no luck yet.

Monday, September 26, 2011

[solved] unable to update lxlighthttpd

http://forum.lxcenter.org/index.php?t=msg&goto=88875&

Was getting dependency error running yum update
lxlighttpd requires liblua-5.1.so 



solution:


install EPEL repo
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm


remove existing lua
yum remove lua


install EPEL lua
yum install lua


disable the EPEL repo by editing /etc/yum.repos.d/epel.repo file and change 'enabled=1' to 'enabled=0'

Monday, September 19, 2011

install epel repo


#rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm


i want to install memcached
reference: 
http://www.cyberciti.biz/faq/rhel-fedora-linux-install-memcached-caching-system-rpm/

Saturday, September 10, 2011

mysql count if

http://forums.mysql.com/read.php?10,203876,204010#msg-204010
select book_name,     count(if(rating=1, 1, null)) as "POOR",     count(if(rating=2,1,null)) as "Average",     count(if(rating=3,1,null)) as "Good",     count(if(rating=4,1,null)) as "Great" from rating group by book_name order by book_name; +----------------+------+---------+------+-------+ | book_name      | POOR | Average | Good | Great | +----------------+------+---------+------+-------+ | Javascript     |    0 |       1 |    0 |     0 |  | SQL Cookbook   |    0 |       1 |    1 |     1 |  | Visual Basic 6 |    1 |       0 |    1 |     0 |  +----------------+------+---------+------+-------+

IF(expression, return this if expression is true, return this if expression is false)

Wednesday, September 07, 2011

how to stop trend micro bot

trend micro bot will scan every website you visited and they known as:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) - so clever

one of their ip address is 150.70.172.106


i can say the scanner is not very clever (someone call stupid)

and they eat your bandwidth too:

now i', thingking about banning ip address or leave it alone. let ask expert 1st.

Tuesday, September 06, 2011

secure tmp on openvz container

http://www.faqforge.com/linux/controlpanels/ispconfig2/secure-tmp-and-devshm-directories-in-a-openvz-enviroment/

Create the script:

vi /etc/vz/conf/VPSID.mount


and insert the following lines:

#!/bin/bash mount -n --bind -onosuid,noexec /vz/vps/VPSID/tmp /vz/root/VPSID/tmp mount -n --bind -onosuid,noexec /vz/vps/VPSID/shm /vz/root/VPSID/dev/shm exit ${?}


now make the sscript executable:

chmod 700 /etc/vz/conf/VPSID.mount


Monday, September 05, 2011

register testing [SAP Venture?]

*** SAP Venture X ***

Tukar RM99 Kepada RM7,800 Dalam 4 Minggu!

  • Tak perlu cari orang
  • Tak perlu promosi
  • Tak perlu siar iklan
  • Tak perlu buat blog
  • Tak perlu kecoh kat FaceBook
  • Tak perlu bising kat Twitter
  • Tak perlu post apa-apa kat forum
  • Tak perlu spam email rakan-rakan pejabat
  • Tak perlu menulis sebarang artikel yang memecahkan kepala anda...

Semuanya "Fully Automated!"

Bagaimana???!!

Hanya Beli Pakej Mengikut Bajet Anda
Dan Lihat Hasilnya Dalam 4 Minggu!

AMARAN: Pakej ini dikuasakan oleh SAP!
Dengan SAP, Pemasaran Adalah TIDAK PERLU!
Ramai sudah maklum, SAP merupakan satu fenomena luar biasa dalam aktiviti
pemasaran online di Malaysia. Namun, kos aksesnya yang tinggi menyebabkan tidak ramai yang mampu memiliki aksesnya. Apatah lagi untuk memiliki terus perisian yang menjangkau nilai puluhan ribu ringgit ini.

Bertindak Sekarang!

Bertindak Sebelum Terlambat...

Tempah Pakej Ini Sekarang

RM99.00 Sahaja!


P/s: Keputusan terletak 100% di tangan anda, terpulang kepada kebijaksanaan anda!
Peluang datang hanya sekali, dan yang sekali itulah kalau tak direbut, maka berkecailah segunung harapan. Tempah Sekarang!
P/p/s: Pernah dengar orang kata begini?
"MUDAH SAHAJA - HANYA PROMOSI, YANG LAIN SEMUA KAMI URUSKAN!"
Anda percaya promosi itu suatu perkara yang mudah???!!!
Fikir sekali lagi, promosi adalah perkara yang PALING SUKAR!! Lebih MUDAH uruskan segalanya daripada membuat promosi YANG BERJAYA mencari pelanggan!
Janji saya, dengan SAP anda TIDAK PERLU BIMBANG TENTANG PROMOSI, SAP akan bekerja untuk anda - Sehingga anda berjaya Tukar RM99 Kepada RM7,800 Dalam 4 Minggu!

Sunday, August 28, 2011

csf on openvz [ another reference ]

still no luck. trying another way:

this is detailed instruction:


vzctl set VEID --iptables ipt_REJECT --iptables ipt_tos --iptables ipt_TOS --iptables ipt_LOG --iptables ip_conntrack --iptables ipt_limit --iptables ipt_multiport --iptables iptable_filter --iptables iptable_mangle --iptables ipt_TCPMSS --iptables ipt_tcpmss --iptables ipt_ttl --iptables ipt_length --iptables ipt_state --iptables iptable_nat --iptables ip_nat_ftp --save

others:

http://piyecarane.wordpress.com/2009/08/30/how-to-enable-csf-on-openvz-container/

On the node server :
Modify IPTABLES_MODULES on /etc/sysconfig/iptables-config

IPTABLES_MODULES="ip_conntrack_netbios_ns ipt_conntrack ipt_LOG ipt_owner ipt_state ip_conntrack_ftp iptable_nat ip_nat_ftp ip_tables ipt_multiport iptable_filter ipt_limit"

then launch : service iptables restart
to restart iptables services

Then modify IPTABLES on /etc/vz/vz.conf

IPTABLES="ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp ip_tables ipt_conntrack ip_conntrack_ftp ipt_LOG ipt_owner"

then launch : /etc/init.d/vz restart

Related Posts Plugin for WordPress, Blogger...