Photo software installation

try installing libgphoto2 through synaptic first
from: http://ubuntuforums.org/showthread.php?t=1701719

download libgphoto2 http://sourceforge.net/projects/gphoto/postdownload?source=dlp

1
2
3
4
5
6
7
8
$ tar jxf ./libgphoto2-2.5.4.tar.bz2 
$ ./configure --prefix=/usr/local
$ make
$ sudo make install

#lsusb
# sh -c '/usr/local/lib/libgphoto2/print-camera-list udev-rules mode 0660 group plugdev > /etc/udev/rules.d/45-libgphoto2.rules'
# gedit /etc/udev/rules.d/45-libgphoto2.rules

Go to the bottom of the file. Before the end where it says: LABEL=”libgphoto2_rules_end”
Add Code: ATTRS{idVendor}==”VENDORID”, ATTRS{idProduct}==”PRODUCTID”, MODE=”0660”, GROUP=”plugdev”

Save the rules file.
7) Reboot the computer.
8) Turn on camera. Everything should work. (Must use Kodak cable for Easychare camera)

GUI interface at applications / graphics / Gtkam digital camera browser

2016-05-28

Plug camera in using special “Kodak” USB cord.
The cord has the label “Kodak” and a ballast.

Kodak EasyShare C123

Turn camera on.
Use file manager to transfer files

#apt-get install xscreensaver (gnome has its own much inferior screensaver)
configure the “ripples” screensaver to pull images from the Pictures directory

Share

Security

SSH

Make a public and private key pair and place them in the local ~/.ssh directory

1
2
3
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa

the public key is ~/.ssh/id_rsa.pub
Transfer this file using rsync to Hostgator. It should be in /home2/mbcladwell/.ssh/authorized_keys

1
rsync -av -e "ssh -p 2222" ~/.ssh/id_dsa.pub mbcladwell@123.123.123.123:.ssh/authorized_keys
1
2
3
4
5
6
7
ssh mbcladwell@123.123.123.123

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
chown mbcladwell ~/.ssh/authorized_keys


GPG

to get a key:
gpg –keyserver subkeys.pgp.net –recv-keys 219EC810

to add to keyring:
gpg -a –export 55BE302B | apt-key add -

To find an expired key:
apt-key list | grep expired

root@dc7700s:/home/mbc# apt-key list | grep expired
pub 1024D/C4447CF3 2010-11-05 [expired: 2015-03-26]

then run: apt-key adv –recv-keys –keyserver keys.gnupg.net C4447CF3

$ gpg –export-secret-keys -a keyid > my_private_key.asc
$ gpg –export -a keyid > my_public_key.asc

gpg –import public.key
gpg –allow-secret-key-import –import private.key

!!!note the second import

To export secret key for transfer to another computer:

gpg –export-secret-keys –armor –output secret.asc

After fresh install copy ~/.gnupg directory to new machine via USB

Revoke a key

First import into keyring the revocation certificate (previously generated)
$ gpg –import ~/syncd/.gnupg/mystuff/verizonrevocation.txt

Then send the revoked key id to the keyserver
$ gpg –keyserver pgp.mit.edu –send-keys 16D9C90B47237FB3

Then go to the keyserver and query name - should see “revoked” in the first line.

For ~/syncd/.gnupg

in ~/.bashrc must have: export GNUPGHOME=/home/mbc/syncd/.gnupg
#chmod 700 /home/mbc/syncd/.gnupg

Tor

You need to add the following entry in /etc/apt/sources.list or a new file in /etc/apt/sources.list.d/:

deb http://deb.torproject.org/torproject.org wheezy main
deb-src http://deb.torproject.org/torproject.org wheezy main

Then add the gpg key used to sign the packages by running the following commands at your command prompt:

gpg --keyserver keys.gnupg.net --recv 886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -

You can install it with the following commands:

$ apt-get update
$ apt-get install tor deb.torproject.org-keyring

tar -xvJf tor-browser-linux32-5.5.4_en-US.tar.xz
cd to tor director and run batch file.

Miscellaneous

Have I been pawned?

Ten minute email

mbcladwell+website.com@gmail.com attaches destination crumb so you can monitor who is handing out your email. Works only with gmail.

Linux privelage escalation

How to keep your isps nose out of your browser history with encrypted dns

Capture passwords sshing into your server

Share

Hexo

Previously I was working with Jekyll, the most popular static web generator. As I have an interest in Nodejs (and not in Ruby), I wanted to use a site generator that would give me practice with Node. Hexo was the most popular according to staticgen. I am working with the default “Landscape” theme.

Install

1
2
3
4
5

$npm install -g hexo-cli

apt-get install pandoc
npm install hexo-renderer-pandoc

Install hexo-render-pandoc and modify /node_modules/hexo-render-pandoc/index.js:

//var args = [ ‘-f’, ‘markdown’, ‘-t’, ‘html’, ‘–mathjax’, ‘–smart’];
var args = [ ‘-f’, ‘markdown’, ‘-t’, ‘html’, ‘–katex’, ‘–smart’];

1
2

npm install hexo-math --save

Basics


$hexo new draft mypost in the lostnation directory
will create the post in the _drafts subdirectory.
File title will be "mypost.md"
There will be a subdirectory "mypost" that will hold other content (figures, data etc.)
When ready: $hexo publish mypost
Will create 2016-12-06-mypost directory and 2016-12-06-mypost.md file.
$hexo generate will process all files into html
$hexo serve will start a local web server. The local site can be inspected at http://0.0.0.127:4000
$hexo deploy will upload to your web server. FTP parameters are in _config.yml

Hexo deploy

For deploy to work:
update ~/.netrc with site / username / password (for manual ftp diagnosis)
chmod 600 ~/.netrc

~/.netrc
1
machine lostnation.us login lnsDFoKytr@lostnation.us password mypassword

Must generate an FTP user and assign a home directory.
cpanel automatically generates a home directory different from what I want - so change.

_config.yml
1
2
3
4
5
6
7
8
9
10
11
12
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: ftpsync
host: lostnation.us
user: lnsDFoKytr@lostnation.us
pass: mypassword
remote: /
port:
ignore:
connections:
verbose: true

hexo deploy will fail silently without debugging info. Manually ftp to diagnose. Better yet, avoid it entirely.
Use rsync, which is faster and can perform incremental uploads, something hexo deploy can’t do.

lostnation-upload.sh
1
2
3
#!/bin/bash
rsync -avzP --delete --rsh='ssh -p2222' /home/mbc/syncd/lostnation/public/ mbc@nnn.nnn.nnn.215:/home2/mbc/public_html/lnsDFoKytr

The slash after …/public/ is necessary to transfer everything under ./public but not the public itself.
…/public will transfer ../public/…

add items in: /home/mbc/lostnation/themes/landscape/_config.yml

# Header
menu:
Home: /
Archives: /archives
About: /about
rss: /atom.xml

Comments

get rid of the extra comments link in /home/mbc/lostnation/themes/landscape/layout/_partial/article.ejs
comment out:

Templates

Templates are found in the scaffolds directory.
Modify to include categories, comments: true etc.
Anything included in the template will end up in the draft (or post).

RSS icon

http://jr0cket.co.uk/hexo-themes-test/2014/06/hexo-custom-theme---adding-navbar-icon-links-using-fontawesome/
https://github.com/iissnan/hexo-theme-next/issues/153

icons from CSS
http://astronautweb.co/snippet/font-awesome/

in theme modify layout/_partial/header.ejs
move:

    <% if (theme.rss){ %>
      <a id="nav-rss-link" class="nav-icon" href="<%- theme.rss %>" title="<%= __('rss_feed') %>"></a>
    <% } %>
    <a id="nav-search-btn" class="nav-icon" title="<%= __('search') %>"></a>
  <div id="search-form-wrap">
    <%- search_form({button: '&#xF002;'}) %>

up near other links

Favicon

http://stackoverflow.com/questions/30291588/add-favicon-to-hexo-blog

prefer to use my favicon across the entire site, so I’ve linked to the favicon in my theme config. I use Landscape, the default theme included with Hexo.

blog\blog\node_modules\hexo\node_modules\hexo-cli\assets\themes\landscape_config.yml

At the bottom of the file, you’ll find a section titled Miscellaneous.

# Miscellaneous
google_analytics:
favicon: blog\themes\landscape\source\css\images\favicon.ico
twitter:
google_plus:
fb_admins:
fb_app_id:

/home/mbc/lostnation/themes/landscape/source/css/images/favicon.ico

the _config.yml in the themes must look like:

# Miscellaneous
google_analytics:
favicon: /css/images/favicon.ico
twitter:
google_plus:
fb_admins:
fb_app_id:

Theme customization

/home/mbc/lostnation/public/css/images/

/home/mbc/lostnation/themes/landscape/source/css/_variables.styl
contains image path
indicate banner and icon here

/home/mbc/lostnation/themes/landscape/source/css/_partial/header.styl
in header.styl

header.styl
1
2
3
4
5
$logo-text
text-decoration: none
color: rgba(200, 54, 54, 0) was #fff
font-weight: 300
text-shadow: 0 1px 4px rgba(0, 0, 0, 0) fourth 0 was 0.3

Bulk process

Sometimes e.g. during the migration from Jekyll to Hexo, I need to bulk process md files.
Set up process, backup, source, and destination directories.
Below are some useful sed commands for bulk processing


sed -i 's/{% highlight r %}/{% codeblock lang:r %}/g' *
sed -i 's/{% highlight text %}/{% codeblock lang:bash %}/g' *
sed -i 's/{% endhighlight %}/{% endcodeblock %}/g' *
sed -i 's/{% endhighlight %}/{% endcodeblock %}/g' *


sed -i 's/{% highlight sql linenos %}/{% codeblock lang:sql %}/g' *
sed -i 's/{% highlight lisp linenos %}/{% codeblock lang:lisp %}/g' *
sed -i 's/{% highlight r linenos %}/{% codeblock lang:r %}/g' *
sed -i 's/{% highlight html linenos %}/{% codeblock lang:html %}/g' *
sed -i 's/{% highlight elisp linenos %}/{% codeblock lang:elisp %}/g' *

sed -i 's/\/figs\//\/lnsDFoKytr\/figs\//g' *

sed -i 's/{{site.baseurl}}//g' *
sed -i 's/^permalink:.*//g' *
sed -n '/highlight/p' *
sed -n '/playstyle AA^{&̲#39;}/p' *
grep -nwl "playstyle " **/*.md

To copy and move around processed files

Pre modification clean directories:

1
2
3
rm /home/mbc/process/_posts/*.*
rm /home/mbc/process/modpostsbackup/*.*
rm /home/mbc/process/modposts/*.*

working _posts is THE _posts directory used by web

copy from working _posts to processing _posts:

1
2
cp /home/mbc/lostnation/source/_posts/*.*  /home/mbc/process/_posts/
cp /home/mbc/lostnation/source/_posts/*.* /home/mbc/process/modposts/

modposts is where I modify posts

cd /home/mbc/process/modposts/

Recharge the modposts if an error was made

1
2
rm /home/mbc/process/modposts/*.*
cp /home/mbc/lostnation/source/_posts/*.* /home/mbc/process/modposts/

change working posts:

1
2
rm /home/mbc/lostnation/source/_posts/*.*
cp /home/mbc/process/modposts/* /home/mbc/lostnation/source/_posts/

Post modification backup to the cloud:

1
2
rm /home/pl/owncloud/web/lostnation/source/_posts/*.*
cp /home/mbc/lostnation/source/_posts/* /home/pl/owncloud/web/lostnation/source/_posts/

Debugging

Hexo has horrendous error messages - no indication of the file giving the error.
Note also that md files in _drafts will be processed, so any errors there need attention.

Sometimes a keyword will pop out of the error output. Search across files with:

grep -Ril “highlight” ./

R: recursive
i: ignore case
l: show file name, not error
./: where to start looking

Share

nodejs

I want to use sudo-free node with Hexo and blockchain related scripts. Do not use the apt-get method of installation on Debian as that provides a “nodejs” executable rather than “node” which can be problematic (at least with Hexo). I will follow the installation instructions at nearform. There is also a good tutorial at sitepoint.

Determine if node is installed:

1
2
$which node
$which npm

and remove if it is:

1
2
3
4
sudo rm -f /usr/local/share/man/man1/node.1
sudo rm -f /usr/local/lib/dtrace/node.d
sudo rm -rf ~/.npm
sudo rm -rf ~/.node-gyp

Install using NVM

1
2
3
4
5
#apt-get install curl  ;;if needed
$curl https://raw.githubusercontent.com/creationix/nvm/v0.25.0/install.sh | bash
$nvm install stable ;;; or choose a particular version
## restart terminal
$nvm alias default stable ;; set stable as the default

;;to see where executable reside

1
npm config get prefix

use ~/.npm for local (global) installation
always install with the -g option (global, but with my setup it will be under my home dir, no sudo needed)
the -save option adds the package to the application specific package list, so it will automatically be installed when the package is moved.

Share

Instagram

Use bots to like and comment. Buy content for posting. Get lots of followers. Lose your privacy. Make a fool of yourself. Become an “influencer”.

Share

Guix

Setup / install

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
gpg --keyserver keys.gnupg.net --recv-keys 3D9AEBB5

wget ftp://alpha.gnu.org/gnu/guix/guix-binary-0.10.0.i686-linux.tar.xz
wget ftp://alpha.gnu.org/gnu/guix/guix-binary-0.10.0.i686-linux.tar.xz.sig
gpg --verify guix-binary-0.10.0.i686-linux.tar.xz.sig

su

cd /tmp
tar --warning=no-timestamp -xf /home/pl/guix-binary-0.10.0.i686-linux.tar.xz
mv var/guix /var/ && mv gnu /

ln -sf /var/guix/profiles/per-user/root/guix-profile \
~root/.guix-profile


cp ~root/.guix-profile/lib/systemd/system/guix-daemon.service \
/etc/systemd/system/
systemctl start guix-daemon && systemctl enable guix-daemon

mkdir -p /usr/local/bin
cd /usr/local/bin
ln -s /var/guix/profiles/per-user/root/guix-profile/bin/guix

mkdir -p /usr/local/share/info
cd /usr/local/share/info
for i in /var/guix/profiles/per-user/root/guix-profile/share/info/* ;
do ln -s $i ; done

guix archive --authorize < ~root/.guix-profile/share/guix/hydra.gnu.org.pub


Install (and start) the nscd name service recommended for foreign distro use of guix

\#apt-get install nscd

# to upgrade the system daemon on foreign distro

https://guix.gnu.org/manual/en/html_node/Upgrading-Guix.html#Upgrading-Guix

\#guix pull
\#systemctl restart guix-daemon.service


# groupadd --system guixbuild
for i in `seq -w 1 10`;
do
useradd -g guixbuild -G guixbuild \
-d /var/empty -s `which nologin` \
-c "Guix build user $i" --system \
guixbuilder$i;
done


# export PATH="/root/.guix-profile/bin:/root/.guix-profile/sbin"


As a user

$ guix package -i glibc-locales
$ export GUIX_LOCPATH=$HOME/.guix-profile/lib/locale
$ guix package -i font-adobe-source-han-sans:cn


# guix-daemon --build-users-group=guixbuild

EMACS

1
2
3
guix package -i emacs.
guix package -i geiser
guix package -i guix

~/.bashrc

.bashrc
1
2
3
4
5
6
7
8

export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
export GUILE_LOAD_COMPILED_PATH="/home/pl/.guix-profile/lib/guile/2.0/ccache:/home/pl/.guix-profile/share/guile/site/2.0"
export INFOPATH="/home/pl/.guix-profile/share/info"
export LC_ALL="en_US"
export PATH="/home/pl/.guix-profile/bin:/home/pl/.guix-profile/sbin:$PATH"
export GUILE_LOAD_PATH="/home/pl/.guix-profile/share/guile/site/2.0"
export R_LIBS_SITE="/home/pl/.guix-profile/site-library/"

Note that the PATH must start with /home/pl/.guix-profile/bin

Purge the system Guile with:

.bashrc
1
2
3
$ export PATH=/home/mbc/.config/guix/current/bin:$PATH
$hash guix ;;to invalidate your shell's cache for the guix binary location.
$type guix ;;must return ~/.config/guix/current/bin/guix

An example .scm for packaging guile-json:

guile-json.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
(use-modules (guix packages)
(guix download)
(guix build-system gnu)
(guix licenses)
(gnu packages pkg-config)
(gnu packages guile) )


(package
(name "guile-json")
(version "4.3.2")
(home-page "https://github.com/aconchillo/guile-json")
(source (origin
(method url-fetch)
(uri (string-append "mirror://savannah/guile-json/guile-json-"
version ".tar.gz"))
(sha256
(base32
"0255c7f053z4p9mqzhpxwbfx3y47j9nfvlgnm8xasdclyzmjl9y2"))))
(build-system gnu-build-system)
(native-inputs `(("pkg-config" ,pkg-config)
))
(inputs `(("guile" ,guile-3.0)))
(synopsis "JSON module for Guile")
(description
"Guile-JSON supports parsing and building JSON documents according to the
specification. These are the main features:

@itemize
@item Strictly complies to @uref{http://json.org, specification}.
@item Build JSON documents programmatically via macros.
@item Unicode support for strings.
@item Allows JSON pretty printing.
@end itemize\n")

;; Version 1.2.0 switched to GPLv3+ (from LGPLv3+).
(license gpl3+))

To get some recipes of use from store:

.bashrc
1
2
3
4
5
$guix edit guile-json

$guix package --install-from-file=./Downloads/guile-json/guile-json.scm
$guix package -s guile-json

Configure EMACS/Geiser

look at the file ~/.configure/guix/current/bin which will provide you with the guix/guile binary path and the recipe for %load-path.

In EMACS configure Geiser with the above executable, and for the load path entry (which requests a file) use the ~/.configure/guix/current/bin file.

Share

linux-commands

Mostly for Debian, some Arch

Packages

To see all the files the package installed onto your system, do this:
dpkg-query -L

To see the files a .deb file will install
dpkg-query -c <package_name.deb>

To see the files contained in a package NOT installed, do this once (if you haven’t installed apt-file already:
sudo apt-get install apt-file
sudo apt-file update

then
apt-file list ‘package_name’

to find a file:

1
2
3
4
5
$ find / -name 'program.c' 2>/dev/null
$ find / -name 'program.c' 2>errors.txt

#find -mtime -3 (last 3 days)
#du | less to see size of all directories
/ Start searching from the root directory (i.e / directory)}
-name Given search text is the filename rather than any other attribute of a file
‘program.c’ Search text that we have entered. Always enclose the filename in single quotes.. why to do this is complex.. so simply do so.

Package manager hierarchy on Debian:
dpkg –> apt-get, aptitude –> Synaptic

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

# dpkg -i DEB_PACKAGE
# dpkg -r PACKAGE_NAME

;;To List all Installed Packages
# dpkg -l *.deb | less

;;To Remove a Package and its Configuration files
# sudo dpkg -P {package_name}

;;To check Wether the package installed are not
# dpkg -l {package_name}

;;show the Location
# sudo dpkg -S {package_name}

# man dpkg

# dpkg -x {package_name} {location_were_to_extract}

Debian installation of a package

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

;;----install sources-----
;; Now, first get the source package:
apt-get source foo
;;and change to the source tree:
cd foo-*
;;Then install needed build-dependencies (if any):
sudo apt-get build-dep foo
;;Then create a dedicated version of your own build (so that you won't get confused later when Debian itself releases a new version)
dch -l local 'Blah blah blah'
;;And finally build your package
debuild -us -uc
;;If everything worked out fine, you should now be able to install your package by running
sudo dpkg -i ../*.deb



$ tar zxf file.tar.gz
$ tar zxf file.tgz
$ tar jxf file.tar.bz2
$ tar jxf file.tbz2
$ tar xf file.tar.xz

;;Now change directory
$ ls
$ cd path-to-software/
# ./configure
# make
# make install

dpkg-source -x foo_version-revision.dsc

will extract the package into a directory called foo-version.

If you want just to compile the package, you may cd into foo-version directory and issue the command

 dpkg-buildpackage -rfakeroot -b

to build the package (note that this also requires the fakeroot package), and then

 dpkg -i ../foo_version-revision_arch.deb

to install the newly-built package(s).

Mail

$mail

To delete message 21
& d 21

To delete messages 1-10
& d 1-10

Only works if you exit properly:

& quit OR
& q

Share

Cloud backup

Introduction

In the past I have used Ubuntu One until it went out of business, then ownCloud, until it went out of business. I have been looking for a method to perform bidirectional backup to a directory on my Hostgator shared server. Osync initially looked promising, but SSHs into the server too many times, exceeding the 12 allowable attempts per IP per 90 seconds imposed by Hostgator. I fell back to rsync, and had to hack the “bidirectional” feature in an unsatisfactory way.

Rsync

See here for setting up SSH keys. The command to upload from a local directory ~/syncd/ to Hostgator, preserving directory structure:

1
2
3
4
5
cd ~/syncd/
rsync -avzP --delete --rsh='ssh -p2222' /home/mbc/syncd mbcladwell@123.123.123.123:/home2/mbcladwell/public_html/

;;for test
rsync -avzP --delete --rsh='ssh -p2222' mbcladwell@123.123.123.123:/home2/mbcladwell/public_html/lnsDFoKytr /home/mbc/

for cron edit the file using the command crontab:

1
2
3
#crontab -e

0,15,30,45 * * * * rsync -azp --delete --rsh='ssh -p2222' /home/mbc/syncd mbcladwell@123.123.123.123:/home2/mbcladwell/public_html/

\$ps aux to list PIDs
\$kill

crontab -l to see crons

flags

-q quiet - use with cron
-v verbose
-r recursive
-R relative
-t times must be used to transfer only modified files in future backups
-a equivalent to -rlptgoD
-o owner
-g group
-p permissions
-D devices - transfer char and block device info
-z compress
-P same as -partial -progress
-partial retain partially transferred files
-progress show progress (should also use -v )

Create 2 batch files, one for upload and one for download.
I will use the upload syntax to register a cron job. The job will run every 15 minutes and back up to the cloud.

rsync-upload.sh
1
2
3

#!/bin/bash
rsync -avzP --delete --rsh='ssh -p2222' /home/mbc/syncd mbcladwell@123.123.123.123:/home2/mbcladwell/public_html/
rsync-download.sh
1
2
3
#!/bin/bash
rsync -avzP --delete --rsh='ssh -p2222' mbcladwell@123.123.123.123:/home2/mbcladwell/public_html/syncd /home/mbc/

If I use a second computer, manually run rsync-download.sh upon login. When returning to the primary computer, again manually run rsync-download.sh to capture any changes made on the auxilliary machine. As a reminder, I created a batch file that will prompt me on login. Add a new autostart with the Applications / Settings / Settings manager / Session and startup / Application autostart dialog with the command: xfce4-terminal -e “bash /home/pl/check-for-download.sh” –hold

check-for-download.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

## xfce4-terminal -e "bash /home/pl/check-for-download.sh" --hold
## by default input assigned to the variable REPLY
echo "Run download script? [Y|n]:"
read

if [[ ("$REPLY" == "Y") || ( "$REPLY" == "" ) ]];
then
echo "starting download!"
./rsync-download.sh
else
echo "Download canceled."
fi

Backup to USB

I don’t want private keys in the cloud so I backup personal directories and files to a local USB.

keys-backup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

#!/bin/bash
rm -r /media/mbc/vol1/bin
rm -r /media/mbc/vol1/.electrum
rm -r /media/mbc/vol1/.electrum-ltc
rm -r /media/mbc/vol1/.gnupg
rm -r /media/mbc/vol1/.keystorefiles
rm -r /media/mbc/vol1/.password-store
rm -r /media/mbc/vol1/.ssh

cp -r /home/mbc/bin /media/mbc/vol1
cp -r /home/mbc/.electrum /media/mbc/vol1
cp -r /home/mbc/.electrum-ltc /media/mbc/vol1
cp -r /home/mbc/.gnupg /media/mbc/vol1
cp -r /home/mbc/.keystorefiles /media/mbc/vol1
cp -r /home/mbc/.password-store /media/mbc/vol1
cp -r /home/mbc/.ssh /media/mbc/vol1

lsyncd

http://blog.acipo.com/using-rsync-to-transfer-files-to-your-hostgator-account/

username: syncd@granitemtn.net
password: EW27&v&cd)z+

We can now restart the lsyncd service by issuing the following command:
sudo service lsyncd restart

sudo su
ssh remote_mirror_ip_address
ls /remotesync

http://www.cerebralmastication.com/2011/04/fast-two-way-sync-in-ubuntu/

Osync

https://github.com/deajan/osync

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ git clone https://github.com/deajan/osync
$ cd osync
# sh install.sh
[root@xps osync]# ./install.sh
Created directory [/etc/osync].
Copied osync.sh to [/usr/local/bin].
Copied osync-batch.sh to [/usr/local/bin].
Copied ssh_filter.sh to [/usr/local/bin].
Created osync-srv service in [/lib/systemd/system] and [/etc/systemd/user].
Can be activated with [systemctl start osync-srv@instance.conf] where instance.conf is the name of the config file in /etc/osync.
Can be enabled on boot with [systemctl enable osync-srv@instance.conf].
In userland, active with [systemctl --user start osync-srv@instance.conf].
osync installed. Use with /usr/local/bin/osync
In order to make install statistics, the script would like to connect to http://instcount.netpower.fr?program=osync&version=1.2-beta3&os=Linux%20unknown%20unknown%20GNU%2FLinux
No data except those in the url will be send. Allow [Y/n]

Test that I can SSH into my server:

1
mbc@dc7700s:~$ ssh -p 2222 mbcladwell@123.123.123.123

Now perform a test transfer before using the configuration file:

1
./osync/osync.sh --initiator="/home/mbc/syncd/" --target="ssh://123.123.123.123:2222//public_html" --rsakey=/home/mbc/.ssh/id_rsa

Set up the configuration file sync.conf with the following variables:

INITIATOR_SYNC_DIR=”/home/mbc/lnsDFoKytr”
TARGET_SYNC_DIR=”ssh://mbcladwell@123.123.123.123:2222//home2/mbcladwell/public_html”
SSH_RSA_PRIVATE_KEY=”/home/mbc/.ssh/id_rsa”

As mentioned above, osync repeatedly confirms SSH accessibility, exceeding the login limits allowed by my provider. Insert a sleep statement in the
CheckConnectivityRemoteHost function to slow the script down. Hostgator allows 12 SSH logins per 90 seconds, with a fresh allocation of logins every 90 seconds.

osync.sh
1
2
3
4
5
6
7

function CheckConnectivityRemoteHost {
sleep 10
local retval

.....etc.

Share

Leaf statistics

Electricity costs

October – May

Peak Off-peak discount
Distribution charge 0.08692 0.05353 0.38415
Transition charge 0.00224 0.00224
Transmission charge 0.07884 0
Energy conservation charge 0.0025 0.0025
Renewable energy charge 0.0005 0.0005
Totals 0.171 0.05877 0.65632

June – September

||||
|—|—-|—|—|
|Distribution charge |0.14089| 0.05456| 0.61275|
|Transition charge| 0.00224 |0.00224 ||
|Transmission charge| 0.10412| 0 ||
|Energy conservation charge |0.0025| 0.0025||
|Renewable energy charge| 0.0005| 0.0005| |
|Totals| 0.25025| 0.0598| 0.76104|

Efficiency of transferring energy to forward motion:
electric vehicle: 60%
gasoline vehicle: 20%

http://ev-sales.blogspot.com/2016/11/fast-charging-september-2016.html

Share