bugged.be

"Think outside the [B0X]"
Icon
Welcome to my little corner on the internet where you can find some information about me and my personal notes regarding my work. It contains some useful tips, stupidy I came across and ofcourse bad documented annoyances, yes life of a developer is filled with surprises ;).
Feel free to browse around and enjoy your staying.




Install tight vnc server

1a. Install desktop environment and vnc server

sudo apt install xfce4 xfce4-goodies tightvncserver

1b. start the server

vncserver

Set passwords for user and view only user.

2. Configure the server
2a. exit the server

vncserver -kill :1

2b. Backup original xstartup file

mv ~/.vnc/xstartup ~/.vnc/xstartup.bak

2c. Create new xstartup

nano ~/.vnc/xstartup

with following content:

#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &

2d. Make it executable

sudo chmod +x ~/.vnc/xstartup

2e. Start the server

vncserver

3. Connect to vnc server
3a. Create a secure connection from desktop to server
Run on desktop:

ssh -L 5901:127.0.0.1:5901 -N -f -l

3b. Use vnc client and connect to:

localhost:5901

4. Run vnc server on boot
4a. Create the user vnc should run with.

sudo adduser

4b. Copy vnc server configuration to this user

sudo cp /root/.vnc/*.* /home//.vnc/.

4c. Change files owner

sudo chown *
# normally the user group is the same as the user name.
sudo chgrp *

4d. Create a startup file.

#!/bin/sh -e
### BEGIN INIT INFO
# Provides: vncserver
# Required-Start: networking
# Required-Stop: networking
# Default-Start: S
# Default-Stop: 0 6
### END INIT INFO</code>

PATH="$PATH:/usr/X11R6/bin/"

# The Username:Group that will run VNC
export USER="new username"
#${RUNAS}

# The display that VNC will use
DISPLAY="1"

# Color depth (between 8 and 32)
DEPTH="16"

# The Desktop geometry to use.
#GEOMETRY="x"
#GEOMETRY="800x600"
#GEOMETRY="1024x768"
GEOMETRY="1280x1024"

# The name that the VNC Desktop will have.
NAME="new-vnc-server"

OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"

. /lib/lsb/init-functions

case "$1" in
start)
log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
;;

stop)
log_action_begin_msg "Stoping vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
;;

restart)
$0 stop
$0 start
;;
esac

exit 0

5 Restart the server …
Check if the server is running:

ps -ef | grep vnc

If not running, check the logs with:

systemctl status vncserver.service

Launch shell ui with root

Edit the application.desktop file. Change this line from:

Exec=/opt/atom/atom %F

to

Exec=gksudo -k -u root /opt/atom/atom %F

Desktop files are usually located in:

/usr/share/applications/*.desktop

“Quick” compare directory contents

1. Create md5 hash for all files and both directories:


md5deep -r -l aDirectory/* > md5.txt

2. Sort both  files:


sort md5.txt > md5_sorted.txt

3. Compare both files:


diff md5_sorted1.txt md5_sorted2.txt

 

Virtualbox connection error

When rdp fails to connect to virtualbox, after installing the extension pack.

Check in virtualbox preference -> extensions
Most likely 2 packs are installed:

  • VNC
  • Oracle VM VirtualBox Extension Pack

run command below to set the correct extension pack for rdp:

VBoxManage setproperty vrdeextpack "Oracle VM VirtualBox Extension Pack"

Fix eclipse (kepler) ui in linux (mint)

Eclipse looks horrible in Linux.
Apply steps below to make it more appealing … Read the rest of this entry »

install java 8

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Atmega 328p install bootloader with UsbAsp

Quick and easy steps to burn a bootloader

Read the rest of this entry »

Fix printing error HP

Error occures when printing:

ERROR:
invalidaccess
OFFENDING COMMAND:
filter
STACK:
/SubFileDecode
endstream

To fix, run:

sudo lpadmin -p <printerName> -o pdftops-renderer-default=pdftops

replace as exactly shown in printers folder/settings.

Ref.: https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/998087

Enable beep

Beep has been blacklisted by Ubuntu since …
to restore beep, edit /etc/modprobe.d/blacklist.conf and remove or put it in comment the following line:

blacklist pcspkr

Headless ubuntu server cd player/ripper

Goal

Create a headless device to rip and play cds.

Read the rest of this entry »

Login

Calendar

May 2017
M T W T F S S
« Oct    
1234567
891011121314
15161718192021
22232425262728
293031  

Archives