Category: Miscellaneous

How to mount samba share on linux using fstab 0

How to mount samba share on linux using fstab

# Debian/Ubuntu
apt-get install smbfs smbclient
# Fedora/Redhat
yum install smbfs samba-client #If not found try smbclient

mkdir /mnt/dirname
//fileserver/sharename /mnt/dirname smbfs username=root,password=mypass 0 0

NOTES:

How to find shares on a remote linux PC

smbclient -L jumbo -Uusername -I ip-address

How to manually mount fstab

mount -a

 

How to share a folder in linux using samba 0

How to share a folder in linux using samba

sudo nano -w /etc/samba/smb.conf

Use template that comes built in orr add to file

[mysharename]
    comment = Public Share
    path = /home/mysharepath
    browseable = yes
    read only = no
    create mask = 0644
    directory mask = 0755

And finally

# if on ubuntu/debian
service samba restart
# or if on other linux distros
/etc/init.d/samba restart

via Samba/SambaServerGuide – Community Ubuntu Documentation.

How to mount a remote directory in Linux using sshfs 0

How to mount a remote directory in Linux using sshfs

Step1: Installing Package

On Ubuntu/Debain

apt-get install build-essential libcurl4-openssl-dev libxml2-dev libfuse-dev comerr-dev libfuse2 libidn11-dev libkadm55 libkrb5-dev libldap2-dev libselinux1-dev libsepol1-dev pkg-config fuse-utils sshfs

If you get any errors just remove the package that gave the error. In my case I had to remove  libkadm55.

Step2: Once the packages are installed we have to create a mount point and mount our  server data using sshfs command, for which we require  username/password. Here are my details for this task. (more…)

How to upload sql files from shell/bash 0

How to upload sql files from shell/bash

Importing the SQL file another way

If you have a Unix/Linux server and have SSH access to it then you can use the `mysql’ command line program to import the file like so:

mysql -u myuser -p mydatabase < myfile.sql

This will prompt you for the password for `myuser’ and then import the SQL from myfile.sql. Obviously you will need to have uploaded myfile.sql through FTP or similar. Ideally you would compress myfile.sql, upload it, uncompress it and then import using the command above.

via Overcoming file size limits when uploading SQL files to phpMyAdmin – Interspire Knowledge Base.

How to set static ip on ubuntu 0

How to set static ip on ubuntu

vim /etc/network/interfaces

dynamic:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

Static:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.1.2
        netmask 255.255.255.0
        gateway 192.168.1.1
        dns-nameservers 8.8.8.8 8.8.4.4