POP Keywords: apache oracle sybase ...

python – which site-packages folder are used in my environment [solved]

Log into your python environment and run: import site print(‘\n’.join(site.getsitepackages())) print(‘\n’.join(site.getusersitepackages())) sources http://pythonsimple.noucleus.net/python-install/python-site-packages-what-they-are-and-where-to-put-them

python 3.5 – install oracle mysql driver on ubuntu [solved]

Installing this mysql driver is surprisingly quite a painful experience. Steps Download package relevant for your distribution and python version from oracle website: https://dev.mysql.com/downloads/connector/python/ Install downloaded package: sudo dpkg -i mysql-connector-python-py3 _2.1.3-1ubuntu15.04_all.deb Go into python and run “import mysql” For all virtualenvs, simply symlink: ln -s /usr/lib/python3/dist-packages/mysql <path_to_virtual_env>/lib/pythonX.X/site-packages It should be good by now.

python – which site-packages folder are used in my environment [solved]

Log into your python environment and run: import site print(‘\n’.join(site.getsitepackages())) print(‘\n’.join(site.getusersitepackages())) sources http://pythonsimple.noucleus.net/python-install/python-site-packages-what-they-are-and-where-to-put-them

unix – file cannot be deleted or modified, even by root user [solved]

I had a file that could not be edited / removed / moved, even by root user. Reason for it is that this file was declared immutable. To solve this, run: sudo chattr -i <path/to/file> Now file can be edited/removed/moved. sources http://www.omgubuntu.co.uk/2016/03/fix-failed-to-fetch-google-chrome-apt-error-ubuntu  

how to set up cx_Oracle on ubuntu [solved]

I tried installing oracle client to use it with sqlalchemy and ended up with a nasty error message: distutils.errors.DistutilsSetupError: cannot locate Oracle include files To setup cx_Oracle so that it can be imported from python, proceed as follow: install libaio.so.1 by running: sudo apt-get install libaio1 download instant client appropriate for your platform from oracle website: http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html SDK and ODBC packages must be downloaded too. note: on my side i downloaded: oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-odbc-12.1.0.2.0-1.x86_64.rpm convert into .deb package: sudo alien -d *instantcl*.rpm note: you may need to install alien (sudo apt-get install alien) if not already done install created package: […]

python lxml – use absolute xpath to find elements [solved]

When using lxml library, using an absolute xpath such as ‘/root/child/other_child’ end up with a nasty error message: SyntaxError: cannot use absolute path on element Reason for that is that call was performed on an Element using .findall() method. To use an absolute xpath, do not perform call on an Element, rather perform call on an ElementTree and call .xpath() method instead of .findall() Illustration below: etree.parse(fpath).getroot().findall(‘/root/child/’) # => SyntaxError: cannot use absolute path on element etree.parse(fpath).xpath(‘/root/child/’) # => OK sources http://stackoverflow.com/questions/16367504/python-parsing-html-elements-based-on-absolute-xpath http://lxml.de/api/

apache – grant access to single file

Steps Ensure target file has read access from apache user ls -l /path/to/my/file/myfile.doc If not, grant right via: chmod a+rwx /path/to/my/file/myfile.doc In one of your /etc/apache/sites-enable/*.conf files, add the following: <Directory /path/to/my/file> <Files myfile.doc> Require all granted </Files> </Directory> Restart apache sudo apache2ctl restart Voilà! sources http://stackoverflow.com/questions/13799932/how-to-allow-access-to-only-a-single-file

ubuntu with gnome 3 – change login screen logo [solved]

To change login screen logo on ubuntu with gnome 3, proceed as follows: sudo apt-get install dconf-editor open dconf-editor as root: sudo dconf-editor navigate to org > gnome > login-screen update value of “logo” variable to the path of logo file to use restart GDM And voilà! sources http://ubuntuhandbook.org/index.php/2014/04/ubuntu-14-04-change-login-screen-background-remove-the-white-dots/ http://stackoverflow.com/questions/29189648/why-cant-i-change-the-gnome-login-screen-logo  

ubuntu – install all google fonts and use them in gimp

To install all google fonts in gimp on ubuntu, proceed as follows: download fonts from https://github.com/google/fonts/archive/master.zip create a folder “.fonts” in your home directory: mkdir ~/.fonts unzip content of downloaded file into newly created .fonts folder: cd ~/.fonts; unzip ~/Downloads/master.zip regenerate font cache: sudo fc-cache -fv restart gimp That’s it. All fonts should be avaialable sources https://github.com/google/fonts/ http://askubuntu.com/questions/3697/how-do-i-install-fonts https://wiki.ubuntu.com/Fonts https://www.google.com/fonts

gnome – change default screenshot program

Default screenshot program is easy to use and does the job. If you want to go slightly forward, such as selecting screenshot area, editing screenshot and so on, you should give a go to “shutter” as an alternative. steps install shutter: sudo apt-get install shutter set up shutter as default application go to keyboard shortcuts under tab “Customs Shortcuts” create a new shortcut running “shutter -s”, as per below assign the print-screen button as activation button for this shortcut, as per below done! sources http://askubuntu.com/questions/252717/how-to-make-shutter-as-the-default-screenshot-tool