Start hexo forever

Forever is a simple CLI tool for ensuring that a given script runs continuously (i.e. forever).

1
2
cd location_of_blog_conf_hexo
forever start --uid blog --append -c 'hexo server -p 6000' ./

Create a cron to handle restart

1
2
$ crontab -u root -e
@reboot sudo /usr/local/bin/forever start --uid blog --append -c 'hexo server -p 6000 --cwd /pathtoblog' /pathtoblog

vuejs

Installation

1
2
3
4
5
6
7
8
# install vue-cli
$ npm install --global vue-cli
# create a new project using the "webpack" template
$ vue init webpack my-project
# install dependencies and go!
$ cd my-project
$ npm install
$ npm run dev

Bug on Git Jul 2017

You must update git to last version

Update details

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
connect: reject ssh hostname that begins with a dash
When commands like "git fetch" talk with ssh://$rest_of_URL/, the
code splits $rest_of_URL into components like host, port, etc., and
then spawns the underlying "ssh" program by formulating argv[] array
that has:

- the path to ssh command taken from GIT_SSH_COMMAND, etc.

- dashed options like '-batch' (for Tortoise), '-p <port>' as
needed.

- ssh_host, which is supposed to be the hostname parsed out of
$rest_of_URL.

- then the command to be run on the other side, e.g. git
upload-pack.

If the ssh_host ends up getting '-<anything>', the argv[] that is
used to spawn the command becomes something like:

{ "ssh", "-p", "22", "-<anything>", "command", "to", "run", NULL }

which obviously is bogus, but depending on the actual value of
"<anything>", will make "ssh" parse and use it as an option.

Prevent this by forbidding ssh_host that begins with a "-".

Noticed-by: Joern Schneeweisz of Recurity Labs
Reported-by: Brian at GitLab
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Como actualizar git en centos:

1
2
3
yum install http://opensource.wandisco.com/centos/6/git/x86_64/wandisco-git-release-6-1.noarch.rpm
yum install git
git --version

SQL update latest entry

Update rows according to an effective date.

1
2
3
4
5
6
7
8
9
UPDATE table 
SET activo = 0
FROM table t1
INNER JOIN
(SELECT id,max(fechamodificacion) as LatestDate FROM table
GROUP BY id) t2
ON t1.id = t2.id and t1.fechamodificacion < t2.LatestDate
--for last row only use: t1.fechamodificacion = t2.LatestDate
--where