Friday, November 21, 2014

Masalah Kenaikan BBM

Beberapa hari ini masalah kenaikan BBM manjadi topik yang paling sering ditemui di berbagai kesempatan, entah lagi makan di kantin kantor client, di tengah pembicaraan dengan client, di rumah, di berita media apalagi.

Dari sudut pandang pribadi, namanya konsumsi BBM itu mesti dipaksakan untuk dibatasi. Kalo gak, kan BBM sendiri tidak bisa diperbaharui, akibatnya harganya pasti akan meningkat seiring dengan waktu. 

Selain itu, ga bisa dipungkiri, manusia di Indonesia ini udah sangat manja sekali. Anak anak masih bau kencur aja pergi sekolah bawa motor. Mau ke warung yang cm 100 meter saja naik motor. Kantor yang cuma 500 meter aja naik Mobil atau sewa ojek bahkan naik taksi.Ga heran banyak yang kena diabetes sekarang sekarang walaupun masih muda.

Coba ya diusahakan untuk tidak manja, biasakan berjalan kaki, selain sehat, mengurangi polusi (yah paling polusi bau ketek karena keringetan... thanks to Rex*na yang setia menemaniku). Tapi habit manusia emang udah begitu, makanya fungsi pemerintah itu memaksakan sesuatu untuk manjadi lebih baik. Namanya juga Pemerintah (pemberi perintah, bukan penerima perintah), ya tapi semua perintahnya mesti dievaluasi.

Saya lihat pemerintah sekarang sudah banyak berubah koq, terutama masalah transparansinya. Sehingga masyarakat bisa ikut mengawasi kinerja dan hasil kerjanya. Pemerintah juga pasti udah takut kalo macem macem... Ada banyak instrumen pengawasan sekarang ini. Kecuali pemerintahan di bawah militer, nah itu baru masalah, yang ada kita yang diawasi.. oh mai gat... 


MySQL : Cannot add or update a child row : a foreign key constraint fail

Setelah lama tidak bermain main dengan MySQL, cukup banyak yang terlupakan. Hari ini pun sama, saat sedang mencoba untuk meng-import file .sql ke dalam MySQL server, aku mendapatkan pesan "cannot add or update a child row : a foreign key constraint fail".

Setelah membaca manual MySQL, ternyata ini bisa diatasi dengan langkah langkah berikut :
1. login ke dalam MySQL anda.
2. pilih database anda.
3. ketikkan perintah "SET foreign_key_checks = 0;" (tanpa tanda double quote tentunya).
4. ketikkan perintah "SOURCE dump_file_name;"
5. Ketikkan perintah "SET foreign_key_checks = 1;"

sebenarnya langkah diatas mencegah mysql menge-check foreign key yang ada pada tabel (kalau ada). tetapi langkah ini harus dikembalikan lagi ke state semula, agar foreign key bisa berfungsi sesuai dengan peruntukannya. Semoga membantu bagi yg tersesat.

Try to Up and Run a RoR server

I want to setup a Rails Server for my own purposes... Actually I want to learn RoR... So here is the first thing I have to do, setup the learning server   :D

Precondition :
Server : Oracle Virtualbox, 512MB Ram, Single core, 10GB Storage.
OS server : Ubuntu 12.04 LTS
DB engine : Mysql Server 5.5.35


I try a tutorial from here : http://tinyurl.com/khfoxbr
And here is the log :

1. I run : sudo apt-get update

2. I run : sudo apt-get install curl

3. I run : \curl -L https://get.rvm.io | bash -s stable
and I got error like this :
...
gpg: Can't check signature: public key not found
Warning, RVM 1.26.0 introduces signed releases and automated check of signatures when GPG

software found.
Assuming you trust Michal Papis import the mpapis public key (downloading the signatures).

GPG signature verification failed for '/home/froggy/.rvm/archives/rvm-1.26.3.tgz' -

'https://github.com/wayneeseguin/rvm/releases/download/1.26.3/1.26.3.tar.gz.asc'!
try downloading the signatures:

    gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3

or if it fails:

    command curl -sSL https://rvm.io/mpapis.asc | gpg --import -

the key can be compared with:

    https://rvm.io/mpapis.asc
    https://keybase.io/mpapis

4. I try to run this as suggested : gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3

5. I run this again : \curl -L https://get.rvm.io | bash -s stable

6. I run this : source ~/.rvm/scripts/rvm

7. I run this : rvm requirements

And I got this message :

Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating systemfroggy password required for 'apt-get --quiet --yes update':
............
Installing required packages: gawk, g++, gcc, make, libc6-dev, libreadline6-dev, zlib1g-dev,

libssl-dev, libyaml-dev, libsqlite3-dev, sqlite3, autoconf, libgdbm-dev, libncurses5-dev,

automake, libtool, bison, pkg-config, libffi-dev........................
Requirements installation successful.

Well, it's a successful process.

8. Next I run this : rvm install ruby
and I got this :
...
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/ubuntu/12.04/x86_64/ruby-2.1.5.tar.bz2
Checking requirements for ubuntu.
Requirements installation successful.
ruby-2.1.5 - #configure
ruby-2.1.5 - #download
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100 21.6M  100 21.6M    0     0   209k      0  0:01:45  0:01:45 --:--:--  239k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.1.5 - #validate archive
ruby-2.1.5 - #extract
ruby-2.1.5 - #validate binary
ruby-2.1.5 - #setup
ruby-2.1.5 - #gemset created /home/froggy/.rvm/gems/ruby-2.1.5@global
ruby-2.1.5 - #importing gemset

/home/froggy/.rvm/gemsets/global.gems..........................................
ruby-2.1.5 - #generating global wrappers........
ruby-2.1.5 - #gemset created /home/froggy/.rvm/gems/ruby-2.1.5
ruby-2.1.5 - #importing gemsetfile /home/froggy/.rvm/gemsets/default.gems evaluated to empty

gem list
ruby-2.1.5 - #generating default wrappers........

9. And I run this : rvm use ruby --default

10. And then I install rails using rvm : rvm rubygems current

11. And I run : gem install rails

12. And finally I try to create a project like this : rails new testing2 -d mysql

and I got error like this :

...
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.
.
.
.
        --without-mysqlclientlib

extconf failed, exit code 1

Gem files will remain installed in /home/froggy/.rvm/gems/ruby-2.1.5/gems/mysql2-0.3.17 for

inspection.
Results logged to /home/froggy/.rvm/gems/ruby-2.1.5/extensions/x86_64-linux/2.1.0/mysql2-

0.3.17/gem_make.out



13. After surfing from here to there... i got a clue, and I try to run this : sudo apt-get install libmysqlclient-dev

14. And I run this : gem install mysql2 -v '0.3.17'

15. And lastly (really?), I run this : rails new testing2 -d mysql

and the structure directory and file for my new project called "testing2" automaticaly

generated by rails.

16. Got error while try to start rails server (I'd told you.. #15 isn't the last.. ) :

...
Could not find a JavaScript runtime
...


17. And solved by this : sudo apt-get install nodejs

That's it...

Tuesday, July 08, 2008

Canon iP1600 on Kubuntu

Note: This manual also works for the following printers: Canon IP1600 using the IP2200 drivers.

This does not work for AMD64.

Installation

Note: You will have to accept Canon's license agreement to download the software.

1. Connect your printer, and start Ubuntu.

2. Install the needed packages: alien, libxml1, libpng12-0, libpng12-dev, libgtk1.2 and libgtk1.2-common with Synaptic or type: {{{sudo apt-get update sudo apt-get install alien libxml1 libpng12-0 libpng12-dev libgtk1.2 libgtk1.2-common}}}


3. Download the drivers for your printer from Canon. For the purposes of this howto, we will assume that the files are saved to the directory /home/yourname/canon.

The iP2200 drivers are here: http://software.canon-europe.com/software/0024301.asp or type in a terminal {{{mkdir canon cd canon wget http://software.canon-europe.com/files/soft24301/software/iP2200_Linux_260.tar.gz }}}

4. Extract the files with archive manager or type {{{tar -xvzf iP2200_Linux_260.tar.gz }}}

5. Convert the RPM packages to Debian packages: {{{sudo alien cnijfilter-common-2.60-1.i386.rpm cnijfilter-ip2200-2.60-1.i386.rpm }}}

6. Install the packages:

>>> revision : sudo aptitude remove libcnbj-2.6 (only if you have an experience with ip2200 driver)

sudo dpkg -i *.deb

7. Make sure the library links are correct. /usr/lib/libtiff.so.3 should point to /usr/lib/libtiff.so.4 (or to the same thing as /usr/lib/libtiff.so.4 points to) If not, type: {{{sudo ln -s /usr/lib/libtiff.so.4 /usr/lib/libtiff.so.3 }}} This is the important part! The iP2200 driver wants to use libtiff.so.3, but that is an old version. We fix this by making libtiff.so.3 a link to libtiff.so.4.

Also, /usr/lib/libpng.so.3 should point to /usr/lib/libpng.so If not, type: {{{sudo ln -s /usr/lib/libpng.so /usr/lib/libpng.so.3 }}}

and /usr/lib/libxml2.so.2 should point to /usr/lib/libxml.so.1 If not, type: {{{sudo ln -s /usr/lib/libxml2.so.2 /usr/lib/libxml.so.1 }}}

And finally make the loader aware of the changes: {{{sudo ldconfig }}}

8. Restart cups: {{{sudo /etc/init.d/cupsys restart }}}

9. Add a new printer. Under GNOME, this is accessed in System|Preferences|Printing. Select Canon as the manufacturer, click on "Install Driver..." and select /usr/share/cups/model/canonip2200.ppd. Now select "iP2200 Ver.2.60" under "Model". Select "Standard" for the driver (this should be the only option). Make sure the connection is correct. Hopefully, printing a test page will work!

Advanced Features

Unfortunately, the installed PPD file doesn't allow you to select the printing quality. To fix this, back up your ppd file, then open it as root: gksudo gedit /etc/cups/ppd/iP2200-Ver.2.60.ppd

Insert these lines in the file after the "Resolution" section:

*OpenUI *CNQuality/Quality: PickOne
*DefaultCNQuality: 3
*CNQuality 2/High: "2"
*CNQuality 3/Normal: "3"
*CNQuality 4/Standard: "4"
*CNQuality 5/Economy: "5"
*CloseUI: *CNQuality

The following gives a greater choice of print resolution if added to the "Resolution" section, but I am not clear whether the Quality setting impinges upon this. Note that the ip2200 only offers 600dpi in black and white.

*Resolution 1200/1200 dpi: "<>setpagedevice"
*Resolution 2400/2400 dpi: "<>setpagedevice"
*Resolution 4800/4800 dpi: "<>setpagedevice"

(from http://gentoo-wiki.com/Canon_Pixma_Series)

N.b. neither of these modifications is done in the unofficial packages provided by: http://mambo.kuhp.kyoto-u.ac.jp/~takushi/

After this, restarting cups should enable the changes sudo /etc/init.d/cupsys restart

To perform maintenance on the printer, such as head cleaning, type in a terminal: cngpij -P iP2200-Ver.2.60

You may want to add this to your menu, since it is a real pain to remember. In the window that pops up, select "Maintenance".