POP Keywords: apache oracle sybase ...

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- oracle-instantclient12.1-devel- oracle-instantclient12.1-odbc- 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  

gnome 3 – default theme – header way too big [solved]

To reduce window header: create a file under vi ~/.config/gtk-3.0/gtk.css enter following css content (customize padding values and font sizes as required): .header-bar { padding-top: 1px; padding-bottom: 1px; font-size: 7px; } .header-bar .button { padding-top: 1px; padding-bottom: 1px; } .header-bar.default-decoration { padding-top: 1px; padding-bottom: 1px; border: none; background-image: linear-gradient(to bottom, shade(@theme_bg_color, 1.05), shade(@theme_bg_color, 0.99)); box-shadow: inset 0 1px shade(@theme_bg_color, 1.4); } .header-bar.default-decoration .button.titlebutton { padding-top: 1px; padding-bottom: 1px; } Witness the impact live by restarting gnome shell: alt+f2 then run “r” And voilà! To go further: run “gnome-tweak-tool” under section “fonts”, reduce various font sizes and play with “scaling factor” […]

sick of nautilus opening target folder when moving files, switching to nemo

To switch to nemo file-manager, proceed as follows: Install packages: sudo apt-get install nemo nemo-fileroller Activate nemo: sudo xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search sudo gsettings set org.gnome.desktop.background show-desktop-icons false sudo gsettings set org.nemo.desktop show-desktop-icons true Ensure nemo was activated properly: xdg-mime query default inode/directory nemo.desktop sources http://askubuntu.com/questions/481742/how-to-replace-nautilius-with-nemo-in-gnome-3

unix – find all files in folder with or without size

To find all files (without following symlinks): find -P . -type f To find all files along with their corresponding size in bytes: find -P . -type f -exec stat -c ‘%s      %n’ {} \; sources http://askubuntu.com/questions/460210/using-find-and-stat-to-display-filenames-and-statistics