A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Showing posts with label mount. Show all posts
Showing posts with label mount. Show all posts

Sublime text editor tricks

Sublime is not a bad text editor for Linux:

Mount a remote directory:  sshfs username@hostname:/remote/path /local/path

Put a vertical line after 80 characters: Preferences > Settings - User > ... add an entry: "rulers": [80]

Change syntax highlighting colours: Preferences > Browse Packages > Color Scheme - Default > ... edit the Color Scheme file you are using.

{
"color_scheme": "Packages/Color Scheme - Default/All Hallow's Eve.tmTheme",
"font_size": 10,
    "rulers": [80],
    "auto_complete": false
}


Shortcuts:

  • Shift-F11 = Enter "concentration" mode AKA "distraction free" mode

sshfs on linux

  • sshfs -o uid=1000 -o gid=1000 example.com:/workplace /workplace
Where 1000 is your user and group ID from /etc/passwd

That's it!

Mount a directory using Samba

mount -t smbfs //host/subdir hostname -o username=yourusername,fmask=555,dmask=555,ro 
 
Don't use Samba though, use SSHFS.

mount a directory from another host

in /etc/fstab:
//example.com/inetpub2 /nolmcs02/inetpub smbfs credentials=/root/nolmcs2-auth.txt,domain=NATIONAL,uid=noladmin,gid=noladmin,directio,hard 0 0

where /root/nolmcs2-auth.txt (or whatever you name it) is a file containing the username and password to use:

[root@nolappsdc01 ~]# cat /root/nolmcs2-auth.txt
username=
password=

You can mount this manually to test using:

mount -t smbfs //example.com/inetpub2 /nolmcs02/inetpub2 -o credentials=/root/nolmcs2-auth.txt,domain=NATIONAL,uid=noladmin,gid=noladmin,directio,hard

The credentials file is used so it will work on restart automatically. Instead of credentials=, you can use username=, etc. temporarily.