Tag Archives: synology - Page 2

Updated Timemachine guidelines

If you are one of the many users who have followed my guidelines “OS X: Time Machine backup to Synology DS107+“, I strongly urge you to revisit the article.

A number of users reported some issues which require your attention:

  • If your backups are larger than 250 gigabytes, there are issues with regards to the size and the number of bands being used in the sparsebundles. To fix this, you can either convert your current sparsebundle or start a new one. You are not affected if your sparsebundles are smaller.
  • Some people reported issues with mounting the images over AFP. I could verify this as well and found that mounting the images via SMB was more reliable. I am uncertain if this is related to OS X 10.5.6 or the firmware on the DiskStation.

Continue reading “Updated Timemachine guidelines” »



VN:F [1.9.17_1161]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.17_1161]
Rating: +1 (from 1 vote)

Squid: Restrict access to websites

If you have followed my guidelines on how to install Squid, you might have noticed that the assumption was, that your home-user base would not abuse the net.

You add a ten-year old on school-holidays and YouTube to the mix and you will realise that spending 2GB on Youtube in a few hours is nothing …. eeek.

I needed a quick fix, without denying the young padawan access to the internet. After some research, I found that I could implement access-controls on a source-IP basis via Squid resulting in the following page:

The implementation is really simple and sufficient for my means – read the details after the jump.
Continue reading “Squid: Restrict access to websites” »



VN:F [1.9.17_1161]
Rating: 8.0/10 (1 vote cast)
VN:F [1.9.17_1161]
Rating: +1 (from 1 vote)

OS X: Time Machine backup

My article OSX Time Machine backup to Synology DS107+ has been really popular over the last few months.

The comments on the posting alone should provide a feel of how well this worked for most of the OSX users. I have received numerous confirmations from happy Mac-users who managed to get their TimeMachine to co-operate with a number of different NAS’s (QNAP, Linksys, Synology) as well as your standard run-of-the-mill Linux servers.

As a one-time special and limited to 2,000 downloads only, I have provided a “super-pretty” version of my instructions as donation-ware:

If you feel that this website and it’s articles have added value to your life, click on the link below and show your token of appreciation and you will be equally rewarded with a 3-page manual on how to get the TimeMachine going. (Well, you can find the same information in the link above – that’s why it’s called donation).

There is also a motive behind this: I will very soon publish *** FOR FREE **** on how you can get your own integration with Paypal going and this is the best way of testing the app and at the same time buy me a beer or two :-)

 

 

 

VN:F [1.9.17_1161]
Rating: 7.0/10 (1 vote cast)
VN:F [1.9.17_1161]
Rating: +1 (from 1 vote)

PS3: Get the latest firmware

My Synology NAS is really versatile and fulfills the most mundane tasks. At this point in time the NAS serves up my iTunes, streams HD-movies to the PS3, has all my software stored centrally, is used as an iPhoto server, manages my backups, acts as a Squid-caching server and now manages the PS3 firmware.

A rainy weekend and the realisation that my Perl skills totally suck, have eventually made me create a small application which produces the following:

Yes, a history of the latest PS3 firmwares. After having installed my Squid-proxy server, I noticed the traffic coming from the PS3. One of the URLs was quite interesting: http://fuk01.ps3.update.playstation.net/update/ps3/list/uk/ps3-updatelist.txt. When you open the URL you will see a text-file describing the latest firmware version as well as the download link.

It was (relatively) easy to write a shell-script which downloads the update-file, then checks if a new firmware was released and if so, it will download the file and then notify you via an email of it. If your NAS or Linux server runs HTTP, I have included a simple Perl-script which lists all the firmwares and allows you to download them.

You add the PS3-firmware checker to a crontab and by the time you check your email, you will be notified that the latest firmware has been downloaded already.

Of course, if you would like to have the same cool functionality, use Paypal below, donate anything you like and get the download instantly (remember: you need wget, perl and the knowledge of a text-editor to adjust a few settings in the script):

 

 

 

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Synology: Harddrive replacement

In my previous post I described how I got screwed over by Western Digital. Obviously I can not risk data-loss and am preparing for a replacement drive from Seagate – the 1TB Barracuda.ES2.

This is a server-class drive and has received good reviews from the community in single- and multi-bay NAS configurations. Western Digital should learn from Seagate’s warranty/reliability measures:

The drive caters for an Annualized Failure Rate – AFR – of 0.73% (Mean Time Between Failures – MTBF – of 1.2 Million hrs) when operated in an environment that ensures the HDA case temperatures do not exceed 40°C.

AFR and MTBF specifications are based on the following assumptions for business critical storage system environments:
• 8,760 power-on-hours per year.
• 250 average motor start/stop cycles per year.

With those figures the drive will certainly last 2-3 years – something the Western Digital will never give me (I am already worried that the WD is not going to last long enough so that I can mirror the drive)

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: +1 (from 1 vote)

ADSL router statistics

In a previous post I explained how to gather statistics for your Netgear DG834 DSL modem router. Thanks for all the donations!! I have made some subtle changes in the router.cgi to display SNR/attenuation in one chart and display the latest values:

The scripts don’t just run on a Synology DiskStation. I have received reports that people integrated the scripts with their Linux boxes, QNAPs and others. In some instances, people modified the scripts (the code is easy enough to modify even for a Linux newbie) to make them work with other routers.

Again, please note, that out of the box, the scripts will work with any modem router supporting telnet and “adslctl” on the router. I would love to make SNMP or HTTP-polling functionality available, but have not got any router supporting this at the moment.

If you want to use the scripts, donate below (you require a running version of Perl with Net::Telnet and Net::Ping, rrdtool — the scripts will run on the Synology out of the box).

 

VN:F [1.9.17_1161]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.17_1161]
Rating: +1 (from 1 vote)

NAS: Netgear ADSL statistics

In a previous post I explained the significance of SNR and attenuation for ADSL lines.

I have spent now a significant amount of time to write scripts to retrieve the ADSL-statistics for my Netgear DG834v4 ADSL router. The script will equally work on any Broadcom based modem-router which allows access to telnet and supports the command “adslctl”.

The solution is really simple and consists of one perl-script collating the information and a CGI-script which then produces the stats in real time from your webserver:

I have deployed the solution on my Synology DiskStation DS107+ (FW722) and had the solution running now for a day. If you want to run this on the Synology, you will need to install rrdtool via ipkg. If you want to run it on another Linux-based environment, ensure that you have access to the command-line version of rrdtool and rrdcgi (which comes bundled with rrdtool).

My current setup produces stats every 15 minutes and reports on the following stats:

  • Ping statistics. Currently against my local ISP – saix.net, but scripts are easy to modify to include your own pings
  • ADSL signal to noise ratio (up / down)
  • ADSL attenuation (up / down)
  • Power output (up / down)
  • Maximum ADSL data rate (up / down)
  • ADSL sync speed (up / down)

All stats are reported per hour, day, week and month. In the future I want to enhance the scripts to provide additional useful reports for the Netgear DG834.

By now you are probably asking “Where is the download-link?” — well here is the thing, my hosting and the popularity of this site is starting to cost me a bundle. So I am introducing donation-ware. It is up to you to decide if you want to donate USD 1,00 or a million (yeah baby) using PayPal via the donation-button below. The donation is absolutely save and you will receive the download-link automatically via email (link is valid for 24 hours). Further, I will email you any updates to the scripts and will look at implementing any recommendations you have.

I think this sounds like a fair deal, especially since it took me in access of 60 hours just getting those scripts done (don’t get a fright though – the scripts are simple – that’s the beauty of the solution).

If you want to use the scripts, donate below (you require a running version of Perl with Net::Telnet and Net::Ping, rrdtool — the scripts will run on the Synology out of the box).

 

VN:F [1.9.17_1161]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

NAS: Analyse your squid logs

In a previous post I described how to install Squid on the Synology. This small tutorial will now explain how to display your usage behaviour in Squid via Webalizer.

You need to have ipkg installed and need to have an understanding on how to include 3rd party apps (i.e. via phpsrc).

  1. Install webalizer: ipkg install webalizer
  2. Create a new config file: cp /opt/etc/webalizer.conf.sample /opt/etc/webalizer.conf
  3. Adjust your log-file entry and point it to your Squid-access log: LogFile /opt/var/squid/logs/access.log
  4. Adjust your output directory (this is the HTML-directory from which you want to display your stats): OutputDir /volume1/webapps/scripts/squid/usage
  5. Create a cronjob entry (remember that the crontab needs to have tabs instead of spaces): 5 0 * * * root /opt/bin/webalizer -F squid -A 100 -C 100 -R 100 -S 100 -U 100 -e 100 -E 100 -Q

The above will create usage statistics every day (5 minutes past midnight) and publish the stats to the output-directory.

Some more cool stuff:

  • Use HideUrl to hide sites from the statistics. I typically hide access to all my local servers, since I am only interested in the outbound usage.
  • Use GroupUrl and HideUrl together to group certain websites and make it one line-item in the stats. I access the PS3ZA-forum frequently, so I don’t want to have every URL show, since it fills up the stats. Using GroupUrl www.ps3za.co.za/forum and HideUrl www.ps3za.co.za/forum will create one line-item in the stats. You can do the same with your RSS-feeds and others.
  • To avoid your logs filling up, you want to add a cronjob to rotate your squid access-logs (remember those TABS – this job will rotate the logs 30 minutes past midnight every month): 30 * 1 * * root /opt/sbin/squid -k rotate. Important: Webalizer don’t rotate the logs during the month – I was not able to get Webalizer to analyse those logs and you will lose your monthly stats.
VN:F [1.9.17_1161]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.17_1161]
Rating: +1 (from 1 vote)

NAS: Display Squid cachemgr

In a previous post I detailed how to install Squid on a Synology DS107+. This post explains how you are able to include Squid’s cache-manager UI. This post is for advanced users and I am not going to re-explain how to configure a 3rd party application in the DS.

  1. Adjust your cachemgr.conf and include your Squid’s url. In my case this is an extra line with 172.16.0.97:8080
  2. Ensure that you have configured the correct ACLs for the cache-manager. If you took my squid.conf then you are fine.
  3. Test the cache-manager: squidclient -h 172.16.0.97 -p 8080 mgr:info

     Squid Object Cache: Version 2.6.STABLE21 Start Time: Fri, 19 Sep 2008 13:57:53 GMT Current Time: Fri, 19 Sep 2008 14:08:44 GMT Connection information for squid: Number of clients accessing cache: 2 Number of HTTP requests received: 154 Number of ICP messages received: 0 Number of ICP messages sent: 0 Number of queued ICP replies: 0 Request failure ratio: 0.01 Average HTTP requests per minute since start: 14.2 Average ICP messages per minute since start: 0.0 Select loop called: 135277 times, 4.810 ms avg 

     

  4. The Squid installation comes with the cachemgr.cgi in /opt/libexec/cachemgr.cgi. Best way is to symlink (ln -s) the file into your 3rd party-directory

With the above information you will be able to tune Squid accordingly.

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

NAS: Create your own caching proxy

There you are, with that 1TB NAS and you surf mostly the same websites and in the process waste plenty of time waiting on downloads. So why not install your own Squid-proxy server on your NAS?

With the Synology and the pre-requisite of having ipkg installed – this takes no more than 10 minutes.

Update (2008-12-22): I have adjusted the Squid-configuration to block websites for unlisted IP-addresses. If you don’t require this (and want your kids to download several gigs of You Tube-videos) then delete the lines acl nonblockedip, acl blocksites and http_access deny blocksites.

In my example, my NAS IP is 172.16.0.97 and my IP range on my LAN is 172.16.0.0 – adjust this accordingly below:

  1. Install squid: ipkg install squid
  2. Adjust Squid’s config-file located in /opt/etc/squid/squid.conf:

     ## SQUID CONFIG cache_mgr [email protected] ## Those are the ports the proxy is going to listen to http_port 172.16.0.97:3128 http_port 172.16.0.97:8080 # TAG: visible_hostname # The host-name of the proxy-server. Can really be anything visible_hostname MuffinStationProxy # DISK CACHE OPTIONS # ----------------------------------------------------------------------------- # Disk-cache options. Just adjust the cache-siz (in my case 20GB) cache_replacement_policy lru cache_dir ufs /opt/var/squid/cache/ 20000 16 256 minimum_object_size 0 KB maximum_object_size 2097152 KB maximum_object_size_in_memory 1024 KB # MEMORY CACHE OPTIONS # ----------------------------------------------------------------------------- # TAG: cache_mem (bytes) cache_mem 8 MB memory_replacement_policy lru # ACCESS CONTROLS # ----------------------------------------------------------------------------- acl all src 0.0.0.0/0.0.0.0 acl manager proto cache_object acl localhost src 127.0.0.1/255.255.255.255 acl our_networks src 172.16.0.0/24 172.16.1.0/24 acl to_localhost dst 127.0.0.0/8 acl nonblockedip src 172.16.0.3 172.16.0.5 # childblocks acl blocksites dstdomain "/opt/etc/squid/restricted-sites.squid" #Block childblocked sites http_access deny blocksites !nonblockedip all http_access allow manager localhost http_access allow manager our_networks http_access deny manager # Allow all clients from my network http_access allow our_networks # And finally deny all other access to this proxy http_access deny all #Allow ICP queries from everyone icp_access allow all # LOG-FILES # ----------------------------------------------------------------------------- access_log /opt/var/squid/logs/access.log squid #cache_log none #cache_log /opt/var/squid/logs/cache.log #cache_access_log none #cache_access_log /opt/var/squid/logs/access.log #cache_store_log none #cache_store_log /opt/var/squid/logs/store.log # OPTIONS FOR TUNING THE CACHE # ----------------------------------------------------------------------------- # TAG: cache # A list of ACL elements which, if matched, cause the request to # not be satisfied from the cache and the reply to not be cached. # In other words, use this to force certain objects to never be cached. # # You must use the word 'DENY' to indicate the ACL names which should # NOT be cached. # # Default is to allow all to be cached #We recommend you to use the following two lines. acl QUERY urlpath_regex cgi-bin \? cache deny QUERY refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern . 0 20% 4320 refresh_pattern \.gif 1440 50% 40320 reload-into-ims refresh_pattern \.jpg 1440 50% 40320 reload-into-ims refresh_pattern \.tif 4320 50% 43200 refresh_pattern \.png 1440 50% 40320 reload-into-ims refresh_pattern \.jpeg 1440 50% 40320 reload-into-ims refresh_pattern ^http://*.google.*/.* 720 100% 4320 # refresh patterns to enable caching of MS windows update refresh_pattern windowsupdate\.microsoft\.com/.*\.(cab|exe|psf) 4320 100% 120960 reload-into-ims refresh_pattern update\.microsoft\.com/.*\.(cab|exe|psf) 4320 100% 120960 reload-into-ims refresh_pattern office\.microsoft\.com/.*\.(cab|exe|psf) 4320 100% 120960 refresh_pattern windowsupdate\.com/.*\.(cab|exe|psf) 4320 100% 120960 reload-into-ims refresh_pattern download\.microsoft\.com/.*\.(cab|exe|psf) 4320 100% 120960 reload-into-ims refresh_pattern microsoft\.com 4320 100% 10080 pipeline_prefetch on # Apache mod_gzip and mod_deflate known to be broken so don't trust # Apache to signal ETag correctly on such responses acl apache rep_header Server ^Apache broken_vary_encoding allow apache # Leave coredumps in the first cache dir coredump_dir /opt/var/squid/cache # Disable cachemgr password cachemgr_passwd none all 

     

  3. Take note from my above config, that I chose a cache-size of 20(!) GB (cache_dir).
  4. Validate your Squid configuration with squid -k parse
  5. Create the Squid cache-directories with squid -z
  6. Start Squid manually to check for errors: squid -NCd1
  7. Create a symbolic link so that Squid starts automatically: ln -s /opt/etc/init.d/S80squid /usr/syno/etc/rc.d/
  8. Once you restart the NAS, Squid should be started automatically (log files are in /opt/var/squid/logs)

Dummy error: Happened to me – if Squid starts and you don’t notice any improvements in browsing speed, make sure that you have your browser’s proxy settings adjusted :oops:

IMPORTANT: As I have the caching server within a DMZ/Firewall, security-concerns are secondary. All users having access to the LAN and fall within the IP-range will automatically have access to the caching-proxy. The implementation of Squid was for improving the browsing/web-experience (speed has improved by almost 200% and average bandwidth consumption dropped by 30%).
Continue reading “NAS: Create your own caching proxy” »

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)