mathz.nu Asterisk Blacklist Hobby webbhotell

2021/03/15

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”.

2020/07/17

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

2019/08/01

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 > XQuartz.app
  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 hulk.soic.indiana.edu you would run something like:

         ssh -Y username@my.linux.host

  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.

2019/07/03

Ubuntu 18.04 root DNS update

Filed under: Server,Ubuntu — Mathz @ 00:09
Såg detta i min log fil  
checkhints: b.root-servers.net/A (199.9.14.201) missing from hints 

Jag åtgärda det genom följande kommando

sudo wget --user=ftp --password=ftp ftp://ftp.rs.internic.net/domain/db.cache -O /etc/bind/db.root

2017/11/16

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

2016/11/07

MAC adress mapping in Ubuntu

Filed under: Ubuntu — Mathz @ 00:08

/etc/udev/rules.d/70-persistent-net.rules

2016/02/23

Control screen from CLI (crontab)

Filed under: Ubuntu — Mathz @ 16:05


#!/bin/bash
export DISPLAY=:0.0

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

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’
else
echo usage: $(basename $0) “on|off|status”
fi

2015/07/11

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

2013/11/28

Autologin in Ubuntu

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

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

autologin-user-timeout=0
autologin-user=

2013/11/20

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