Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Wednesday, November 25, 2015

Install Java JDK/JRE on Debian jessie with 'apt-get install'

Issue: default JDK for Debian 8 is JDK 7. I need a maintainable way to upgrade it to JDK 8.

Steps:

1. Edin file /etc/apt/sources.list and add this line on the bottom:
deb http://http.debian.net/debian jessie-backports main

2. sudo apt-get update

3. sudo apt-get install openjdk-8-jdk

4. test it as this:
java -version

If the result shows version 7, you could check the names of JDK7 packages and remove them
4.1. Check older JDK packages:
dpkg -l | grep openjdk

4.2. Remove your older JDK packages, e.g.:
apt-get purge openjdk-7-jdk
apt-get purge openjdk-7-jre
apt-get purge openjdk-7-jre-headless



Solved.

Friday, August 9, 2013

linux: demonizing a process and killing it when you want

This is very useful for processes which do not write an PID file. This is stupid... but it could be work-arounded.

For example I want to start ant kill later the jasmine server, which is started this way:
bundle exec rake jasmine:server --trace

magic apostrophes in linux = Back Quotes for Command Substitution

They are replaced by the output of the command between them:

kill -9 `echo 9999`

is equivalent to:

killing app, listening on a defined port in single line

In Linux this will kill the process, listening on port 8888:

ps aux | grep port=8888 | awk '{print $2}' | tail -n 1 | xargs kill -9

Monday, May 13, 2013

Java application as a daemon - initd start/stop template file

Your Java application is a daemon and you want to stop it more gracefully than "killall java".

The example below is what you need:

Tuesday, November 6, 2012

Solved - Windows cannot access samba shares after linux upgrade

I encounter this issue after apt-get upgrade / dist-upgrade in Debian. It is solved now.
The cause was a change in samba between versions 3.3.2 and 3.4.0.

Thursday, June 21, 2012

Error "failed to get a socket for (null)" after upgrading apache httpd

The symptom: After an regular Debian update, when I tried to start apache, it show me this error:

(22)Invalid argument: alloc_listener: failed to get a socket for (null)
...
Syntax error on line xx of /etc/apache2/ports.conf:

The line was
Listen 80

Tuesday, January 31, 2012

linux: Searching in command history

This is a great trick for everyone who uses linux console a lot.

1. Ctrl+R in console
2. Enter search string
3. OS suggests you a line from command history
4. If you want an older command with same search string, just hit Ctrl+R.
5. that's all folks

Tuesday, January 3, 2012

Problem with WebDAV folders in debian linux

Here is my problem:

When I try to copy some files / folders to webdav folder, I get an error in Windows XP and this log in my Linux box:

[Tue Jan 03 13:49:35 2012] [error] [client 123.123.123.123] File does not exist: /the/webdav/folder/some-file.JPG
[Tue Jan 03 13:49:35 2012] [error] [client 123.123.123.123] The locks could not be queried for verification against a possible "If:" header. [500, #0]
[Tue Jan 03 13:49:35 2012] [error] [client 123.123.123.123] Could not open the lock database. [500, #400]
[Tue Jan 03 13:49:35 2012] [error] [client 123.123.123.123] (2)No such file or directory: Could not open property database. [500, #1]