Posts

Showing posts from November, 2019

Connecting Oracle with Python via cx_Oracle extension

Installation Prerequisites Python 2.7, 3.5 or above Oracle Client / Oracle Instant Client "Basic" or "Basic Light" libaio / libaio1 package Installation  Reference cx_Oracle Installation guide Sample Python Code import cx_Oracle # Make DSN address. Real values for host address, port and service name were replaced by '<>'. dsn = cx_Oracle.makedsn('<host_address>', '<port>', service_name='<service_name>') # Connect to DSN orcl = cx_Oracle.connect(user='<username>', password='<password>', dsn=dsn) # Get cursor cursor = orcl.cursor() # Execute SQL statement cursor.execute('<SQL SELECT STATEMENT>') # Fetch result data = cursor.fetchone()

Sending F10 in Ubuntu Terminal

By default, you just can't send F10 to Ubuntu Terminal's curses program. This is because F10 is being captured by Terminal.app already. A quick workaround is to use "ESC 0" to simulate sending F10 inside Terminal.app. Reference

Customized Dash (Launcher / Taskbar) Icon in Ubuntu

To customize application icon in Ubuntu: Create a .desktop file in ~/.local/share/applications/ e.g. /home/user/share/applications/<application name>.desktop Add the following content to the desktop file [Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Name=ApplicationName GenericName=ApplicationName Icon=/home/user/application-icon.png Exec=/home/user/application/application-executable Categories=Category;Subcategory Done!