Skip to content

Sign vboxdrv for VirtualBox when using Secure Boot

Sign vboxdrv for VirtualBox when using Secure Boot published on

Sign vboxdrv so Secure Boot has no problem with it. (Source AskUbuntu)
Short version:

sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ~/.ssh/MOK.priv .ssh/MOK.der $(modinfo -n vboxdrv)

To create the keys MOK.priv and MOK.der, this steps are required:

# create key pair
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=Signing Key for Secure Boot/"

# use mokutil to test, if the key is enrolled (should not, if you just created it)
mokutil --test-key .ssh/MOK.der

# import key
sudo mokutil --import .ssh/MOK.der

# sign vboxdrv
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 .ssh/MOK.priv .ssh/MOK.der $(modinfo -n vboxdrv)

# check vboxdrv and activate
sudo modinfo -n vboxdrv
sudo modprobe vboxdrv

Linux Mint 19 Tara: Group Task List Windows

Linux Mint 19 Tara: Group Task List Windows published on

If you have a lot of open windows, then the task list could run out of space. The grouping of the windows is a good feature to don't loose the overview.
This is what I mean with "grouping":
grouped window

There is a good Applet called Icing Task Manager. Install steps:

  1. Open Applets via System Settings
  2. Go to Download and search and install Icing Task Manager
  3. At tab Manage activate Icing Task Manager and open its settings
  4. In tab Panel change Title display to "Title" (or "App"). Otherwise only the icon is displayed and you can't tell them apart from the panel launchers.
  5. Now you have to remove the old Window list.
    1. Right click on the taskbar, chose "Panel edit mode"
    2. Right click on the old Window list and choose "remove Window list"
  6. have fun

find by date and tar them

find by date and tar them published on No Comments on find by date and tar them

If you have a big log folder and you want to tar the newest log files in to one tar.gz file, then you can use the following:

find /opt/tomcat/logs/ -type f -newermt 2013-06-09 | tar cvzf testfind.tar.gz -T - --null

I do not know the meaning of -T - --null, but it works.

 

Perhaps your find version is to old for the newermt statement. With find version 4.2.27 it did not work. Then you could use -mtime, for modification time.
mtime is the number * 24 h, do find all files older newer then one day, you can use:

find /opt/tomcat/logs/ -type f -mtime 1

+1 would mean older than one day

Upgrade PostgreSQL Database from 9.4 to 9.6 on openSUSE

Upgrade PostgreSQL Database from 9.4 to 9.6 on openSUSE published on No Comments on Upgrade PostgreSQL Database from 9.4 to 9.6 on openSUSE

This tutorial shows how to upgrade PostgreSQL from 9.4 (openSUSE 42.2) to 9.6 (openSUSE 42.3)

  1. Stop postgresql and disable service
    systemctl stop postgresql.service
    systemctl disable postgresql.service
  2. Install PostgreSQL 9.6 (9.4 should still be installed after the update)
    zypper -n install postgresql96 postgresql96-server postgresql96-contrib
  3. Move current cluster and create new data dir with user postgres
    mv /var/lib/pgsql/data/ /var/lib/pgsql/data94/
    su postgres -c "mkdir /var/lib/pgsql/data"
    
  4. Enable service, start it to create new database cluster at data folder, and stop service again to prepare the following upgrade
    systemctl enable postgresql.service
    systemctl start postgresql.service
    systemctl stop postgresql.service
  5. Run pg_upgrade where -b is old bin dir, -B is new bin dir, -d is old data dir, and -D new data dir. This must run as user postgres ( su - postgres )
    su - postgres -c "pg_upgrade -b /usr/lib/postgresql94/bin/ -B /usr/lib/postgresql96/bin/ -d /var/lib/pgsql/data94/ -D /var/lib/pgsql/data"
  6. Copy the pg_hba.conf from old data dir to the new one (if you changed something at postgresql.conf you could copy that to the new data folder too). After that, start the postgresql service.
    cp /var/lib/pgsql/data94/pg_hba.conf /var/lib/pgsql/data
    systemctl start postgresql.service
  7. Try to login to postgresql, Version 9.6.x should be printed, leave with \q
     # psql -U postgres
    psql (9.6.4)
    Type "help" for help.
    
    postgres=# \q
  8. If you don't need the old cluster data, run this:
    /var/lib/pgsql/delete_old_cluster.sh

Syntax Highlighting for NGINGX on Vim

Syntax Highlighting for NGINGX on Vim published on No Comments on Syntax Highlighting for NGINGX on Vim

nginx.conf for Vim

https://gist.github.com/2called-chaos/5073996

#!/bin/sh
mkdir -p ~/.vim/syntax/
cd ~/.vim/syntax/
wget http://www.vim.org/scripts/download_script.php?src_id=19394
mv download_script.php\?src_id\=19394 nginx.vim
cat > ~/.vim/filetype.vim << EOF
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif
EOF
Categories