2015年12月20日 星期日

[How to] Setup Samba in Linux

Let see my setup environment:

Server:
- Arch Linux  4.2.5-1-ARCH
- samba Version 4.3.3

Client:
Same as server

Network Setup:
Internet - Server(192.168.1) - Router(192.168.2) - Clients

= = =
Setup procedure:
1. Installation: (For both server and client)

#pacman -Syu samba

2. Setup config

I have made a config file to share the server /tmp folder and allow only me and home subnet only.

= = =
[global]
   workgroup = WORKGROUP
   server string = Samba Server
   hosts allow = 192.168.1. 127.
   printcap name = /etc/printcap
   load printers = yes
   log file = /var/log/samba/%m.log
   max log size = 50
   security = user
   dns proxy = no
   invalid users = nobody root
   map to guest = Bad User
   max connections = 10
[homes]
   comment = Home Directories
   browseable = no
   writable = yes
[tmp]
   comment = Temporary file space
   path = /tmp
   valid users = your_user
   public = no
   writable = yes

= = =

Configure your user to samba, and enter the user password.
#pdbedit -a -u your_user

3. Run

In server:
#systemctl enable smbd.service

If you also need netbios support:
#systemctl enable nmbd.service 

Server side should be more or less ready and change to Client

Client:

Just test the samba connection to the server

user@localhost:~$ smbclient -L 192.168.1.1 -U your_user
smbclient: Can't load /etc/samba/smb.conf - run testparm to debug it
Enter your_user's password:
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.3.3]

        Sharename       Type      Comment
        ---------       ----      -------
        tmp             Disk      Temporary file space
        IPC$            IPC       IPC Service (Samba Server)
        your_user       Disk      Home Directories
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.3.3]

        Server               Comment
        ---------            -------
        LOCALHOST            Samba Server

        Workgroup            Master
        ---------            -------
        WORKGROUP            LOCALHOST



If you see similar output, the connection should be ready and you can mount remote samba drive

#mount -t cifs //LOCALHOST/tmp /mnt -o user=your_user,workgroup=WORKGROUP,ip=192.168.1.1
password:


Nice and Done!!

2015年12月16日 星期三

[How To] Fix Tearing on Linux Intel Graphics

#cat /etc/X11/xorg.conf.d/20-intel.conf

Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"

   Option      "TearFree"    "true"
EndSection


Works well on my arch linux machine. No tearing now in watching One Punch Man~ Cheers

2015年12月15日 星期二

rsync - a simple backup command

If you want to backup something just use the following command

$rsync -au /source/path/* /dest/path/folder 

In case after some days your source path have new files or some changes, just recall the command and it can simply update the destination folder to sync everything.