piatok 28. apríla 2017

JasperServer 6.3.0: how to change default output destination in job scheduling

Default output to repository is impractical when you prefer storing to filesystem, e.g. to /var/local/reports/ directory. You can achieve that by editing following files:

in file scripts/scheduler/model/jobModel.js on two places change this one line:

saveToRepository: false,

to these two lines:

saveToRepository: false,
outputLocalFolder: "/var/local/reports/",

and in files:

optimized-scripts/scheduler/model/jobModel.js
optimized-scripts/scheduler/schedulerMain.js

change all occurences of this:

saveToRepository:!0

to this:

saveToRepository:0,outputLocalFolder:"/var/local/reports/"

and enjoy desired behaviour. JasperServer needs to have write permission to specified folder.

streda 26. apríla 2017

How to run JasperServer 6.3.0 via systemd as non-root user on Linux

Prerequisities

  • JasperServer 6.3.0 installed as root into /opt/jasperreports-server-cp-6.3.0/
  • user apache existing in /etc/passwd (if it is not the case, use other user or create one - shell access not needed... subsequent how to is out of scope of this article)
  • tested on CentOS 7, but should be working also on other systems with systemd
Now, let's do it.

Change ownership of installation from root to user

sudo chown -R apache /opt/jasperreports-server-cp-6.3.0/

Create systemd unit configuration file

sudo vim /usr/lib/systemd/system/jasper-server.service

with this content:

[Unit]
Description=Jasper Server 6.3.0
After=syslog.target
After=network.target

[Service]
Type=forking

User=apache
Group=apache

Restart=on-failure
PIDFile=/run/jasper_server.pid
KillMode=mixed
ExecStart=/opt/jasperreports-server-cp-6.3.0/ctlscript.sh start
ExecStop=/opt/jasperreports-server-cp-6.3.0/ctlscript.sh stop
RestartSec=10s

TimeoutSec=900

[Install]
WantedBy=multi-user.target

Daemon reload after later changes of jasper-server.service file:

sudo systemctl daemon-reload

Set it to start-up automatically

sudo chkconfig jasper-server on

Then it could be controlled this way:

sudo service jasper-server start
sudo service jasper-server stop
sudo service jasper-server restart

And checked, if running, this way:

ps -ef | grep jasper

Or checked if running locally (in its default configuration on TCP/HTTP port 8080 of Apache Tomcat):

telnet localhost 8080

Troubleshoot, if needed:

cat /opt/jasperreports-server-cp-6.3.0/apache-tomcat/logs/catalina.out
cat /opt/jasperreports-server-cp-6.3.0/apache-tomcat/logs/catalina.out | grep -i error

If needed, allow JasperServer HTTP port on firewall

CentOS 7 netfilter is controlled by firewall-cmd by default, so when JasperServer / Apache Tomcat is in its default configuration, do this:

sudo firewall-cmd --zone=public --permanent --add-port=8080/tcp
sudo firewall-cmd --reload

Then it should be accessible from remote browser via http://
:8080/jasperserver
.

Enjoy.

streda 27. júna 2012

piatok 8. októbra 2010

How to install VMware Server on Ubuntu 10.04 LTS

This procedure works: https://help.ubuntu.com/community/VMware/Server

Maybe restart will be needed...

After successful installation, you can manage VMware server via http://localhost:8222.

sobota 19. júna 2010

Bulk rename of files in directory tree

I needed to remove parts of file-names with broken encoding from directory structure.

Example of the name with bad encoding:

Snímka000.jpg

Requested output example:

000.jpg

I used program find to dump directory tree chained with program rename to do bulk renaming via regular expressions. Here is how it looks like:

find . | rename 's/([^(\/Sn)]*)\/Sn([^0-9]*)([0-9]*\.jpg)$/$1\/$3/'

To check the results before proper execution, you can use flag "-n":

find . | rename -n 's/([^(\/Sn)]*)\/Sn([^0-9]*)([0-9]*\.jpg)$/$1\/$3/'

More info:

man rename
man find

By default, I will not analyze chained command here, but I will answer your questions, if case of need in place.

sobota 17. apríla 2010

How to fix gnome-settings-daemon crashing in Ubuntu 9.10 when connecting via FreeNX

The setup of the server: Ubuntu 9.10 64-bit, FreeNX server

The symptom: unable to switch between keyboard layouts, while connected via NX client - when right-clicking on keyboard indicator and choosing Keyboard Preferences, this error message raises:

Unable to start the settings manager 'gnome-settings-daemon'.
Without the GNOME settings manager running, some preferences may not take effect. This could indicate a problem with DBus, or a non-GNOME (e.g. KDE) settings manager may already be active and conflicting with the GNOME settings manager.


(No problem when logged in locally.)

When trying to start gnome-settings-daemon manually, error output is more detailed:

ostry@celsius:~$ gnome-settings-daemon
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
The program 'gnome-settings-daemon' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadRequest (invalid request code or no such operation)'.
(Details: serial 105 error_code 1 request_code 150 minor_code 8)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)


The solution:


start gconf-editor, then open / -> apps -> gnome_settings_daemon -> plugins -> xrandr in it and disable flag "active".

The conclusion:

There are many reports about this issue on the web, but I consider as important, to have this howto summarized here.

Enjoy!

sobota 9. januára 2010

Sending SMS from Linux via Symbian S60 3rd edition mobile handset connected via USB cable

Application gnokii is a multiple systems tool suite and (eventually) modem/fax driver for the mobile phones (see man gnokii).

You can use it for many things, depending on mobile phone model.

Mobile phones with operating system Symbian are supported with gnapplet application installed in phone. But Symbian S60 3rd edition phones are not supported by gnapplet. But you can use basic function using generic AT model.

Your ~/.gnokiirc file will seem like this:

[global]
port = /dev/ttyACM0
model = AT
connection = serial

/dev/ttyACM0 is symbolic device file for USB port. This can vary on your system, in general, it should be in /dev/ttyACMN or /dev/ttyUSBN, where N is non-zero integer. You can find out it by issuing this command in the shell: dmesg | grep tty.

Succesfull test of gnokii connection with the pohne can seem this way:

ostry@elitebook:~$ gnokii --identify
GNOKII Version 0.6.27
IMEI : PRIVATE
Manufacturer : Nokia
Model : Nokia E00
Product name : Nokia E00
Revision : V ICPR82_09w24

Finally, you can send SMS from command line (Linux shell):

echo "This is a test message" | gnokii --sendsms +PHONENUMBER -r

It works!