From the Blog
sudo openvpn filename
dig +short myip.opendns.com @resolver1.opendns.com
You first need to ssh in to your RaspberryPi and run the following command lines.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install samba samba-common-bin
Then you and to create a shared folder:
sudo mkdir -m 1777 /share
Next you want to edit Samba config file to include shared folder:
sudo nano /etc/samba/smb.conf
Insert the below settings to the bottom of the page:
Comment = Pi shared folder
Path = /share
Browseable = yes
Writeable = Yes
only guest = no
create mask = 0777
directory mask = 0777
Public = yes
Guest ok = yes
Press `ctrl` + `x` to close file and press `y` to save and hit enter.
Next you want to create a password for Samba:
sudo smbpasswd -a pi
Here it will prompt you to insert password. This is separate to you Pi login but there is no harm inserting the same password if you like.
Final you need to reboot Samba:
sudo /etc/init.d/samba restart
Now you should find that your RaspberryPi is discoverable on your next work.
Step 1. DNS
First you need to visit your host provider and go to Manage your Domain Name System (DNS) settings. For example I use Cloudflare to manage DNS. There you will need to add a new CNAME record. So for example I want a subdomain http://helloworld.yourdomainname.com.
To do this you add new DNS Records:
TYPE – CNAME
NAME – helloworld
VALUE – @
TTL – Automatic
Status – DNS Only
Step 2. Router
Make sure your router is setup with port forwarding point to your Synology server.
Step 3. Synology server
Finally login to you Synology box and go to Control Panel > Application Portal > Reverse Proxy. Here you will need to add new Revers Proxy Rules. The rest is straight forward. So now you can check is your new domain URL works. If not, go back and check all three setting are correct.
If you are like me bought a NAS drive and want to build up storage over time due to the high expense of hard drives. The best way is to start off with 2 Hard disks as Raid 1. Then if you have enough money later on to buy the 3rd Expanding your 3rd drive a Raid 5. Depending how big your hard drives this process of expanding with Synology NAS can be a long process which can take days before you can see changes. I understand why, because anyone on your network will not be interrupted if the server is down, So it will be business as usual. But what if you need the extra space urgently hence the purchase of the third drive? Well, you come to the right place. Here is how to speed up expanding NAS.
Open terminal on you mac Putty for windows,
Type in the following to see progress:
You should see something like this:
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md3 : active raid5 sdc6 sdb6 sda6
7657726592 blocks super 1.2 level 5, 64k chunk, algorithm 2 [3/3] [UUU]
[============>........] reshape = 61.6% (4722524224/7657726592) finish=402.6min speed=121486K/sec
md2 : active raid5 sdc5 sda5 sdb5
151459776 blocks super 1.2 level 5, 64k chunk, algorithm 2 [3/3] [UUU]
md1 : active raid1 sdc2 sda2 sdb2
2097088 blocks [4/3] [UUU_]
md0 : active raid1 sdc1 sda1 sdb1
2490176 blocks [4/3] [UUU_]
Here is what you need to look for:
reshape = 61.6% (4722524224/7657726592) finish=402.6min speed=121486K/sec
If you go here and type in the mins to finish you can work out how long roughly to complete expanding process.
The first this you need to do is switch over to ‘root’ user. To do this type in:
Next set speed NAS speed
Copy and paste the following make increases:
echo 250000 > /proc/sys/dev/raid/speed_limit_min
echo 250000 > /proc/sys/dev/raid/speed_limit_max
echo 32768 > /sys/block/md3/md/stripe_cache_size
finally checkout the speed now and on your Resource monitor gui:
First of all you need to enable NFS on your Mac, to do this type this command
sudo nfsd enable
$ cd /etc/
Then you have to edit if not create file called ‘exports’
$ sudo nano exports
path to your directory you want to mount follow by “-alldirs -mapall=501”
"/Volumes/LaCie" -alldirs -mapall=501
List show user ID (Commonly you want 501)
Every time you make a change to this file you need to restart NFS services.
$ sudo nfsd restart
Confirm your NFS paths
$ showmount -e
Finally Login to your Synology server, go to ‘File station’ > ‘Tools’ > ‘Mount remote Folder’ > ‘NFS Shared Folder’
In the Folder files put in your Mac’s IP follow by the path
– First login into your synology NAS server.
– Go to Package Centre.
– Click on ‘Settings’ button and select the ‘Beta’ tab.
– Tick the checkbox ‘Yes, I want to see beta versions!’.
– Next, go to ‘Utilities’ and find ‘Virtual Machine Manager’.
– Click on ‘Virtual Machine Manager’ and hit the ‘Install’ button.
– Once installed, Launch the app.
open terminal in Ubuntu and run the following command:
sudo apt-get install qemu-guest-agent
ssh into your destination folder when you want to backup your files, then type the following command.
rsync -av [username]@[ip-address]:/Users/username/Pictures/ .
If you have installed jmeter with homebrew can run these commands in terminal
brew install jmeter
brew install jmeter --with-plugins
If you are running jmeter 3.2, you can found your jmeter CA Certificate here.
The simplest way to installing this certificate is by opening the directory and double clicking on the file. By default it will be added to your list for certificate but not trusted. If you right click you will have the option to trust where you will need to type in your machine password.
In ‘phpMyAdmin’ under sql tab copy and paste below script and hit go!.
UPDATE wp_options SET option_value = replace(option_value, 'http://old-url', 'http://new-url') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://old-url', 'http://new-url');
UPDATE wp_posts SET post_content = replace(post_content, 'http://old-url', 'http://new-url');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://old-url', 'http://new-url');
The other day I need to migrate files over to my new NAS, to do this I had to SSH in to the box and run a SCP command to copy over files. But at the sametime I wanted to keep their timestamp. To do this you need to run the following command
First ssh into your box and go the fold where you want to copy files to then run this command:
$ scp -r [username]@[ip-address]:[path-of-files] .
if you would like to keep timestamp run this command. notice I added ‘p’ after the ‘-r’.
$ scp -rp [username]@[ip-address]:[path-of-files] .
‘-r’ is recursive ‘p’ is for preserve (file details).
First ssh in to pi and cd in to Downloads directory.
$ cd ~/Downloads
Next you need to download the nodejs tar. Checkout the version you desire http://nodejs.org/dist/ make sure you download the the version with the last string ending ‘linux-armv6l.tar.gz’. Raspberry Pi Zero support only ARMv6.
$ wget http://nodejs.org/dist/v6.10.3/node-v6.10.3-linux-armv6l.tar.gz
Once downloaded cd in to usr/local
Extract tar here
sudo tar xzvf ~/Downloads/node-v6.10.3-linux-armv6l.tar.gz --strip=1
And finally remove default npm, node and nodejs.
sudo apt-get remove --purge npm node nodejs
Now check the version
$node -v && npm -v
Only recently I needed to access my iMac GUI whilst I was away aboard. I’ve always ssh to my iMac being a geek. But for this particular occasion I needed to demo things on my iMac.
Anyways I did a little research and here are my findings and conclusion.
Like I said I’ve always ssh in to my box via VPN, takes awhile to setup if you know what you’re doing, but very useful if you want connect to your home network whilst your in another country.
If you have VPN the best app to use is VNC viewer and this is free.
Next download VNC Viewer on you iPad/iPhone. If you sign up and add your mac details and your way!
Usability is ok, I find it a bit slow compare to the other Remote Desktops apps. I feel it’s very graphic heavy and may eat in to your data plan.
Teamviewer is free for personal use only… But you if you have several machine you like to connect to, you are advice to purchase a licence, which I think is fair.
By far, I think the usability on the iPad/iPhone is very simple compare to all the rest for Remote Desktops apps. The app is optimise to your reduces your mobile bandwidth.
Google Chrome Remote desktop
Google is new to the game. I know Google had done similar in the past using their web browser, but this did not fly too well as it was very sluggish. Chrome Remote Desktop is the new and improve version. Works very well. You do not need VPN enable. You can access again on your iPad/iPhone.
The navigation works very similar to VNC viewer. The app is also optimised to your reduces your mobile bandwidth.
Apple Screenshare is pretty recent with the new macOS Sierra. Screenshare is already intergated to the system. all you need to do is make use you are signed in to iMessage and thats it.
Search Screenshare by holding down Command and spacebar and type in ‘Screenshare’. put in the ip address if you have VPN and your in.
The other way is by sharing your screen or taking control of your friend/family desktop is by going to iMessage select the your user message and click on the ‘i’ icon and you will see the overlapping windows icon. Click on this and you will be presented the two options. Control or view.
Is Join.me is simple Remote desktop app which is web based.