Tuesday, May 15, 2012

Backup.sh

#!/bin/bash
su - oracle <<EOO

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=orcl

/u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl stop

/u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus /nolog <
<EOS
connect / as sysdba
shutdown immediate

startup
EOS


/u01/app/oracle/product/11.2.0/dbhome_1/bin/exp [username case sensitive]/[password case sensitive] file=/tmp/hasil.dmp
mv /tmp/hasil.dmp /tmp/data_`date +%Y%m%d_%H%M%S`.dmp
/u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start
EOO

Monday, May 14, 2012

startup oracle n shutdown oracle

mulai.sh
********************************************************
#!/bin/bash
su - oracle <
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
/u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus /nolog <
connect / as sysdba
startup
EOS

/u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start

EOO


********************************************************
berhenti.sh
********************************************************
#!/bin/bash
su - oracle <
/u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl stop
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
/u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus /nolog <
connect / as sysdba
shutdown immediate
EOS
EOO


Cron Job

buat file a.txt di /tmp/a.txt

1.Cron job seting online :
http://www.corntab.com/pages/crontab-gui

2.root# crontab -e

[isi dengan yg ada di atas #1]
CONTOH cronjob tiap menit:
*/1 * * * * su - oracle -c /tmp/script-backup.sh

CONTOH cronjob tiap jam 2 pagi:
00 02 * * * /tmp/backup.sh

3.JANGAN LUPA RESTART CRON  !
/sbin/service crond restart
 
4. isi script-backup.sh adalah=
/bin/touch /tmp/a.txt ==>utk penanda bahwa script di execute
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_HOME
ll > /tmp/aa.txt
Cron job tidak berfungsi, maka lakukan ini untuk cek:

Verify that root's crontab does anything at all by running a simple
command every minute.  Eg. use 'crontab -u root -e' to add this
line to the root crontab:

    */1 * * * * /usr/bin/touch /tmp/foo

Then if you do 'ls -l /tmp/foo' you should see the timestamp changing
every minute.  Remember to remove this line once you're done testing.

If it doesn't, check that cron is enabled and running.  It is enabled
by default in /etc/defaults/rc.conf.

Examine /var/log/cron -- everything cron tries to run should be logged
there.

However, I suspect that the problem is the standard gotcha when using
cron.  Scripts run from cron get a very minimal environment.  In
particular you *will* need to set the PATH explicitly at the top of
your script. Something like this generally suffices:

    PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/sbin:/usr/sbin:/usr/local/sbin
    export PATH

Or else use fully qualified paths for any programs you call from the
script.

This is the primary cause of programs that work fine under test when
run from your login account but that do not work when run from cron.

Thursday, May 10, 2012

TIDAK CONNECT ORACLE

ORA-12514

Cek TNSNAMES.ORA di client, apakah sudah merefer ke server
Cek SERVICE NAME atau SID di server, apakah sudah sama dg di CLIENT?

lsnrctl status

CREATE NEW USER IN ORACLE

SQL>create user AKU identified by PASSWORDKU;

SQL>grant connect to AKU with admin option;


SQL>grant dba to AKU with admin option;

SQL>grant resource to AKU with admin option;


Thursday, April 12, 2012

OPTIONS

price action !
lihat PIVOT, lewati PIVOT / jarak ke PIVOT min 1 USD
cek Slop MA -> HARUS JELAS !
cek MACD -> usahakan support
cek SS -> hati2 over
cek KC -> usahakan di middle

Wednesday, April 11, 2012

Cek ini

http://surfagain.com/

Thursday, January 12, 2012

update Facebook status using php

// Thanks to Alste (curl stuff inspired by nexdot.net/blog)

function setFacebookStatus($status, $login_email, $login_pass, $debug=false) {
 //CURL stuff
 //This executes the login procedure
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, 'https://login.facebook.com/login.php?m&next=http%3A%2F%2Fm.facebook.com%2Fhome.php');
 curl_setopt($ch, CURLOPT_POSTFIELDS, 'email=' . urlencode($login_email) . '&pass=' . urlencode($login_pass) . '&login=' . urlencode("Log in"));
 curl_setopt($ch, CURLOPT_POST, 1);
 curl_setopt($ch, CURLOPT_HEADER, 0);
 //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
 curl_setopt($ch, CURLOPT_COOKIEJAR, "my_cookies.txt");
 curl_setopt($ch, CURLOPT_COOKIEFILE, "my_cookies.txt");
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 //make sure you put a popular web browser here (signature for your web browser can be retrieved with 'echo $_SERVER['HTTP_USER_AGENT'];'
 curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.12) Gecko/2009070611 Firefox/3.0.12");
 curl_exec($ch);

Send Message to Yahoo! Messenger from PHP

  // last update: July 20, 2010

  // get home page of yahoo mobile
  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL, "http://us.m.yahoo.com/w/bp-messenger");
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($curl, CURLOPT_ENCODING, "");
  curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; EmbeddedWB 14.52 from: http://www.bsalsa.com/ EmbeddedWB 14,52; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729)");
  curl_setopt($curl, CURLOPT_COOKIEJAR, getcwd() . '/cookies_yahoo_messenger.cookie');
  $curlData = curl_exec($curl);
  curl_close($curl);

Friday, October 21, 2011

Install Oracle 10.2 on Centos 4

1.Install Centos 4 -> everything
2.Login as root on Centos
3.extract oracle db.zip ke /tmp

yum update -y
terus tunggu lama sekali utk update yum

sysctl -a | grep shm

utk ubah parameter:
#vi /etc/sysctl.conf
tambahkan:
kernel.shmmax=2147483648
kernel.sem=250 32000 100 128
fs.file-max=65536
net.ipv4.ip_local_port_range=1024 65000

net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144

groupadd dba # group of users to be granted SYSDBA system privilege
groupadd oinstall # group owner of Oracle files
useradd -c "Oracle software owner" -g oinstall -G dba oracle
passwd oracle

mkdir -p /u01/app/oracle
chown oracle.oinstall /u01/app/oracle

su - oracle
cat >> ~oracle/.bash_profile << EOF export ORACLE_BASE=/u01/app/oracle export ORACLE_SID=orcl EOF RESTART dan login dg user = oracle

PENTING !! = selalu RESTART dan login pertama dg oracle, bukan login dg root terus di terminal melakukan su oracle !

dg terminal, masuk ke folder /tmp/database, lakukan:
./runInstaller

NEXT NEXT NEXT

Tuesday, October 18, 2011

XEN VPS 64MB

Setting Up the VPS

After my order has been provisioned, I re-image the server with a Debian 5 “Lenny” image. I normally pick Debian or Ubuntu because apt-get uses much less memory than RedHat/Fedora’s equivalent, and it’s also my personal preference. I named my new VPS “endor” as I usually just name my boxes after Star Wars systems. Re-imaging a VPS is pretty fast — 2 minutes later I have my root password sent to my email address so I can ssh in to set up the new system.

Monday, September 26, 2011

Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 10.04)

This tutorial is Copyright (c) 2010 by Falko Timme. It is derived from a tutorial from Christoph Haas which you can find at http://workaround.org. You are free to use this tutorial under the Creative Commons license 2.5 or any later version.

Saturday, September 24, 2011

VNC on XUBUNTU

install ubuntu 10.4 LTS server, with no desktop
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install vnc4server
restart

sudo apt-get install xubuntu-desktop
restart

setup vnc: vnc4server dikasih password
ubah xstartupnya menjadi:



#!/bin/sh
( while true; do xterm; done ) &
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
#vncconfig -iconic &
#xterm -geometry 1024x768 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
xfwm4 &
xfce4-panel &
xfdesktop &








restart

run vnc4server n konek dg vnc
KALO TIDAK BISA KELUAR DESKTOP, maka 3 baris terakhir dipanggil di xterm di vnc/remote

coba install wine

Tuesday, September 20, 2011

Windows XP on Linux VPS

install ubuntu 11
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install vnc4server
sudo apt-get install ubuntu-desktop
sudo apt-get install qemu qemulator
sudo apt-get install qemu-launcher
qemu-img create -f qcow windows.img 4G
install windows xp di qemu --> mouse bergerak tidak sesuai! tp oke lah krn harga murah

Wednesday, September 14, 2011

Upgrade ubuntu 10.04 to 10.10 command line

Open up a terminal window and issue these two commands:

sudo apt-get update
sudo apt-get upgrade

Of course, you will have to enter your sudo password for the first command. Once that is complete you may need to restart your computer (depending on if the kernel is updated or not). After that, you are ready for the upgrade. The first step is to issue the following command:

sudo apt-get install update-manager-core

Now we need to make a simple edit to the /etc/update-manager/release-upgrades. This file determines the default behavior for the release upgrader. The line you need to change is at the bottom of this file. Change it from:

Prompt=lts

to

Prompt=normal

Save and close that file and then issue the command:

sudo do-release-upgrade -d

When  prompted, click Y to continue on with the upgrade. Once the upgrade is complete, you will need to restart you computer.

Wednesday, September 7, 2011

Install wine di ubuntu 10.10

**:rebuild ubuntu 11.04
#sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine1.3

**terus install vnc untuk VPS Ubuntu


konek ke vnc, cek wine
*tambahkan dll yg perlu / winetricks v???
*tambahkan fonts yg perlu

Tuesday, August 23, 2011

Download semua isi website dengan wget

wget --wait=20 --limit-rate=20K -r -p -U Mozilla [ganti dengan nama website] --no-parent

Wednesday, August 10, 2011

Configure Network Interface Using Command-Line

You can configure a network interface from the command line using the networking utilities. You configure your network client hosts with the command line by using commands to change your current settings or by editing a number of system files.
Configuring DHCP address for your network card
If you want to configure DHCP address you need to edit the /etc/network/interfaces and you need to enter the following lines replace eth0 with your network interface card
sudo vi /etc/network/interfaces

Monday, August 8, 2011

update your Ubuntu Distro

sudo do-release-upgrade

ssh tanpa password dari server A ke B

Lakukan ini di server A di home nya
Bila login dg user root, maka lakukan di server A di folder: /root#

ssh-keygen -t rsa

(tekan enter 3 kali saja sampai keluar)


ssh username@serverB mkdir -p .ssh 

(masukin password di server B) 
 bila ada error 
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

maka perlu dihapus dulu di serverA:
ssh-keygen -R serverB
ULANGI DARI ATAS LAGI

cat .ssh/id_rsa.pub | ssh username@serverB 'cat >> .ssh/authorized_keys'

(masukin password di server B)


Selesai :)