Thursday, 29 August 2013

Mempercepat Koneksi dengan ssh Tunnel

Abis liat-liat google akhirnya nemu ssh tunnel. Saya akan mencoba untuk mempercepat koneksi kita dengan ssh tunel.

ssh-tunnel
Syarat-syarat yang diperlukan :
1. Memiliki account ke SSH Server
2. SSH server support tunnel
3. Komputer anda memiliki SSH client
4. Koneksi Internet di SSH Server lebih kencang
5. SANGAT DISARANKAN server SSH terletak pada jalur IIX.

Kita akan mencoba di 2 sistem operasi. Saya pilih windows dan linux. Saya akan mengulas dari windows terlebih dahulu.


A. Percobaan yang di sistem operasi windows Xp sp3, P3 800;

Memory 387; VGA 128 MB Nvidia Gefore 5400, seperti ini:

1. Siapkan putty (software buat konek ke ssh server). Silahkan minta sama mbah google untuk dapetin putty
2. Copy putty ke folder C:WINDOWS
3. Lalu, klik start pilih Run, atau bisa menggunakan tombol kombinasi windows + R, di keyboard.
4. Di run ketikkan:
putty -D port ssh -C userid@ip ssh server
tekan Enter <|
5. Tunggu beberapa saat sampai diminta untuk memasukkan password
6. Lalu masukkan kita masukkan password
7. Sekarang minimize aja putty nya
8. Lalu buka browser, saya akan menggunakan internet explorer 7
9. Selanjutnya klick tool > internet option > pilih tab connection >
pilih LAN setting > cek box pd proxy server > klick advanced >
hilangkan tanda cek bok pd “use same proxy server for all
protocols” > hapus semua settingan yg ada di colum HTTP,Secure,
FTP. > pada socks isikan : localhost portnya 22 > klick OK
10. Sekarang coba kita akan cek koneksi internetnya, masuk ke situs http://speedtest.net untuk mengecek speed, jika speednya bertambah dari yang kita punya maka berhasil, tapi kalau nggak nambah ya berarti gagal deh. :D

B. Percobaan pake linux:
Dari yang saya dapat dari si mbah google settingannya tidak jauh berbeda tapi tergantung dari browser yang dipakai. Mungkin perbedaannya di command aja.
Berikut langkahnya:
1. Buka terminal programnya atau dengan tombol kombinasi ALT+F2 > ketikkkan Konsole
2. Kemudian install putty nya. Kalo belom ada minta sama mbah google aja, minta yang untuk linux
3. Kalo udah diinstal putty nya. Berikutnya langsung konek pake ssh dengan cara ketikkan :
contoh ;
# ssh -D 22 -C  HNaccount at 202.250.32.12

Catatan
* -D : maksudnya untuk membuka socks proxy,
Dan SOCKS ini lah yang kita gunakan untuk tunneling.
-C : untuk compressi data yg lewat.
22 : port ssh yg digunakan ato yg terbuka untuk koneksi ssh Port nya nggak harus 22, bisa berapa aja sesuai setting ssh server nya.

* settingan itu hanya berlaku pada browser yg diset ajah :D, tidak mempengaruhi applikasi yg lain yg sedang berjalan. misal mirc, applikasi yg lain yg konek ke internet akan tetap menggunakan koneksi internet anda yg sudah ada, misal speedy seperti.
* jika browsing atau downlaod anda masih lemot berarti server ssh yg anda gunakan juga lemot juga :D

* koneksi akan terputus jika :
1. Aplikasi putty di close ato terminate karena hang.
2. Koneksi internet yg anda gunakan anda terputus
3. Atau server ssh yang anda gunakan mati atau terputus dari internet, karena kena ddos atau kena trojan atau emang dimatiin. :D atau anda ketahuan sama admin, karena account ssh anda ilegal, jadi anda ditendang dr server ssh. :D
4. Settingan pada browser di hapus. Atau di set ke deafult.
5. Komputer anda kena virus/trojan ato kena flood/ddos, shg tidak bisa konek ke internet dg baik.

* sebaiknya jgn sering sering gunain cara ini jika account ssh anda illegal, krn kemungkinan ketahuan yang punya atau admin server ssh, anda bisa kena banned /block, jadi nggak bisa konek lagi. Tapi nggak papa cari target aja lagi :D.
======================================================================
Beberapa hal yg mungkin terjadi menggunakan ssh tunnel ini, yaitu:
Mungkin browsing anda tidak bisa cepat sesaui dengan harapan, karena tergantung pada server ssh yang digunakan. Tetapi download ke server luar bisa lebih cepat. Atau sebaliknya
======================================================================




Mungkin hanya ini yang bisa saya share, semoga bermanfaat untuk teman-teman semua.

Source : http://adhie70.blogdetik.com/mempercepat-koneksi-dengan-ssh-tunnel/

Wednesday, 28 August 2013

Backup and Restore MySQL Database Using mysqldump

mysqldump is an effective tool to backup MySQL database. It creates a *.sql file with DROP table, CREATE table and INSERT into sql-statements of the source database. To restore the database,  execute the *.sql file on destination database.  For MyISAM, use mysqlhotcopy method that we explained earlier, as it is faster for MyISAM tables.

Using mysqldump, you can backup a local database and restore it on a remote database at the same time, using a single command. In this article, let us review several practical examples on how to use mysqldump to backup and restore.

For the impatient, here is the quick snippet of how backup and restore MySQL database using mysqldump:


backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

restore:# mysql -u root -p[root_password] [database_name] < dumpfilename.sql

How To Backup MySQL database

1. Backup a single database:


This example takes a backup of sugarcrm database and dumps the output to sugarcrm.sql

# mysqldump -u root -ptmppassword sugarcrm > sugarcrm.sql

# mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

The sugarcrm.sql will contain drop table, create table and insert command for all the tables in the sugarcrm database. Following is a partial output of sugarcrm.sql, showing the dump information of accounts_contacts table:
--
-- Table structure for table `accounts_contacts`
--

DROP TABLE IF EXISTS `accounts_contacts`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `accounts_contacts` (
`id` varchar(36) NOT NULL,
`contact_id` varchar(36) default NULL,
`account_id` varchar(36) default NULL,
`date_modified` datetime default NULL,
`deleted` tinyint(1) NOT NULL default '0',
PRIMARY KEY  (`id`),
KEY `idx_account_contact` (`account_id`,`contact_id`),
KEY `idx_contid_del_accid` (`contact_id`,`deleted`,`account_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Dumping data for table `accounts_contacts`
--

LOCK TABLES `accounts_contacts` WRITE;
/*!40000 ALTER TABLE `accounts_contacts` DISABLE KEYS */;
INSERT INTO `accounts_contacts` VALUES ('6ff90374-26d1-5fd8-b844-4873b2e42091',
'11ba0239-c7cf-e87e-e266-4873b218a3f9','503a06a8-0650-6fdd-22ae-4873b245ae53',
'2008-07-23 05:24:30',1),
('83126e77-eeda-f335-dc1b-4873bc805541','7c525b1c-8a11-d803-94a5-4873bc4ff7d2',
'80a6add6-81ed-0266-6db5-4873bc54bfb5','2008-07-23 05:24:30',1),
('4e800b97-c09f-7896-d3d7-48751d81d5ee','f241c222-b91a-d7a9-f355-48751d6bc0f9',
'27060688-1f44-9f10-bdc4-48751db40009','2008-07-23 05:24:30',1),
('c94917ea-3664-8430-e003-487be0817f41','c564b7f3-2923-30b5-4861-487be0f70cb3',
'c71eff65-b76b-cbb0-d31a-487be06e4e0b','2008-07-23 05:24:30',1),
('7dab11e1-64d3-ea6a-c62c-487ce17e4e41','79d6f6e5-50e5-9b2b-034b-487ce1dae5af',
'7b886f23-571b-595b-19dd-487ce1eee867','2008-07-23 05:24:30',1);
/*!40000 ALTER TABLE `accounts_contacts` ENABLE KEYS */;
UNLOCK TABLES;

2. Backup multiple databases:

If you want to backup multiple databases, first identify the databases that you want to backup using the show databases as shown below:

# mysql -u root -ptmppassword

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| bugs               |
| mysql              |
| sugarcr            |
+--------------------+
4 rows in set (0.00 sec)

For example, if you want to take backup of both sugarcrm and bugs database, execute the mysqldump as shown below:

# mysqldump -u root -ptmppassword --databases bugs sugarcrm > bugs_sugarcrm.sql

Verify the bugs_sugarcrm.sql dumpfile contains both the database backup.
# grep -i "Current database:" /tmp/bugs_sugarcrm.sql
-- Current Database: `mysql`
-- Current Database: `sugarcrm`

3. Backup all the databases:

The following example takes a backup of  all the database of the MySQL instance.
# mysqldump -u root -ptmppassword --all-databases > /tmp/all-database.sql

4. Backup a specific table:

In this example, we backup only the accounts_contacts table from sugarcrm database.
# mysqldump -u root -ptmppassword sugarcrm accounts_contacts \
      > /tmp/sugarcrm_accounts_contacts.sql

4. Different mysqldump group options:

  • –opt is a group option, which is same as –add-drop-table, –add-locks, –create-options, –quick, –extended-insert, –lock-tables, –set-charset, and –disable-keys. opt is enabled by default, disable with –skip-opt.
  • –compact is a group option, which gives less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options –skip-add-drop-table –no-set-names –skip-disable-keys –skip-add-locks

How To Restore MySQL database

1. Restore a database


In this example, to restore the sugarcrm database, execute mysql with < as shown below. When you are restoring the dumpfilename.sql on a remote database, make sure to create the sugarcrm database before you can perform the restore.
# mysql -u root -ptmppassword

mysql> create database sugarcrm;
Query OK, 1 row affected (0.02 sec)

# mysql -u root -ptmppassword sugarcrm < /tmp/sugarcrm.sql

# mysql -u root -p[root_password] [database_name] < dumpfilename.sql

2. Backup a local database and restore to remote server using single command:

This is a sleek option, if you want to keep a read-only database on the remote-server, which is a copy of the master database on local-server. The example below will backup the sugarcrm database on the local-server and restore it as sugarcrm1 database on the remote-server. Please note that you should first create the sugarcrm1 database on the remote-server before executing the following command.
[local-server]# mysqldump -u root -ptmppassword sugarcrm | mysql \
                 -u root -ptmppassword --host=remote-server -C sugarcrm1
[Note: There are two -- (hyphen) in front of host]
If you liked this article, please bookmark it on del.icio.us and Stumble it.

Source :  http://www.thegeekstuff.com/2008/09/backup-and-restore-mysql-database-using-mysqldump/

CentOS Linux: Setting timezone and synchronizing time with NTP

Learn how to set the correct timezone and synchronize time with NTP servers on your CentOS box.


Setting the timezone

Setting the timezone on CentOS or Redhat Enterprise Linux (RHEL) is easy.
Login as root either locally or remotely via SSH.
See what the current timezone is:
date
You should see output like this:
Wed Jun  1 10:33:29 PDT 2011
To change the timezone first look at what timezones are available by running the following command on the command line interface:
ls /usr/share/zoneinfo/
You should see a listing like this:
[root@serve3 ~]# ls /usr/share/zoneinfo
Africa      Australia  Cuba     Etc      GMT0       Iceland      Japan      MST      Poland      right      Universal  Zulu
America     Brazil     EET      Europe   GMT-0      Indian       Kwajalein  MST7MDT  Portugal    ROC        US
Antarctica  Canada     Egypt    Factory  GMT+0      Iran         Libya      Navajo   posix       ROK        UTC
Arctic      CET        Eire     GB       Greenwich  iso3166.tab  MET        NZ       posixrules  Singapore  WET
Asia        Chile      EST      GB-Eire  Hongkong   Israel       Mexico     NZ-CHAT  PRC         Turkey     W-SU
Atlantic    CST6CDT    EST5EDT  GMT      HST        Jamaica      Mideast    Pacific  PST8PDT     UCT        zone.tab
Then simply delete the current timezone:
rm /etc/localtime
And replace it with a symbolic link to the new timezone from /usr/share/zoneinfo. For example if your chosen zone is Pacific time:
ln –s /usr/share/zoneinfo/PST8PDT /etc/localtime

Synchronizing time with NTP server

Network Time Protocol (NTP) is a standard way of synchronizing computer clocks across a network. Using NTP you can keep your server’s clock synchronized with super accurate atomic clocks located around the world. Computer clocks tend to “drift” so regularly synchronizing them with NTP servers helps keep them accurate.
The first step is to make sure you have the ntp program installed. Do a:
which ntpdate
If its not available type:
yum install ntp
Once ntp is installed synchronize your computer clock with:
ntpdate 0.us.pool.ntp.org
You are not limited to the above server. There are numerous NTP servers around the world. You can find a complete list at ntp.org.
Also keep in mind that ntp only affects the system time. The hardware clock on your server will not reflect that. So you want to set it as well so that the correct time is maintained after reboot:
hwclock --systohc

ntpd

To keep your server clock automatically synchronized you can run the ntpd daemon which is installed as part of the ntp package.
Edit the /etc/ntp.conf file to comment out the following lines:
#server 127.127.1.0     # local clock
#fudge  127.127.1.0 stratum 10
The above two lines can sometimes prevent ntpd from properly synchronizing your clock. They are already commented out by default on CentOS/RHEL 6. But on 5.x you have to comment them out manually.
Finally type the following two commands to start the daemon and make it run automatically at boot up:
service ntpd start
chkconfig ntpd on

Thursday, 22 August 2013

Install Google Chrome on Fedora 19/18/17/16

This howto explains howto install Google Chrome Web browser on Fedora 19/18/17/16. Best way to install and keep up-to-date with Google Chrome browser is use Google’s own YUM repository.

Enable Google YUM repository

Add following to /etc/yum.repos.d/google-chrome.repo file:
32-bit
[google-chrome]
name=google-chrome - 32-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
64-bit
[google-chrome]
name=google-chrome - 64-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
Note: Both 32-bit and 64-bit repos can be placed in the same file.

Install Google Chrome with YUM (as root user)

Install Google Chrome Stable Version

## Install Google Chrome Stable version ##
yum install google-chrome-stable

Install Google Chrome Beta Version

## Install Google Chrome Beta version ##
yum install google-chrome-beta

Install Google Chrome Unstable Version

## Install Google Chrome Unstable version ##
yum install google-chrome-unstable
Source : http://www.if-not-true-then-false.com/2010/install-google-chrome-with-yum-on-fedora-red-hat-rhel/

Installing Citrix ICA Client on Fedora 17 (64-bit)

1. Enable RPMFusion repository
2. Install the dependencies:
Drop to a terminal and run:
su -c "yum install openmotif.i686 alsa-lib.i686"
The link keeps on changing for the ICAClient RPM, so go to download.citrix.com and do the following:
  1. Click downloads
  2. Select “Citrix Receiver” under “Select Product”
  3. Select “Receivers by platform” under “select download type”
  4. Click find
  5. Expand “Receiver for Other Platforms”
  6. Choose the Linux Receiver
  7. Choose the RPM version
Now install it:
su -c "yum localinstall ICAClient-*.rpm"
Now you should have “Citrix Receiver” under Applications -> Internet

Source : https://mknowles.com.au/wordpress/2012/12/28/installing-citrix-ica-client-on-fedora-17-64-bit/

Wednesday, 24 July 2013

Re: Process named udevd in a CPU loop

yum upgrade module-init-tools
 
 
Source : https://forums.aws.amazon.com/thread.jspa?messageID=301214 

Install ICAClient di Fedora

Preface

Note: I changed jobs a couple of years ago, and I no longer have access to a Citrix Server, therefore these instructions are to the best of what I had at the time, and may have changed or require tweaking since the last time I executed them.
Fortunately for us Linux users, Citrix provides binaries for connecting to Citrix servers from Linux boxen. Unfortunately, they have made the attempt to oversimplify the installation of their binaries by providing an installation script. The installation script is flawed in that it assumes you want to use Netscape as your browser. And even then it doesn’t seem to install ready-to-use. So for those of us that want to use it with a different browser (and/or Netscape for that matter), we are relegated to hunting google and/or searching for hidden documentation on how to manually install the client. So to Citrix, I say "A for effort" and "F" for not realizing that us linux techies also like to have detailed instructions on how to manually install when the automated install doesn’t suit our needs. And that brings us to the purpose of this page.

Obtaining the Citrix ICA Client

You need to obtain the Citrix ICA Client package. Citrix offers an RPM, but for the purposes of this page, I’m recommending the tarball. Thus, these instructions will be based off of the tarball download.
First, obtain the Citrix ICA Client tarball by going to http://www.citrix.com/ and selecting "Downloads". Or if you specifically want the current Linux x86 tarball, go to http://download2.citrix.com/files/de/products/client/ica/current/linuxx86.tar.gz. From this point on in the documentation, the tarball will be assumed to be the x86 version, so substitute accordingly if you have to.

Unpacking Citrix ICA Client

Once you've obtained the tarball, you need to unpack it. Pick a temporary location to unpack this tarball. For this page, we’ll use /tmp/citrix/. So create the temporary directory, move the tarball to that directory and change into that directory:
mkdir /tmp/citrix/
mv linuxx86.tar.gz /tmp/citrix/
cd /tmp/citrix/
Now unpack the tarball:
gzip –decompress linuxx86.tar.gz
tar xf linuxx86.tar
Now to run the installation command you must be logged in as the super user (root). So change to root (using su, or however).
Execute the installation script, and follow the instructions as prompted:
./setupwfc
Using the default installation directory is highly recommended. If you choose not to, you’ll have to read the install.txt to figure out what environment variables need to be set to get the Citrix ICA Client to work. The rest of this page will assume that the Citrix ICA Client was installed to its default directory. If the default was chosen, the binaries are now installed in /usr/lib/ICAClient/.

Note: I reccomend answering "No" to the installer when it asks if you'd like to integrate Citrix automatically since this How-To handles all of the setup needed.

Configuring Your Browser

These directions should work for Firefox, Mozilla, Netscape, and any other Linux Mozilla-based browser. The first step is to find the plugins directory for the browser you wish to configure. The plugins directory is typically found as a subdirectory of the installation directory for your browser. If you are unsure of the location of your plugins directory, you can try the following command to attempt to locate the plugins directory:
find / -name plugins | grep -i "netscape\|firefox\|mozilla"
We’ll assume that we are configuring Firefox, and that Firefox was installed to /opt/firefox. Again the following will have to be done as the superuser (root). Change into the plugins directory of your browser:
cd /opt/firefox/plugins/
Next, create a symlink (aka softlink) to the Citrix ICA Client library:
ln –s /usr/lib/ICAClient/npica.so npica.so
If the Citrix install script was able to find Netscape, it probably already did this step for you.

Connecting to Citrix and Using the Citrix ICA Client

Close all running instances of the browser you configured (just to be safe). Open a new instance of the browser. Type the URL of and connect to your Citrix Server (as though installation were complete). Login to the Citrix server with your user id and password. Once logged in, you should get the mini-desktop with all of your applications. The first time you click on an application, your browser is likely going to popup a dialog box giving you the choice to open the file or save the file. Choose the option to open the file. Where it asks for the application to use on this type of file, type in the path to the wfica application:
/usr/lib/ICAClient/wfica
If given the choice, tell the browser to use this application for all future downloads of this file type.
Congratulations! You have installed and configured the Citrix ICA Client.

Source : http://www.agaveblue.org/howtos/Citrix_ICA_How-To.shtml