If $dir is a mount point this if statement will determine is (Not tested) if [ `stat -fc%t:%T “$dir”` != `stat -fc%t:%T “$dir/..”` ]; then echo “$dir is mounted” else echo “$dir is not mounted” fi
Archive for the ‘linux’ Category
inspect result of installing .deb file
By thomas in deb, linuxWhat files is installed on the system and where when running a .deb file either by software-center or dpkg -i .deb? find out by running: dpkg-build –contents .deb This doesnt install the package but let you inspect what will happen is you install
Tags: deb, dpkg-build
ubuntu 12.04 enable hibernation
By thomas in linux, ubuntu, Ubuntu 12.04Following this worked: http://askubuntu.com/questions/94754/how-to-enable-hibernation-in-12-04 create/edit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla with: sudo gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla and insert [Re-enable hibernate by default] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes
Ubunt 12.04 login screen reappears after messing with xorg.conf
By thomas in linux, ubuntu, Ubuntu 12.04, XserverAfter messing with Xorg.conf I could no longer login on my usual account. The guest account however still was able to login and I could login through terminals (Alt – Ctrl – F1). The problem got fixed when I deleted: ~/.Xauthority and rebooted
prevent script/command from terminating when user logs out
By thomas in linuxTo prevent script or command from terminating when user logs out use nohup COMMAND output is directed to nohup.out in home directory
monitor network in terminal/shell
By thomas in linuxthe utility iftop seems to be doing a pretty good job monitoring network trafic
using rsync to copy files
By thomas in linux, rsyncrsync options to get rsync to report progress: –verbose –progress –stats if copying over network use compression and secure transfer: –compress –rsh=/usr/bin/ssh tell rsync to copy recursively: –recursive keep file timestampts: –times keep permissions: –perms copy symbolic links: –links instruct rsync to delete files on the remote location that isn’t present on the source: –delete […]
Tags: rsync
monitor system events on ubuntu
By thomas in linux, ubuntuto monitor system events such as connecting/disconnecting usb devices do tail -f /var/log/syslog
rsync to copy home directory
By thomas in linuxsudo rsync -ah –exclude-from=/home/thomas/rsyncExcludeFile /home/ /home2/ tailing / are important the /home/thomas/rsyncExcludeFile file is a file containing directories and files not to sync such as Music
Tags: rsync
problems with checkinstall
By thomas in checkinstall, linuxusing check install to properly install from source When installing ImageMagick-6.7.5-7 checkinstall failed with an error related to “mkdir -p” It seems that this error disappeared when running checkinstall with -fstrans=no so after calling ./configure and make I called sudo checkinstall -fstrans=no and everything seem to be correct