Today I upgraded my Vagrant and VirtualBox to the latest version (1.8.1 & 5.0.12-104815) and did the vagrant up.
I got this from Vagrant:
==> default: Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.
If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run `vagrant up` while the
VirtualBox GUI is open.
The primary issue for this error is that the provider you're using
is not properly configured. This is very rarely a Vagrant issue.

When I tried to start this box from VirtualBox I got this error message:
'HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #2' (VERR_INTNET_FLT_IF_NOT_FOUND).

Solution was to remove VirtualBox and install it again with the following parameter:
-msiparams NETWORKTYPE=NDIS5

, , , , ,

The guide below will help you to install latest version of JIRA (at the time of writing this article – version 7) in the VirtualBox VM, using Vagrant and Chef.
We won’t be creating any Chef cookbooks, we’ll just re-use the existing jira cookbook from the Chef supermarket.
We will also be using Berkshelf to handle the cookbook dependencies for us and Vagrant bento/centos-6.7 box that is available on hashicorp site, but you should be able to use any other Vagrant box as long as the jira cookbook supports it.

1. Install VirtualBox

  • I recommend using version 4.3 as version 5 still seems bit unstable to me.
  • You can disable VirtualBox updates to stay on 4.3. Use GUI or this:
    1
    
    VBoxManage setextradata global GUI/UpdateDate never

2. Install Vagrant

  • I recommend installation of the vagrant-vbguest plugin to recompile guest additions:
    1
    
    vagrant plugin install vagrant-vbguest
  • If you’re behind proxy, install also vagrant-proxyconf plugin:
    1
    
    vagrant plugin install vagrant-proxyconf

3. Install ChefDK (Berkshelf)
4. Install vagrant-berkshelf plugin:

1
vagrant plugin install vagrant-berkshelf

5. Create some directory and go to that directory:

1
2
mkdir jira
cd jira

6. Create Berksfile – jira/Berksfile:

1
2
source "https://supermarket.chef.io"
cookbook 'jira', '~> 2.7.0'

7. Create Vagrantfile – jira/Vagrantfile:

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
Vagrant.configure(2) do |config|
  # I am using centos-6.7 box, but others should work too...
  config.vm.box = "bento/centos-6.7" 
  config.vm.network "forwarded_port", guest: 8080, host: 8080
  config.vm.network "forwarded_port", guest: 443, host: 443
  config.vm.network "private_network", type: "dhcp"
  config.vm.provider "virtualbox" do |vb|
  # I am using 2GB of ram and 4 cpus as JIRA is resource hungry, adjust as needed
  # natdnshostresolver1 means that VirtualBox will use your host DNS to resolve hostnames
  vb.memory = 2048
     vb.cpus = 4
     vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
  end
  # enable Berkshelf, the Chef dependency management
  config.berkshelf.enabled = true
  # use jira cookbook to provision this box
  # jira cookbook will also create mysql database by default
  # mysql server password is mandatory for jira cookbook, otherwise the provisioning will fail, change it if you need to or leave it as it is
  config.vm.provision "chef_solo" do |chef|
    chef.add_recipe "jira"
    chef.json = {
    "mysql" => {
      "server_root_password" => "mysql"
    }
  }
  end
  # if you're using proxy and you installed vagrant-proxyconf plugin, set it up here
  if Vagrant.has_plugin?("vagrant-proxyconf")
    config.proxy.http     = "http://someproxy:8080"
    config.proxy.https    = "http://someproxy:8080"
    config.proxy.no_proxy = "localhost,127.0.0.1"
  end
  # optional - ssh agent forwarding
  config.ssh.forward_agent = true
end

8. You should now have the following structure:

1
2
3
+ jira/
++ Berksfile
++ Vagrantfile

9. Run Vagrant and let the provisioning finish:

1
vagrant up

10. Open browser and navigate to http://localhost:8080 or https://localhost

Note:
If there a is problem with JIRA startup because of some plugin timeout, increase the plugin startup timeout in /opt/atlassian/jira/bin/setenv.sh:

1
JVM_SUPPORT_RECOMMENDED_ARGS="-Datlassian.plugins.enable.wait=300"

Enjoy!

, , , , , , , ,

Very interesting reading on Docker vs Chef:
https://blog.relateiq.com/why-docker-why-not-chef/

, , ,

If you’ve created your VirtualBox VM with VDI that dynamically allocates space, you should know that the VDI size is not the same as the size of your VM guest filesystem. VDI size equals to the max. size your guest filesystem ever had and VirtualBox is not shrinking it back automatically. To shrink it back to the guest filesystem size, do the following:

Boot into your VM from Linux live CD/DVD
This step is not required if you you’re not going to shrink root filesystem.

I’ve used Oracle Enterprise Linux 6 iso with rescue mode.
You can use any Linux live CD/DVD that has dd and vgchange (for LVM) utilities. Most of them do.

Fill the empty space on each volume
If you’re using LVM, first do the following:

1
2
3
4
# to see the volumes in /dev/mappper
vgchange -a y       
# list the volumes
ls /dev/mapper

Following applies to any volume that can be mounted by your Linux live CD/DVD.
Create mount point for volume:

1
mkdir /mnt/root

Mount volume:

1
2
3
mount /dev/mapper/your_lvm_lv /mnt/root
# e.g. /dev/mapper/vg_oel-lv_root /mnt/root
# or for non LVM, e.g. mount /dev/sda1 /mnt/root

Change directory to the mounted volume:

1
cd /mnt/root

Fill empty space with zeroes:

1
2
# this may take some time
dd if=/dev/zero of=empty.file

Remove the file:

1
rm empty.file

Sync filesystem:

1
sync

Change the directory:

1
cd

Unmount the volume:

1
umount /mnt/root

Do the same for other volumes…
Shutdown the VM:

1
shutdown -h now  # or halt if you're missing shutdown command

Shrink/Compact the VDI

1
VBoxManage modifyhd --compact your.vdi

VBoxManage can be found in VirtualBox installation directory. I’ve put it to the PATH so that I can run VBoxManage from everywhere.

Enjoy!

, , , , ,

Install EPEL and NUX repositories

1
rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-1.noarch.rpm
1
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm

Install VLC

1
yum install vlc

Enjoy!

, , , ,

Optional: Remove GNOME
Note: It’s probably better to run Minimal installation and then install MATE, but if you already installed GNOME, this is the way to get rid of it.

Following command will remove all gnome packages excluding MATE dependencies.
WARNING: Your X session will be terminated during the removal of some GNOME packages, so it’s better to run the following command from another terminal (e.g. Ctrl+Alt+F2).

If you want to confirm removal of each package, exclude the ‘-y’ in the yum command below.

1
for i in `yum list installed|grep gnome|grep -v -E 'libgnome|gnome-icon-theme|gnome-keyring|gnome-themes-standard'|awk '{print $1}'`; do yum -y remove $i; done

Install EPEL

1
rpm -Uvh http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

Install MATE

1
yum groups install "MATE Desktop"

Replace GDM with LightDM

1
2
systemctl disable gdm.service
systemctl enable lightdm.service

Reboot and select MATE in the LightDM settings (icon is in the upper right corner of login screen).

Enjoy!

, , , ,

Using only netcat (only files)
Transfer file from source to target – netcat listens on source
Source:

1
nc -l $source_port < file

Target:

1
nc $target_hostname $target_port > file

Transfer file from source to target – netcat listens on target
Target:

1
nc -l $port > file

Source:

1
nc $target_hostname $target_port < file

Using netcat and tar:
Transfer directory from source to target – netcat listens on source
Source:

1
tar -cf - /path/to/directory | nc -l $source_port

Target:

1
nc $target_hostname $target_port | tar -xf -


Transfer directory from source to target – netcat listens on target

Target:

1
nc -l $port | tar -xf -

Source:

1
tar -cf - /path/to/directory | nc $target_hostname $target_port>

Using lftp
FTP:
1/ Setup connection

1
lftp -d -u $user,$password $source_hostname

2/Set the following parameters

1
2
lftp:>set ftp:ssl-allow no    (this will turn off ssl, enabled by default)
lftp:>set ftp:passive-mode no (this will disable passive mode, enabled by default)

3/ Mirror whole directory

1
lftp:>mirror --use-pget-n=10 --parallel=10  /copy_from_directory /copy_to_directory (this will download 10 files in parallel using max possible bandwidth)

SSH:
1/ Setup connection

1
2
3
lftp
lftp :~> set sftp:connect-program "/usr/bin/ssh -a -x -v"    // not required, but sometimes needed
lftp :~> open -d -p $port -u $user,$password sftp://$source_hostname

2/ Download 10 files in parallel (-P 10) and use 10 connections for each file (–use-pget-n=10)

1
lftp:> mirror --use-pget-n=10 --parallel=10 /copy_from_directory /copy_to_directory

For upload use -R (reverse) option.

,

Install Ruby
Download stable Ruby version from here and install.

Install Compass CSS Authoring Framework (Ruby)

1
gem install compass

Install Node.js
Download node.js from here and install.

Install Yeoman

1
npm install -g yo

Install Ember project generator

1
npm install -g git://github.com/yeoman/generator-ember.git

Create a project

1
2
3
mkdir demo
cd demo
yo ember

If asked for “Would you like to include Twitter Bootstrap for Sass?”, hit “y”.

Run the server

1
grunt serve

Very helpful cheat sheet created by BalusC.

1
2
3
4
5
fc = FacesContext
vh = ViewHandler
in = UIInput
rq = HttpServletRequest
id = in.getClientId(fc);

1 RESTORE_VIEW

1
2
String viewId = rq.getServletPath();
fc.setViewRoot(vh.createView(fc, viewId));


2 APPLY_REQUEST_VALUES

1
in.setSubmittedValue(rq.getParameter(id));


3 PROCESS_VALIDATIONS

1
2
3
4
5
6
7
8
9
10
11
12
13
Object value = in.getSubmittedValue();
try {
   value = in.getConvertedValue(fc, value);
   for (Validator v : in.getValidators())
      v.validate(fc, in, value);
   }
   in.setSubmittedValue(null);
   in.setValue(value);
} catch (ConverterException | ValidatorException e) {
   fc.addMessage(id, e.getFacesMessage());
   fc.validationFailed(); // Skips phases 4+5.
   in.setValid(false);
}

4 UPDATE_MODEL_VALUES

1
bean.setProperty(in.getValue());

5 INVOKE_APPLICATION

1
bean.submit();

6 RENDER_RESPONSE

1
vh.renderView(fc, fc.getViewRoot());

Few months ago one colleague of mine told me that the best way of aligning a satellite dish is to use a phone that connects to the dreambox using wifi. I remembered this yesterday when it was so windy I completely lost signal. I didn’t want to pay some guy 30 euros for dish alignment (again) so I tried it on my own. To my surprise none of the free apps on Google Play actually worked so after some googling I found that the built in Dreambox app called dvbsnoop can also show you the signal. That’s when I got the idea: Why not connecting to the Dreambox using some ssh client and run the dvbsnoop command. It worked perfectly.

So here’s how to do it:

  1. Set the transponder of your choice on the Dreambox. I use Lyngsat.
  2. Set the elevation, azimuth and skew of your dish based on this site:
    • Elevation setup is easy, you have the scale written on your dish.
    • For azimuth setup I prefer this app.
    • I just ignored the skew part as it’s only 2.0° for my location. If you need to set it up, google some howto.
  3. Install from Google Play some SSH client on your phone/tablet. I prefer this app.
  4. SSH to your Dreambox.
  5. Run the following command to see the signal:
    1
    
    dvbsnoop -pd 3 -s signal

Try to get the highest SNR value and BER 0. SNR value around 3500 is about 85% of signal strength.

Good luck aligning your dish!