Fév 112014
 

In 2 weeks times, I lost a disk twice in my synology DS210.

First time, the disk was truly giving signs of imminent death.
Because I was using SHR (synology hybrid raid), I could not mount my disk under my ubuntu.

So this is how I got my datas back (right before the disk died for good).
The disk is mounted thru a USB dock bay onto my synology.

-1: locate your disk and raid partition with fdisk -l,
you should get something like this :
/dev/sdx3 588 19457 151569760+ fd Linux raid autodetect

-2: ensure this partition actually contains an MD device with mdadm –examine –scan /dev/sdx3,
you should something like that :
ARRAY /dev/md3 level=raid1 num-devices=2 UUID=db7c8f07:6f0f4570:852c2e22:a378fec9

-3: locate your last active MD device with mdadm –detail –scan,
you should get something like :
ARRAY /dev/md1 metadata=0.90 UUID=f07f5754:cf6f8af4:663cbd89:1480ea74
ARRAY /dev/md2 metadata=1.1 name=ds201j:2 UUID=17f442a7:d767633b:a4fc4e5b:88db9d4b

-> you want to use next free MD device which is MD3.

-4: create a MD device pointing to your partition with mdadm -A –verbose –run /dev/md3 /dev/sdx3

-5 : now mount it with mount /dev/md3 /mnt/usb

You can now retrieve your files in /mnt/usb !!!

Now, like I told you at the beginning at this article, I lost 2 disk in a row in a week time.
The second time, the method above did not work 🙁
This time, UFS Explorer saved my datas.

Hope this can help others…

 Posted by at 20 h 12 min
Déc 272013
 

For a while, I was (very) upset with ads on my tablets (android and ipad).
And unlike browsers on my windows (firefox or chrome) I could not find something like adblock for ipad.

Therefore I decided to setup a squid on my synology ds210j and to setup an adblock like in squid.
And success, no more nasty popups, quicker web sites, etc 🙂

the steps:

-install ipkg (see here for an how to, in french sorry).
-install squid : ipkg install squid
-customize squid.conf
-use a list of domain you wish to block (i used a list from this site)

my list of blocked domains : denied_domains

my squid.conf

negative_dns_ttl 10 second
connect_timeout 60 second
read_timeout 60 second
request_timeout 60 second
cache_dir ufs /opt/var/squid/cache 512 16 256
cache_access_log /opt/var/squid/logs/access.log
cache_log /opt/var/squid/logs/debug
cache_store_log /opt/var/squid/logs/storage
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32

acl localnet src 192.168.1.0/24

#on which ports do we allow connections using the proxy
acl SSL_ports port 443 # https
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl purge method PURGE
acl CONNECT method CONNECT
#acl url_ads url_regex "/opt/etc/squid/denied_ads.txt"
acl denied_domains dstdomain "/opt/etc/squid/denied_domains.txt"

#http_access deny url_ads
http_access deny denied_domains
http_access allow localnet
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
miss_access allow all

http_port 8080

via off
forwarded_for off
header_access From deny all
header_access Server deny all
header_access WWW-Authenticate deny all
header_access Link deny all
header_access Cache-Control deny all
header_access Proxy-Connection deny all
header_access X-Cache deny all
header_access X-Cache-Lookup deny all
header_access Via deny all
header_access Forwarded-For deny all
header_access X-Forwarded-For deny all
header_access Pragma deny all
header_access Keep-Alive deny all

note : you can use the dns_nameservers directive in squid.conf to use specific dns servers (i use opendns).
note : you can set a vpn client on your synology and your proxy will then use a different network (i use vyrvpn from giganews)
note : you can tweak your dhcp server to set the proxy for your clients automatically (see here)

 Posted by at 23 h 10 min