to mount
udisksctl mount --block-device /dev/disk/by-label/<DISK LABEL>
to unmount
udisksctl unmount --block-device /dev/disk/by-label/<DISK LABEL>
to mount
udisksctl mount --block-device /dev/disk/by-label/<DISK LABEL>
to unmount
udisksctl unmount --block-device /dev/disk/by-label/<DISK LABEL>
git tag -a 1.0 -m 'the initial release'
git push origin --tags
— REMOVE TAG —
git tag -d 1.0
git push origin :refs/tags/1.0
script set-touchpad
#!/bin/bash CMD="gxmessage -borderless -ontop -title Information -center -timeout 3 " PSMOUSE=`lsmod grep psmouse` # detect if is superuser if [[ $EUID -ne 0 ]] then echo -e "This script must be run as rootn" exit 1 fi if [ "$PSMOUSE" == "" ] then # enable touchpad modprobe psmouse $CMD -fn "sans 30" Touchpad ENABLED else # disable touchpad modprobe -r psmouse $CMD -fn "sans 30" Touchpad DISABLED fi
add to sudoers command /usr/local/bin/set-touchpad
add a shortcut keyboard to sudo /usr/local/bin/set-touchpad using Ctrl+Fn+F9
—
sudo gedit /etc/default/grub
find the line starting with GRUB_CMDLINE_LINUX_DEFAULT
add “acpi_osi=” to the options
sudo update-grub2
reboot
mount network folders
1. detect if in /etc/mtab file isn’t present already gvfsd-fuse mount point for this user, in case remove it
2. create new gvfsd-fuse mount point:
$ fusermount -zu ~/.gvfs
$ /usr/libexec/gvfsd-fuse ~/.gvfs -o big_writes
3. create folder
# mkdir ~/.gvfs
4. create keyring password
$ secret-tool store --label="armando@192.168.0.10" user armando domain MGAGROUP server 192.168.0.10 protocol smb schema org.gnome.keyring.NetworkPassword
5. create mount script mount_action in /usr/local/bin
#! /bin/bash
gvfs-mount smb://armando@192.168.0.10/share
6. set executable permission
# chmod 775 /usr/local/bin/mount_action
7. add mount_action to autostart file (if openbox) or list of application to start at login (in other windows manager)
will be created a folder
~/.gvfs/smb-share:server=<server_name>,share=<share_name>
in my case:
~/.gvfs/smb-share:server=192.168.0.10,share=share
8. create a symlink to mounted folder
$ ln -s ~/.gvfs/smb-share:server=192.168.0.10,share=share ~/server_share
added to /usr/bin/monodevelop script this row before mono command:
unset GNOME_DESKTOP_SESSION_ID
$ screen -d -m <myscript>
$ screen -d -m unrar e -p<password> <rar file>
as root can use:
$ DISPLAY=:0 import -window root /tmp/shot.png
or can use:
$ DISPLAY=:0 scrot '/tmp/%Y-%m-%d_$wx$h_scrot.png'
set owner and group
$ chown -R <user>:<group> <folder_path>
change permissions
$ chmod -R 775 <folder_path>
$ chmod 664 $(find <folder_path> ! -type d)
or using
$ find /mnt/share ! -type d -exec chmod 664 {} \;
#! /bin/sh # chkconfig: 345 35 65 # description: VirtualBox virtual machines manager # ### BEGIN INIT INFO # Provides: startvm # Required-Start: vboxdrv # Required-Stop: vboxdrv # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Description: VirtualBox virtual machines manager ### END INIT INFO PATH=$PATH:/bin:/sbin:/usr/sbin # Source function library. . /etc/init.d/functions # user to use to start VirtualBox VMUSER=armando # virtual machines to manage VMS=( "CentOS 7" ) case "$1" in start) echo "Starting VirtualBox VM ..." for VM in "${VMS[@]}" do sudo -u $VMUSER VBoxManage startvm "$VM" --type headless >> /var/log/startvm.log 2>&1 done success ;; stop) echo "Saving state of VirtualBox VM ..." for VM in "${VMS[@]}" do sudo -u $VMUSER VBoxManage controlvm "$VM" savestate >> /var/log/startvm.log 2>&1 done success ;; *) echo "Usage: /etc/init.d/startvm {startstop}" exit 1 ;; esac exit 0
remember to modify in file /etc/sudoers row
Defaults requiretty
to
#Defaults requiretty
a more recent approach stay here https://ubuntuforums.org/showthread.php?t=2387221
Comandi utili per la gestione
Di seguito vediamo i principali comandi che ci permettono di gestire la/le VM installate sul nostro server. Innanzitutto possiamo ottenere l’elenco di quelle registrate:
$ VBoxManage list vms
Se volessimo la lista delle macchine virtuali attive:
$ VBoxManage list runningvms
Per visualizzare le caratteristiche di una specifica macchina:
$ VBoxManage showvminfo "winxp"
Per fermare la VM “staccando il cavo di alimentazione”:
$ VBoxManage controlvm "winxp" poweroff
per una chiusura del sistema controllata:
$ VBoxManage controlvm "winxp" acpipowerbutton
per farlo invece salvando lo stato su disco:
$ VBoxManage controlvm "winxp" savestate
per resettarla:
$ VBoxManage controlvm "winxp" reset
per metterla in pausa e risvegliarla:
$ VBoxManage controlvm "winxp" pause
$ VBoxManage controlvm "winxp" resume
per avviare la macchina virtuale senza GUI (il carattere ‘&’ finale fa in modo che il processo lanciato sia svincolato dalla console in uso)
$ VBoxHeadless --startvm <mach name> --vrde on --vrdeproperty TCP/Ports=<listen port> &
per avviare un client remote desktop
$ rdesktop -T <window title> -k it -g 1024x768 -a 16 localhost:<listen port>
-k = keyboard layout
-g = geometria
-a = profondità del colore