Thursday 26 June 2014

QNAP TS-412 Firmware 4.0.2 to 4.0.7 upgrade


The web based upgrade for the firmware failed on this device; to manually do the upgrade follow this procedure:


remove all the update folders and then re-create one with a link to the other

download the firmware

make a copy of the file as the source will get removed during the upgrade (optional step)

[~] # rm -rf /mnt/HDA_ROOT/update/
[~] # rm -rf /mnt/update
[~] # mkdir /mnt/HDA_ROOT/update
[~] # ln -sf /mnt/HDA_ROOT/update /mnt/update
[~] # cd /share/Public
[/share/Public] # wget http://eu1.qnap.com/Storage/TS-412TurboNAS/TS-412_20140412-4.0.7.zip
[/share/Public] # unzip TS-412_20140412-4.0.7.zip
[/share/Public] # cd ~

[~] # cp /share/Public/TS-412_20140412-4.0.7.img /share/Public/TS-412_20140412-4.0.7-work.img
[~] # /etc/init.d/update.sh /share/Public/TS-412_20140412-4.0.7-work.img

this will have an output like
cksum=1718371300
Check disk space available for FW update: OK.
Using 120-bit encryption - (QNAPNASVERSION4)
len=1048576
model name = TS-412
version = 4.0.7
boot/
config/
fw_info
initrd.boot
initrd.boot.cksum
libcrypto.so.1.0.0
libssl.so.1.0.0
qpkg.tar
qpkg.tar.cksum
rootfs2.img
rootfs2.img.cksum
rootfs_ext.tgz
rootfs_ext.tgz.cksum
uImage
uImage.cksum
update/
update_img.sh
4.0.7 20140412
MODEL NAME = TS-412,new version = 4.0.7
limit version = 3.8.2
Allow upgrade
tune2fs 1.41.4 (27-Jan-2009)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds
Update image using HDD ...
Check uImage size ... Pass
Check initrd.boot size ... Pass
Check rootfs2.img size ... Pass
Check Flash ROM
Update Kernel ...
Update Basic RootFS ...
Update Basic RootFS2 ...
1+0 records in
1+0 records out
Update Finished.
set cksum [1718371300]

then afterwords reboot
# reboot

Monday 23 June 2014

How to set MTU on Linux interface



The MTU can be set with:
$ sudo ip link set dev tun0 mtu 1350

It can be tested with
$ ip a s 

And will show something like the below:
5: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1350 qdisc pfifo_fast state UNKNOWN group default qlen 100

link/none 

Friday 20 June 2014

Ubuntu bulk rename files

If you don't want to use the command line to rename files the following application "pyrenamer" have a lot of functionality and work a charm.


With pyRenamer you can change the name of several files at the same time easily.
→ You can use patterns to rename files.
→ You can use search & replace to rename files.
→ You can use common substitutions.
→ You can manually rename selected files.
→ You can rename images using their metadata.
→ You can rename music using its metadata.

To install it:
sudo apt-get install pyrenamer

Friday 6 June 2014

Ways to find your Public IP





Various ways exist for different purposes but I thought I will list a few ways to find the external IP.




In bash:

1:  IP=$(curl -s ifconfig.me)  
2:  echo “Your IP is $IP”  

In Python:

1:  import requests  
2:  r = requests.get(r'http://jsonip.com')  
3:  ip= r.json()['ip']  
4:  print 'Your IP is', ip  

Sites that return your external IP

http://ifconfig.me/ip

http://ipecho.net/plain

http://checkip.dyndns.org/plain

http://ipogre.com/linux.php

http://whatismyipaddress.com/

http://ip.my-proxy.com/

http://websiteipaddress.com/WhatIsMyIp

http://getmyipaddress.org/

http://showmyipaddress.com/

http://www.my-ip-address.net/

http://myexternalip.com/raw

http://www.canyouseeme.org/

http://www.trackip.net/

http://myip.dnsdynamic.org/

http://icanhazip.com/

http://www.iplocation.net/

http://www.howtofindmyipaddress.com/

http://www.ipchicken.com/

http://whatsmyip.net/

http://www.ip-adress.com/

http://checkmyip.com/

http://www.tracemyip.org/

http://checkmyip.net/

http://www.lawrencegoetz.com/programs/ipinfo/

http://www.findmyip.co/

http://ip-lookup.net/

http://www.dslreports.com/whois

http://www.mon-ip.com/en/my-ip/

http://www.myip.ru

http://ipgoat.com/

http://www.myipnumber.com/my-ip-address.asp

http://www.whatsmyipaddress.net/

http://formyip.com/

https://check.torproject.org/

http://www.displaymyip.com/

http://www.bobborst.com/tools/whatsmyip/

http://www.geoiptool.com/

https://www.whatsmydns.net/whats-my-ip-address.html

https://www.privateinternetaccess.com/pages/whats-my-ip/

http://checkip.dyndns.com/

http://myexternalip.com/

http://www.ip-adress.eu/

http://www.infosniper.net/

http://wtfismyip.com/

http://ipinfo.io/

http://httpbin.org/ip