Asterisk Blacklist Hobby webbhotell


Add SSL-cert to Java keystore on Ubuntu

Filed under: Server,Ubuntu — Mathz @ 12:08

Download cert in Chrome on MAC

  1. Open a new TextEdit document.
  2. In TextEdit, click Format | Make Plain Text.
  3. Arrange windows so that the TextEdit window and the Chrome window are both visible.
  4. In Chrome, click the icon to the left of the URL in the address bar.
  5. In the dropdown list, click Certificate.
  6. Hold down Option and drag from the large certificate icon to the body of the TextEdit document. Note: If you did not follow the steps above in exactly the order stated, you may need to first single-click within the Chrome window so that TextEdit doesn’t become hidden when you Option-click.
  7. Save the TextEdit document with a .pem extension.

Import cert to keystore

sudo keytool -import -alias <hostname> -keystore /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/security/cacerts -file public.crt 

Default password for Java keystore is “changeit”.


Installing a root/CA Certificate on Ubuntu

Filed under: Ubuntu — Mathz @ 15:43

Given a CA certificate file foo.crt, follow these steps to install it on Ubuntu:

  1. Create a directory for extra CA certificates in /usr/share/ca-certificates:

    sudo mkdir /usr/share/ca-certificates/extra
  2. Copy the CA .crt file to this directory:

    sudo cp foo.crt /usr/share/ca-certificates/extra/foo.crt
  3. Let Ubuntu add the .crt file’s path relative to /usr/share/ca-certificates to /etc/ca-certificates.conf:

    sudo dpkg-reconfigure ca-certificates

    To do this non-interactively, run:

    sudo update-ca-certificates

In case of a .pem file on Ubuntu, it must first be converted to a .crt file:

openssl x509 -in foo.pem -inform PEM -out foo.crt


How do I run graphical programs remotely from a Linux server?

Filed under: Server,Ubuntu — Mathz @ 20:19

It is common for users of the Ubuntu Linux systems to want to run graphical applications (such as matlab, mathematica, eclipse, etc) on these Linux servers and display them on their local computers.  This document details the steps required to do this for Mac

Mac OS X

  1. Install XQuartz on your Mac, which is the official X server software for Mac
  2. Run Applications > Utilities >
  3. Right click on the XQuartz icon in the dock and select Applications > Terminal.  This should bring up a new xterm terminal windows.

  4. In this xterm windows, ssh into the linux system of your choice using the -X argument (secure X11 forwarding).  For example, to log into you would run something like:

         ssh -Y

  5. Once you are logged into the linux system, you can just run the GUI program of your choice (ie. matlab, mathematics, etc) and it will display on your Mac.


Ubuntu 18.04 root DNS update

Filed under: Server,Ubuntu — Mathz @ 00:09
Såg detta i min log fil  
checkhints: ( missing from hints 

Jag åtgärda det genom följande kommando

sudo wget --user=ftp --password=ftp -O /etc/bind/db.root


Tvinga en diskcheck vid nästa start av Linux

Filed under: Ubuntu — Mathz @ 19:47

touch /forcefsck

Detta är veriferat på Unbuntu 14.x och 16.x


MAC adress mapping in Ubuntu

Filed under: Ubuntu — Mathz @ 00:08



Control screen from CLI (crontab)

Filed under: Ubuntu — Mathz @ 16:05

export DISPLAY=:0.0

if [ $# -eq 0 ]; then
echo usage: $(basename $0) “on|off|status”
exit 1

if [ $1 = “off” ]; then
echo -en “Turning monitor off…”
xset dpms force off
echo -en “done.\nCheck:”
xset -q|grep “Monitor is”
elif [ $1 = “on” ]; then
echo -en “Turning monitor on…”
xset dpms force on
echo -en “done.\nCheck:”
xset -q|grep “Monitor is”
elif [ $1 = “status” ]; then
xset -q|sed -ne ‘s/^[ ]*Monitor is //p’
echo usage: $(basename $0) “on|off|status”


Ubuntu autostart Glassfish

Filed under: Glassfish,Ubuntu — Mathz @ 15:09

You need to set JAVA_HOME and add JAVA_HOME/bin to PATH

asadmin create-service


Autologin in Ubuntu

Filed under: Server,Ubuntu — Mathz @ 16:23

In file /etc/lightdm/lightdm.conf add following in section [SeatDefaults]:



Disable update-notifier in Ubuntu

Filed under: Ubuntu — Mathz @ 06:51

Prevent update-notifier from starting at login for all users

The above method works only on the user that is currently logged in. This is useful if you have a one-user workstation. But if you want to make a system-wide change, run:

sudo sed -i ‘s/X-GNOME-Autostart-Delay=60/X-GNOME-Autostart-enabled=false/’ /etc/xdg/autostart/update-notifier.desktop

Powered by WordPress