local$ ssh root@SERVER_IP
add swap if RAM+swap is less than 2 GB
this is a short version of these two guides: Bitnami low memory & Digital Ocean swap guide
# free -m | grep Swap
Swap: 0 0 0
# dd if=/dev/zero of=/myswap count=1024 bs=1MiB
# chmod 600 /swapfile
# ls -lh /swapfile
-rw-------. 1 root root 1.0G Jan 19 19:05 /swapfile
# mkswap /swapfile
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=ed94f556-38a2-43de-a64b-a3829e85dbd0
# swapon /swapfile
# free -m | grep Swap
Swap: 1023 0 1023
# sysctl vm.swappiness=10
vm.swappiness = 10
#echo "/mnt/swap.0 swap swap defaults 0 0" >> /etc/fstab
# reboot
...# free -m | grep Swap
Swap: 1023 0 1023
# yum install perl perl-Data-Dumper
# perl
Ctrl+D
needed at least for haveged below
# yum install epel-release
Without this Tomcat may take forever to start (issue with SessionIdGeneratorBase - createSecureRandom). Details here.
# yum install -y haveged # chkconfig haveged on
# reboot
# curl --remote-name --location https://bitnami.com/redirect/to/168422/bitnami-tomcatstack-8.5.24-2-linux-x64-installer.run
# chmod +x bitnami-tomcatstack-8.5.24-2-linux-x64-installer.run
# ./bitnami-tomcatstack-8.5.24-2-linux-x64-installer.run
# /opt/tomcatstack-8.5.24-2/ctlscript.sh start
http://SERVER_IP should show Bitnami's "welcome" page
# cp /opt/tomcatstack-8.5.24-2/ctlscript.sh /etc/init.d/bitnami-tomcat
# vi /etc/init.d/bitnami-tomcat
#!/bin/sh
#
# chkconfig: 2345 80 30
# description: Bitnami services
# chkconfig --add bitnami-tomcat
# reboot
# yum install putty
# mkdir /opt/letsencrypt
# cd /opt/letsencrypt
# curl -O https://dl.eff.org/certbot-auto
# ./certbot-auto
# ./certbot-auto renew
# crontab -e
44 0,12 * * * /opt/letsencrypt/certbot-auto renew
]]>
This is a setup I use for development environments, not recommended for production!
$ sudo su
$ sudo init 0
By default resources allocated to the VM are quite scarce. Depending
on the use it will have and the resources on your host machine you may
want to increase them. My setup includes:
Stop the VM for adjusting them.
With this mode the VM can communicate in all directions. Limitation: the virtual adapter needs to be attached to a physical WiFi (AirPort) adapter. Configure this mode in the VM's Settings - Network - Adapter 1.
If you don't need the VM to access the internet you can configure it in this way.For that we need to create a host-only adapter. In Global Tools - Host Network Manager create one with default parameters & enable DHCP. The first one gets by default the name vboxnet0 and the IP range 192.168.56.x
. Then in VM's Settings - Network - Adapter 1 select Host-only adapter and vboxnet0.
I find it convenient to have SSH enabled so I can access the VM
from a terminal Window. Partly because without GUI the default console is very limited: no
window resize, no clipboard integration...
https://docs.bitnami.com/virtual-machine/faq/#how-to-connect-to-the-server-through-ssh
VM:
$ sudo rm -f /etc/ssh/sshd_not_to_be_run
$ sudo systemctl enable ssh
$ sudo systemctl start ssh
$ sudo ifconfig | grep 192
... inet 192.168.x.x ...
ssh bitnami@192.168.x.x
This is optional but quite convenient in a development setup. Specifically I use the shared folders feature with the host so changes in code I make on macOS are immediately available within the VM.
bitnami@debian:~$ uname -a
Linux debian 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64 GNU/Linux
the default DNS resolver was not working so I had to fix it using a Google's one.
$ sudo vi /etc/resolv.conf
...
nameserver 8.8.8.8
...
$ sudo apt-get -y install dkms build-essential linux-headers-4.9.0-6-amd64
$ sudo reboot
$ sudo mkdir /mnt/cdrom
$ sudo mount /dev/cdrom /mnt/cdrom
$ cd /mnt/cdrom
$ sudo sh ./VBoxLinuxAdditions.run --nox11
bitnami@debian:/mnt/cdrom$ ps -ef | grep VBoxService | grep -v grep
root 5447 1 0 11:46 ? 00:00:00 /usr/sbin/VBoxService --pidfile /var/run/vboxadd-service.sh
$ sudo umount /dev/cdrom
$ init 0
$ mount | grep media
$ sudo ls /media/*
$ sudo usermod -a -G vboxsf bitnami
Bitnami docs instruct to use an ssh tunnel to access phpMyAdmin, but I prefer to just allow access from the local network.
$ vi /opt/bitnami/apps/phpmyadmin/conf/httpd-app.conf
replace: Require local
by Require ip 192.168
$ /opt/bitnami/ctlscript.sh restart apache
Verify it works: http://192.168.x.x/phpmyadmin/
Following this guide: https://docs.bitnami.com/installer/infrastructure/lamp/#how-can-i-add-applications-on-top-of-lamp
Obtain the module download URL from https://bitnami.com/stack/lamp/modules
$ cd
$ pwd
/home/bitnami
$ cat bitnami_credentials
*** contains MySQL root password used below ***
$ exec sh /opt/bitnami/use_lampstack
$ curl --remote-name --location https://bitnami.com/redirect/to/186012/bitnami-wordpress-4.9.5-0-module-linux-x64-installer.run
$ chmod +x ./bitnami-wordpress-4.9.5-0-module-linux-x64-installer.run
$ sudo ./bitnami-wordpress-4.9.5-0-module-linux-x64-installer.run
installer asks for the following data:local$ ssh root@SERVER_IP
add swap if RAM+swap is less than 2 GB
this is a short version of these two guides: Bitnami low memory & Digital Ocean swap guide
# free -m | grep Swap
Swap: 0 0 0
# dd if=/dev/zero of=/swapfile count=1024 bs=1MiB
# chmod 600 /swapfile
# ls -lh /swapfile
-rw-------. 1 root root 1.0G Jan 19 19:05 /swapfile
# mkswap /swapfile
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=ed94f556-38a2-43de-a64b-a3829e85dbd0
# swapon /swapfile
# free -m | grep Swap
Swap: 1023 0 1023
# sysctl vm.swappiness=10
vm.swappiness = 10
#echo "/mnt/swap.0 swap swap defaults 0 0" >> /etc/fstab
# reboot
...# free -m | grep Swap
Swap: 1023 0 1023
The MySQL installer requires perl and the perl Data::Dumper module.
# yum install perl perl-Data-Dumper
# perl
Ctrl+D
# adduser lampy
# passwd lampy
# su lampy
$ cd
$ pwd
/home/lampy
$ curl --remote-name --location https://bitnami.com/redirect/to/181565/bitnami-lampstack-7.1.15-0-linux-x64-installer.run
$ chmod +x bitnami-lampstack-7.1.15-0-linux-x64-installer.run
$ ./bitnami-lampstack-7.1.15-0-linux-x64-installer.run
$ /home/lampy/lampstack-7.1.15-0/ctlscript.sh start
$ /home/lampy/lampstack-7.1.15-0/uninstall
$ rm -rf /home/lampy/lampstack-7.1.15-0/
http://SERVER_IP:8080
should show Bitnami's "wellcome" page
# cp /home/lampy/lampstack-7.1.15-0/ctlscript.sh /etc/init.d/bitnami-lamp
# vi /etc/init.d/bitnami-lamp
#!/bin/sh
#
# chkconfig: 2345 80 30
# description: Bitnami services
runuser...
# chkconfig --add bitnami-lamp
# reboot
/Applications/bitnami-tomcat
/Applications/bitnami-tomcat/manager-osx.app)
$ sh /Applications/bitnami-tomcat/use_tomcatstack
/Applications/bitnami-tomcat/apache-tomcat/webapps/
The guide above has a paragraph "How To Create A Custom Java Application?". That didn't work for me. Instead, much simpler to drop the app's war file to /Applications/bitnami-tomcat/apache-tomcat/webapps/
A quick guide of what worked for me.
Geth is the official implementation that allows you to run an Ethereum node. There are several others.
I installed it with Homebrew based on the official geth guide for macOS.
Homebrew installation:
$ su admin
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Geth installation:
$ su admin
$ brew tap ethereum/ethereum
$ brew install ethereum
Verify (as regular user):
$ geth
Warning: this worked for me on macOS as of August 2017. Over time you can expect some/most/all of the information here to have changed.
There are several testnets, a number of them old/deprecated. The latest seem to be Kovan and Rinkeby. Kovan seems to work only with Parity while Rinkeby seems to work only with geth.
You will need to install geth first.
I mostly followed this guide.
I tried first the experimental light mode but I got errors, so I tried with the full mode. Not a big deal at this moment because the size on disk is below 1GB and it took around one hour to download/build with a 2011 macbook Air.
I prefer to make the data directory explicit (where the blockchain files will be stored), so I first create one on a disk of my choice. Also I will work from that directory, so I will assume all commands are entered from it.
$ mkdir /path/to/rinkeby
$ cd /path/to/rinkeby
intitalise with genesis block
$ curl -O https://www.rinkeby.io/rinkeby.json
$ geth --datadir=. init rinkeby.json
load blockchain
$ geth --networkid=4 --datadir=. --ethstats='yournode:Respect my authoritah!@stats.rinkeby.io' --bootnodes=enode://a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf@52.169.42.101:30303?discport=30304 --cache=1024
Wait. You will see the INFO message "Block synchronisation started" then many INFO lines starting with "Imported...". Sync is in progress...
While the node is up & running (the above command) you can get info about the blockchain sync progress (among other data) through the JavaScript console. In another terminal window type:
$ cd /path/to/rinkeby
$ geth attach ipc:geth.ipc
At the ">" prompt you can type, e.g.
> eth
> eth.syncing
> adm
> adm.peers
You can double check you are seeing the right data progress by looking at the last block at www.rinkeby.io home page.
Note that the "NOTE...Importing..." messages include a number parameter which is the block being processed.
Create a testing account
Create an account, enter password, get its address (account data will be saved to keystore/):
$ geth --datadir=. account new
...(enter password):..
Address: {559b0e5a899d9ef4c04ee35ccbefab2e6d7f06da}
That is the address I got. In order to use the faucet & get ether into this account, first create a github gist with just the hash in it (remember to prepend with "0x"). In my case:
Now use your gist URL in the faucet feature at www.rinkeby.io
I requested 3 ETH, then I searched etherscan with my address to verify I got them:
https://rinkeby.etherscan.io/address/0x559b0e5a899d9ef4c04ee35ccbefab2e6d7f06da
Next verification step would be to verify that locally we also get the correct balance.
We first verify it is taking the accounts we created (files in keystore/)
> eth.accounts
["0x559b0e5a899d9ef4c04ee35ccbefab2e6d7f06da", "0x62c8681441620cb0574fcee27d6085529067b8da"]
The first one (index 0) is the one I got my 3 ETH, let's see if they are on our local blockchain (balance for account 0):
> web3.fromWei(web3.eth.getBalance(web3.eth.accounts[0]));
3
great!
Now we may keep using geth, or a wallet for a nice UI.
]]>This was tested on macOS El Capitan, with Pyhton 2.7 and Mercurial 4.2.2
It can be installed with Python's package installer pip.
Install pip first:
$ wget https://bootstrap.pypa.io/get-pip.py
$ python get-pip.py
$ sudo pip install mercurial
$ sudo pip install hg-git
Enable the extension:
$ vi ~/.hgrc:
[extensions]
hggit =
create SSH key (details)
ssh-keygen -t rsa -b 4096 -C "someone@example.com"
add it to your github account (details)
$ pbcopy < ~/.ssh/id_rsa.pub
create empty github repository
$ mkdir myrepo
$ cd myrepo
$ hg init
$ vi .hg/hgrc
[ui]
username = Someone Example
<someone@example.com>
[paths]
default = git+ssh://git@github.com/someoneaccount/myrepo.git
hg addremove
hg commit
hg bookmark -r default master
hg push
Integrate locally changes made on github
hg pull -u
We are building a team that will participate in the startup acceleration program by Bbooster.
This is an intensive program of 4 months (June to September), at the end of which we expect to get funding (65% of the projects got it in past editions and we believe ours is among the best :-).
Ideally full-time on-site in Valencia as a founder, but we are also open to some other kind of collaboration like part-time or remote.
The project will be an internet portal initially focused in the tourism sector and collaborative economy.
Current team members have expertise in business, marketing and backend development. We need to cover the graphical design/UI/front end area.
Interested? Contact me on Linkedin
This worked for me on version 18.1 Serena Xfce
sudo apt-get install apache2
Verify: open browser with URL http://localhost/
If you administer an email server as I do, it's very useful to have an automated monitoring system that checks often that it works properly.
My first try on any new feature I want to add to my non-fatally-critical systems is to use an external service, specially if it can be done for free. Whereas there is a number of server monitoring services, most don't include roundtrip email monitoring, at least on their free plan.
The only one I found to include it is...
]]>You want to force any URL that doesn't include either:
RewriteEngine On
RewriteBase /RewriteCond %{HTTP_HOST} ^domain.com$ [NC]RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]RewriteCond %{HTTPS} offRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
comes from part 1
As it already "does something" we will continue with the demo app.
]]>I use MAMP+Mercurial+Eclipse as PHP development environment on Mac OS X. These are instructions for this environment adapted from https://symfony.com/doc/current/book/installation.html
Our product intends to save you a significant amount of your time, and spare you the difficulties of a manual process. As explained in my previous post “How to create PDF files from XML with Apache-FOP”, XSL-FO and Apache-FOP provide a free and standard way to create PDF files in a language independent manner.
But
there are a number of disadvantages with that approach, e.g.:
In order to overcome these drawbacks, at J4L Components we have developed J4L FO Designer. The designer is a Visual (WYSIWYG) editor that will generate XSL-FO files for you. This makes the start into the XSL-FO world very easy, and it is also a useful tool for experienced developers since you can create and test XSL-FO files very quickly.
]]>Este procedimiento sirve para cuando tenemos una cuenta de Gmail y queremos usar Gmail como servicio para gestionar otras cuentas que no son de Google, sin tener que decir a nuestros contactos que hemos cambiado de correo. Es decir para nuestros contactos no cambia nada: siguen usando nuestra dirección de correo que conocen. Para nosotros cambia que usamos el servicio de Gmail para gestionar este correo y, aunque sigue activo, ya no necesitamos usar el servicio del proveedor original.
Repitiendo este procedimiento se pueden integrar varias cuentas externas en una ÚNICA cuenta gratuita de Gmail. También se puede repetir usando varias cuentas independientes de Gmail gratuito. Si se desea un servicio unificado para la gestión de diversas cuentas de una organización con Gmail, deberá contratarse el servicio de pago "Google Apps".
Entrar en la configuración de la cuenta
Clic en Cuentas e importación y en el apartado "Enviar correo como" , clicar en Añadir otra dirección de correo electrónico
Nowadays, XML is the native format of many applications, Oracle APEX for example, partly bases its reporting systen on XML. Middleware as Oracle BPEL, SAP PI, IBM Websphere and of course many Web services are also XML based. XML is also being used as exchange format in business to business transactions, for example for e-Invoicing. In these and many other environments there is often the need to create PDF files from XML.
In the past PDF files would be created using proprietary reporting tools that would use a database as data source. Additionally these tools are programming language specific. Later on the XSL-FO standard allowed for a better way to do it in many cases.
What is new about XSL-FO?
- it is programming language neutral.
- it is a standard so you are not tied to a vendor.
- it uses XML as data source.
One implementation of the XSL-FO standard is Apache FOP. One important aspect about this implementation is that the Apache license model allows to use it in commercial environment.
Many free/open source products have a license model that puts strong restrictions on the way you may use the software. Not surprisingly there are software companies that do not allow the use in their code any open source software other than Apache Foundation one. So if you use Apache you know you are on the safe side.
I was intrigued about all the buzz around the Rails framework and the Ruby language, so I thought it was the time to check it out by myself and start by learning Ruby. So, as I usually do, I assigned myself some specific learning task: in this case porting the J4L barcoding software from PHP (which in turn was ported from Java).
]]>During 2010 I worked mostly on this project. J.M.E., the web designer, and I worked with Iker Marcaide to develop the first version of the international money transfer web application, which was launched around June, just in time to win the "HiT Barcelona global technological innovation summit".
This initial web application was developed using the Zend Framework.
It was very exciting to participate in this project and contribute to its early success!
]]>