Playing around with responsive templates

Submitted by Jochus on Fri, 16/06/2017 - 10:42 | Posted in: Website
Posted in


In my free time, I was playing around with responsive templates. I just played around with this small example in which you can easily play with the different div elements:

.container div {
    width: 100px;
    height: 50px;
    display: inline-block;
}
 
.one { background: red; }
.two { background: orange; }
.three { background: yellow; }
.four { background: green; }
.five { background: blue; }
 
@media screen and (max-width: 531px) {
    .container { display: flex; flex-flow: column; }
    .five { order: 1; }
    .four { order: 2;  }
    .three { order: 3; }
    .two { order: 4; }
    .one { order: 5 }
}

<div class="container">
    <div class="one">I'm first</div>
    <div class="two">I'm second</div>
    <div class="three">I'm third</div>
    <div class="four">I'm fourth</div>
    <div class="five">I'm fifth</div>
</div>

Dell Inspirion 5510 failing dual monitor screen in combination with Dell WD 15 docking station on Ubuntu 16.04.LTS

Submitted by Jochus on Fri, 16/06/2017 - 10:27 | Posted in: Linux
Posted in


At work, I'm using a Dell Inspirion 5510 in combination with a Dell WD15 docking station. All my hardware/cables (mouse, keyboard, earphones, screens, network) are attached to the docking station. This is very handy, as the only thing I have to do to go home (or arrive at work) is to attach/detach the USB-C cable between the Inspirion and the WD15.

My operation system is Ubuntu 16.04.LTS. I was struggling a lot with the setup of my 2 external monitors. I use the mini-display port and the HDMI port. Whenever I attached my laptop to the WD15, screens turned blacked. The only solution was to restart my laptop. And then sometimes, I even had to reattach the cables (unplug, plug, unplug, plug, ...)

After some investigation, I found out I was using a kernel version which was too old. I did an upgrade to 16.10 by executing the following command:

$ sudo do-release-upgrade -d

After the upgrade, attaching screens goes very smoothly. Even when I go to a meetingroom with an external TV screen, the system knows how to recognize the correct hardware and restores the correct configuration set.

Copying a directory from a S3 bucket A in account X to a S3 bucket B in account Y on AWS

Submitted by Jochus on Fri, 17/02/2017 - 09:16 | Posted in: Java
Posted in


I had some issues copying data from bucket A to bucket B. Both of the buckets were in different AWS accounts. Copying of data was going fine, but on the target side, I never had the permissions to read the copied data.

I forgot to include the --acl property in my copy command

--acl (string) Sets the ACL for the object when the command is performed. If you use this parameter you must have the "s3:PutObjectAcl" permission included in the 
list of actions for your IAM policy. Only accepts values of private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-
owner-full-control and log-delivery-write. See Canned ACL for details

So the command I've executed:

$ aws s3 cp --recursive --acl authenticated-read s3://#BUCKET_A#/#PATH_TO_DIR# s3://#BUCKET_B/#PATH_TO_DIR#

Adding GIT branch in PS1 on terminal

Submitted by Jochus on Thu, 16/02/2017 - 11:23 | Posted in: Linux
Posted in


I've updated my PS1 variable to the content below. By doing this change, I'm printing the GIT branch I'm currently working on. As I am working on different projects, it helps me indicating if I'm working on the correct branch for a specific project or not:

Original value:

${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$

New value:
${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]\[\033[01;33m\]$(__git_ps1)\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$

So the part I've added (first block indicates the yellow color, second block executes the __git_ps1 command)

\[\033[01;33m\]$(__git_ps1)

Using deployed packages instead of development projects in Eclipse

Submitted by Jochus on Thu, 01/12/2016 - 14:42 | Posted in: Java
Posted in


Even though the Maven Eclipse plugin is retired, I still like using this plugin. There's sometimes one issue with the connection of projects in your Eclipse workspace.

By default, the Eclipse Plugin will create sub-projects for dependencies that exists in the reactor. If you don't want to work with the development code and prefer to use the deployed packages, you can still do so by disabling the project references like so:

mvn eclipse:eclipse -Declipse.useProjectReferences=false

Source: Prevent Project References

Changing keyboard layout from QWERTY to AZERTY at login screen on Windows 7

Submitted by Jochus on Thu, 01/12/2016 - 14:34 | Posted in: Windows
Posted in


I had the problem on a Windows 7 VM installation the keyboard layout was always set to QWERTY at the login screen. Once logged in, everything was AZERTY. So keyboard settings were configured correctly.

I solved the issue by updating the following registry entry:


HKEY_USERS\.DEFAULT\Keyboard Layout\Preload

Change the value to 00000813 (it was set to 00000419 in my case)

Temporary files in C:\ after installing Visual C++ 2008 Redistributable Package

Submitted by Jochus on Tue, 19/07/2016 - 10:33 | Posted in: Windows
Posted in


After installing the Visual C++ 2008 Redistributable Package, I've noticed a lot of files in the root of my C:\ partition. I noticed these temporary files are erroneously generated by the installer into the root directory of one of your drives, instead of the temp directory. These files are unnecessary and can be safely deleted from the system. The functioning of the runtime library will not be affected by this. Its a known bug and is fixed in VS2008 SP1.

The following files can be removed:

install.exe 
install.res.1028.dll 
install.res.1031.dll 
install.res.1033.dll 
install.res.1036.dll 
install.res.1040.dll 
install.res.1041.dll 
install.res.1042.dll 
install.res.2052.dll 
install.res.3082.dll 
vcredist.bmp 
globdata.ini 
install.ini 
eula.1028.txt 
eula.1031.txt 
eula.1033.txt 
eula.1036.txt 
eula.1040.txt 
eula.1041.txt 
eula.1042.txt 
eula.2052.txt 
eula.3082.txt 
VC_RED.MSI
VC_RED.cab 

Source: https://support.microsoft.com/en-us/kb/950683

Resizing disk drive in Ubuntu guest system, running on a Virtual Box Windows host sytem

Submitted by Jochus on Mon, 11/07/2016 - 10:08 | Posted in: Windows
Posted in

On the host machine (Windows)

  • Release the VDI file: File -> Virtual Media Manager -> Select VDI -> Release
  • Backup the VDI file
  • Open a command prompt and browse to:
    $ cd C:\Program Files\Oracle\VirtualBox
  • Resize your .vdi file:
    $.\VBoxManage modifyhd 'C:\Users\jochen\VirtualBox VMs\Ubuntu\Ubuntu.vdi' --resize 40000 # 40 GB disk
  • Startup your virtual machine

On the guest machine (Ubuntu)

  • Install & start gparted:
    $ sudo apt-get install gparted
    $ gparted
  • Get rid of the swap partition, which prevents you from expanding the root partition. Note that you cannot harm the rest of your machine - this is all happening inside a single file. Worst case scenario you trash this file and you have to use your backup instead.
  • Make a note of the size of the linux-swap partition 4 GB in my case
  • Right click on it and swapoff
  • Right click on it and Delete
  • Apply by clicking on the checkmark (Apply all operations). Ignore the warning
  • Right click on the extended file system that once housed the swap partition (/dev/sda2 in all likelihood) and delete it
  • Right click on the root partition (/dev/sda1) and resize it. Tab to the 'Free space following' field and enter the size of the swap partition. Shift-tab and the machine will work out the new size for you automatically
  • Right click in the unallocated space at the end and make it an extended partition
  • Right click in the new partition and select linux-swap in the File system field.
  • Commit your changes as before
  • Right click on your swap partition and select swapon