Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Fri Nov 24, 2017 6:51 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun Sep 24, 2017 9:58 am 
Offline
Newbie
User avatar

Joined: Tue Nov 01, 2016 1:17 pm
Posts: 42
after first login root.....
Code:
# passwd
# adduser you_ls_admin
# nano /etc/sudoers
you_ls_admin    ALL=(ALL:ALL) ALL
# nano /etc/ssh/sshd_config
  #PermitRootLogin yes
# nano /etc/hostname  #if need change hostname LS4XX
# nano /etc/hosts     #if need change hostname LS4XX

{fstab}
Code:
# mkdir -p /mnt/disk1 ; mkdir -p /mnt/disk2

# nano /etc/fstab

# /etc/fstab: static file system information.
#
# file system   mount point     type    options                         dump pass
/dev/sda2       /               ext4    defaults,errors=remount-ro      0    1
/dev/sda1       /boot           ext4    defaults                        0    2
/dev/sda5       none            swap    sw                              0    0
# /dev/sdb5       none            swap    sw                              0    0
/dev/sda6       /mnt/disk1      ext4    defaults                        0    2
# /dev/sdb6       /mnt/disk2      ext4    defaults                        0    2
proc            /proc           proc    defaults                        0    0
 
# reboot

login you_ls_admin
Code:
$ sudo apt update
$ sudo apt upgrade
$ sudo apt dist-upgrade
$ sudo apt-get install smartmontools hdparm evtest screen mc samba transmission-daemon ethtool nut hddtemp

{HDDTEMP}
Code:
$ sudo nano /etc/default/hddtemp
RUN_DAEMON="true"
DISKS="/dev/sd[a-b]"

{Toha vanilla kernel 4.13.3 lsmonitor}
Code:
$ wget https://github.com/tohenk/linkstation-mod/raw/master/lsmonitor/lsmonitor-unified.tar.gz --no-check-certificate
$ sudo tar -xvf lsmonitor-unified.tar.gz -C /
$ sudo nano /lib/ls/ls-functions
HDDTEMP0=36
HDDTEMP1=42
HDDTEMP2=50
 ***
 # run the fan at low speed while halting, just in case halt hangs the unit
  fan_speed set $SPEED_SLOW

$ sudo nano /lib/ls/ls-functions-vanilla
FAN_DIR=/sys/class/hwmon/hwmon1
  ***
SPEED_STOP=0
SPEED_SLOW=3250
SPEED_FAST=1500
SPEED_FULL=5000
$ sudo update-rc.d lsboot defaults
$ sudo update-rc.d lsmonitor defaults
$ sudo /etc/init.d/lsmonitor restart

{NUT}
Code:
$ sudo nano /etc/nut/nut.conf
MODE=standalone
$ sudo nano /etc/nut/ups.conf
[APC_BX650]
driver = usbhid-ups
port = auto
desc = "UPS host"
$ sudo upsdrvctl start
  if error in driver # sudo udevadm control --reload-rules
                     # sudo udevadm trigger
$ sudo upsdrvctl start
$ sudo nano /etc/nut/upsd.conf
ACL all 0.0.0.0/0
ACL localnet 192.168.0.0/24
ACL localhost 127.0.0.1/32
ACCEPT localhost localnet
REJECT all
$ sudo nano /etc/upsd.users
[admin]
password = admin_ups_password
allowfrom = localnet
upsmon master
actions = SET
instcmds = ALL
$ sudo nano /etc/nut/upsmon.conf
RUN_AS_USER nut
MONITOR APC_BX650@localhost 1 admin admin_ups_password master
MINSUPPLIES 1
POWERDOWNFLAG /etc/killpower
SHUTDOWNCMD "sbin/shutdown -Ph +0"
POLLFREQ 5
POLLFREQALERT 5
HOSTSYNC 15
DEADTIME 15
RBWARNTIME 43200
NOCOMMWARNTIME 300
FINALDELAY 5
$ sudo /etc/init.d/nut-server start
check - $ sudo upsc APC_BX650@127.0.0.1

{Twonky}
Code:
$ sudo mkdir /usr/local/twonky/ ; cd /usr/local/twonky/
$ sudo wget http://www.twonkyforum.com/downloads/8.4.1/twonky-armel-glibc-2.15-hf-8.4.1.zip
$ sudo unzip twonky-armel-glibc-2.15-hf-8.4.1.zip ; sudo rm twonky-armel-glibc-2.15-hf-8.4.1.zip
$ sudo chmod 700 twonkys* twonkyproxy cgi-bin/* plugins/*
$ sudo cp /usr/local/twonky/twonky.sh /etc/init.d/ ; sudo chmod +x /etc/init.d/twonky.sh
$ sudo /etc/init.d/twonky.sh start
$ sudo sed -i 's/httpport=/httpport=9050/g' /var/twonky/twonkyserver/twonkyserver.ini
$ sudo /etc/init.d/twonky.sh restart
$ sudo ln -s /etc/init.d/twonky.sh /etc/rc0.d/K01twonky.sh ; sudo ln -s /etc/init.d/twonky.sh /etc/rc1.d/K01twonky.sh ; sudo ln -s /etc/init.d/twonky.sh /etc/rc6.d/K01twonky.sh
$ sudo ln -s /etc/init.d/twonky.sh /etc/rc2.d/S01twonky.sh ; sudo ln -s /etc/init.d/twonky.sh /etc/rc3.d/S01twonky.sh ; sudo ln -s /etc/init.d/twonky.sh /etc/rc4.d/S01twonky.sh ; sudo ln -s /etc/init.d/twonky.sh /etc/rc5.d/S01twonky.sh

{samba}
Code:
$ sudo mkdir -p /mnt/disk1/backup ; sudo mkdir -p /mnt/disk1/directcopy ; sudo mkdir -p /mnt/disk1/transmission ; sudo mkdir -p /mnt/disk1/share
$ sudo smbpasswd -a you_ls_admin
$ sudo nano /etc/security/limits.conf
*      -   nofile      16384
$ sudo mv /etc/samba/smb.conf /etc/samba/smb.conf_default
$ sudo nano /etc/samba/smb.conf
[global]
  security = user
  map to guest = Bad User
  workgroup = WORKGROUP
  netbios name = LS4XX
# min protocol = SMB2

# shares
[backup]
  path = /mnt/disk1/backup
  valid users = you_ls_admin
  read only = no
  browseable = no

[directcopy]
  path = /mnt/disk1/directcopy
  guest ok = yes
  force user = nobody

[transmission]
  path = /mnt/disk1/transmission
  valid users = you_ls_admin
  read only = no

[share]
  path = /mnt/disk1/share
  guest ok = yes
  read only = no

{Transmission-daemon}
Code:
$ sudo /etc/init.d/transmission-daemon stop
$ sudo nano /etc/transmission-daemon/settings.jsonĀ 
  "download-dir": "/mnt/disk1/transmission/downloads",
  "encryption": 1,
  "incomplete-dir": "/mnt/disk1/transmission/downloads/incomplete",
  "incomplete-dir-enabled": true,
  "peer-port": 6881,
  "port-forwarding-enabled": true,
  "rpc-password": "your_password_account_transmission",
  "rpc-port": 9091,
  "rpc-username": "your_account",
  "rpc-whitelist-enabled": false,
  "watch-dir": "/mnt/disk1/transmission/downloads/upload_torrents",
  "watch-dir-enabled": true

$ sudo usermod -a -G debian-transmission you_ls_admin
$ sudo chown -R debian-transmission:debian-transmission /mnt/disk1/transmission/
$ sudo chmod -R 770 /mnt/disk1/transmission/
$ sudo crontab -e
*/1 * * * * chmod -R 770 /mnt/disk1/transmission/
$ sudo /etc/init.d/transmission-daemon start

{locales, time, etc}
Code:
$ sudo dpkg-reconfigure locales                   
$ sudo apt-get install console-setup
$ sudo dpkg-reconfigure console-setup         
$ sudo dpkg-reconfigure tzdata

{netdata}
Code:
$ sudo apt-get install git zlib1g-dev uuid-dev libmnl-dev gcc make autoconf autoconf-archive autogen automake pkg-config curl
$ sudo apt-get install python python-yaml python-mysqldb python-psycopg2 nodejs lm-sensors netcat
$ sudo git clone https://github.com/firehol/netdata.git --depth=1 ~/netdata
$ cd ~/netdata ; sudo ./netdata-installer.sh
$ sudo nano /etc/rc.local
echo 1 > /sys/kernel/mm/ksm/run
echo 1000 > /sys/kernel/mm/ksm/sleep_millisecs
exit 0
$ sudo reboot


netdata by default listens on all IPs on port 19999,
so you can access it with:

http://this.machine.ip:19999/

To stop netdata run:

systemctl stop netdata

To start netdata run:

systemctl start netdata

It will be installed at these locations:

- the daemon at /usr/sbin/netdata
- config files in /etc/netdata
- web files in /usr/share/netdata
- plugins in /usr/libexec/netdata
- cache files in /var/cache/netdata
- db files in /var/lib/netdata
- log files in /var/log/netdata
- pid file at /var/run/netdata.pid
- logrotate file at /etc/logrotate.d/netdata

Uninstall script generated: ./netdata-uninstaller.sh
Update script generated : ./netdata-updater.sh #way /home/[user]/netdata/netdata-updater.sh

{disable ipv6}
Code:
$ sudo echo net.ipv6.conf.all.disable_ipv6=1 | sudo tee -a /etc/sysctl.d/local.conf
$ sudo reboot

{owncloud}
Code:
$ sudo apt-get install apache2 mariadb-server libapache2-mod-php
$ sudo apt-get install php-gd php-json php-mysql php-curl php-zip php-xml php-mbstring php-ldap
$ sudo apt-get install php-intl php-mcrypt php-imagick
$ sudo wget -nv https://download.owncloud.org/download/repositories/10.0/Debian_9.0/Release.key -O Release.key
$ sudo apt-key add - < Release.key
$ sudo nano /etc/apt/sources.list.d/owncloud.list
deb http://download.owncloud.org/download/repositories/10.0/Debian_9.0/ /
$ sudo apt-get update
$ sudo apt-get install owncloud-files
$ sudo mv /var/www/owncloud/ /mnt/disk1/owncloud/
$ sudo chown -R www-data:www-data /mnt/disk1/owncloud
$ sudo chmod -R 755 /mnt/disk1/owncloud
$ sudo nano /etc/apache2/sites-available/owncloud.conf
Alias /owncloud "/mnt/disk1/owncloud/"
<Directory /mnt/disk1/owncloud/>
   Options +FollowSymlinks
   AllowOverride All
   Satisfy Any
<IfModule mod_dav.c>
   Dav off
</IfModule>
   SetEnv HOME /mnt/disk1/owncloud
   SetEnv HTTP_HOME /mnt/disk1/owncloud
</Directory>
$ sudo ln -s /etc/apache2/sites-available/owncloud.conf /etc/apache2/sites-enabled/owncloud.conf
$ sudo a2enmod rewrite
$ sudo a2enmod headers env dir mime
$ sudo nano /etc/php/7.0/apache2/php.ini
;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;
upload_max_filesize = 100G
post_max_filesize = 100G
$ sudo service apache2 restart
$ sudo a2enmod ssl
$ sudo a2ensite default-ssl
$ sudo mkdir /etc/apache2/ssl
$ sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/apache2/ssl/owncloud.key -out /etc/apache2/ssl/owncloud.crt
$ sudo systemctl reload apache2
$ sudo mysql_secure_installation
Set root password? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
$ sudo mysql -u root -p
mysql> CREATE DATABASE owncloud;
mysql> GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY 'YOUR_password';
mysql> FLUSH PRIVILEGES;
mysql> quit
$ sudo service apache2 restart

go to http://ip-server/owncloud

create admin account
settings base
pathbase /mnt/disk1/owncloud/data

owncloud
YOUR_password
owncloud
localhost

$ sudo apt install fail2ban
$ sudo nano /etc/fail2ban/filter.d/owncloud.conf
[Definition]
failregex={"reqId":".*","remoteAddr":"<HOST>","app":"core","message":"Login failed:.*","level":2,"time":".*"}
$ sudo nano /etc/fail2ban/jail.d/owncloud.conf
[owncloud]
enabled = true
filter = owncloud
port = https
bantime = 21600
findtime = 3600
maxretry = 3
logpath = /mnt/disk1/owncloud/data/owncloud.log
$ sudo service fail2ban restart
$ sudo apt install php-memcached memcached
$ sudo nano /mnt/disk1/owncloud/config/config.php
 #add next lines between 'installed' => true, AND );
 
  'memcache.distributed' => '\OC\Memcache\Memcached',
  'memcache.local' => '\OC\Memcache\Memcached',
  'memcached_servers' => array(
      array('localhost', 11211),
   ),
  'memcached_options' => array(
        \Memcached::OPT_CONNECT_TIMEOUT => 50,
        \Memcached::OPT_RETRY_TIMEOUT =>   50,
        \Memcached::OPT_SEND_TIMEOUT =>    50,
        \Memcached::OPT_RECV_TIMEOUT =>    50,
        \Memcached::OPT_POLL_TIMEOUT =>    50,
        // Enable compression
        \Memcached::OPT_COMPRESSION =>          true,
        // Turn on consistent hashing
        \Memcached::OPT_LIBKETAMA_COMPATIBLE => true,
        // Enable Binary Protocol
        \Memcached::OPT_BINARY_PROTOCOL =>      true,
   ),
$ sudo service apache2 restart
if no error
$ sudo reboot


NetData


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited