Saturday, November 2, 2013

Install f.lux on Ubuntu 13.10

Now if you try to follow instructions on http://justgetflux.com/linux.html you will fail at step

sudo apt-get update

because there is no such url http://ppa.launchpad.net/kilian/f.lux/ubuntu/dists/saucy/main/binary-i386/Packages today (02.11.2013) for Ubuntu 13.10 (saucy). Edit in Software & Updates distribution to raring and continue with fillowings

sudo apt-get update 
sudo apt-get install fluxgui

Thats all.

Sunday, October 27, 2013

Generate PDF / XLS reports in APEX

Problem description

If you have any complex application in APEX you probably need to generate some untrivial reports and may be in several formats (HTML / PDF / XLSX). It's very painfull to try to do it in pure PLSQL and very expensive to use such enterprise software as Oracle BI Publisher. At the other hand you can use any open report server system like JasperReports but here you have big problem with integration  external servers with APEX security system to allow access reports only for authorized users. It's good enougth to solve this if you have tons of regular changing reports so you can spend much time for enviroment and less time for reports support in the future but what can you do otherwise?

Monday, April 22, 2013

Load hash from YAML with keys as symbols in Ruby

The most easy way is to start keys with colon ':'

:db:
  - :host: db.host.com
    :port: 5210

Now when you load this

db_config = YAML::load(File.open(File.expand_path('../config/database.yml', File.dirname(__FILE__))))

it will be "symbolized"

Thursday, April 11, 2013

Ubuntu crash after kernel or Nvidia proprietary drivers updates

How to restore Ubuntu if it crashes after kernel or Nvidia drivers updates

  1. Press Ctrl+Alt+T (or Ctrl+Alt+F1) to run terminal
  2. Install linux kernel source and headers
    sudo apt-get install linux-source
    sudo apt-get install linux-headers-<kernel version>-generic
  3. Remove Nvidia drivers
    sudo apt-get remove nvidia-current
    or
    sudo apt-get remove nvidia-current-updates
    or
    sudo apt-get remove nvidia-experimental-<version>
  4. Reinstall Nvidia drivers
    sudo apt-get install nvidia-current-updates
  5. Reboot
    sudo -r now

Saturday, March 30, 2013

Convert VMware disk (.vmdk) to VirtualBox (.vdi)

It's simple. Just do:

/usr/bin/VBoxManage clonehd src_image.vmdk dest_image.vdi --format VDI --variant Standard

Saturday, February 16, 2013

Add shortcut to Ubuntu Unity Launcher

To add any shortcut to Ubuntu 12.10 Unity Launcher just

  1. Create file with such content:
    [Desktop Entry]
    Version=1.0
    Type=Application
    Name=JetBrains RubyMine
    Exec="/home/.../RubyMine-5.0/bin/rubymine.sh" %f
    Icon=/home/.../RubyMine-5.0/bin/RMlogo.svg
    Comment=Develop with pleasure!
    Categories=Development;IDE;
    Terminal=false
    StartupNotify=true
    StartupWMClass=jetbrains-rubymine
  2. Place it in ~/.local/share/applications/<any name>.desktop
  3. Drag and drop this file into the Unity Launcher.
  4. Profit!!!

Monday, January 28, 2013

Install Oracle XE 11g on AWS EC2 micro instance of Amazon Linux

Installing Oracle XE on AWS is little bit tricky. I was ready spend lot of time on it but found good step by step manual by Håvard Kristiansen. And it will be great if all my problems was solved but I need also latest version of APEX that also included in XE pack. Here you can find what problems I met during APEX upgrade to 4.2 and how I can solve them.


Preparing for upgrade

You have downloaded and unzipped APEX 4.2 on your AWS instance in /u01/download/apex folder

Oracle memory management

Now you should know that APEX update procedure will spent 4hrs!!! on AWS micro instance and if you have default configuration with 2Gb swap (as described in Harvard manual) you will get insufficient SHARED_POOL_SIZE error at the end of this 4 hours :). To solve this you must change Oracle memory management configuration to increase SHARED_POOL_SIZE.

Configure tmpfs

Remount tmpfs to increase it's size because by default it has RAM/2 size and it's not enougth to increase Oracle MEMORY_MAX_TARGET

  • sudo umount tmpfs
  • sudo mount -t tmpfs shmfs -o size=1500m /dev/shm

Now we should change /etc/fstab to save this effect and change line with tmpfs mount to look like:

  • tmpfs       /dev/shm    tmpfs   defaults,size=1500m        0   0

Even you do so size=1500m parameter will be ignored by sysinit. To override this we need remove -f parameter by these commands:

  • sudo cp /etc/rc.d/rc.sysinit /etc/rc.d/rc.sysinit.bck
  • sudo sed -i 's/-f \/dev\/shm/\/dev\/shm/g' /etc/rc.d/rc.sysinit

Now we ready to change Oracle memory parameters. All memory sizes you can change by your own wish.

  • sqlplus sys/<sys_password> as sysdba
  • create spfile from pfile;
  • ALTER SYSTEM SET MEMORY_MAX_TARGET=1G SCOPE=SPFILE;
  • ALTER SYSTEM SET MEMORY_TARGET=1G SCOPE=SPFILE;
  • ALTER SYSTEM SET SGA_TARGET=500M SCOPE=SPFILE;
  • ALTER SYSTEM SET SHARED_POOL_SIZE = 300M;
  • shutdown immediate;
  • startup;

Upgrade process

That's all. Now you can start upgrade process follow by official oracle manual.