Categories
quick tips

How to keep a Docker container alive

To debug a Docker container, I was looking for a way to keep the container up and running to inspect it.

Basically, I wanted to bash into the container to verify some changes I made. After fiddling around for a while, I found a simple way to do so . In my case, the only package installed was bash. Eventually, there are few services you could use to keep the container running. However, you can use simply use tail the following way

ENTRYPOINT ["tail", "-f", "/dev/null"]

in the Dockerfile to keep the container up after ist started.

Categories
quick tips

Animated Icons

As you might know, I subscribed The Noun Project as my ultimate source for icons. I use them for presentations, lectures and sometimes web sites. It’s a lifesaver for me.

Recently I received a newsletter which pointed me to a tutorial on how to create animated icons. It’s quite a good tutorial and if you are in the need to create animated icons this might be something for you. As I am not very gifted with these tools, I just leave it here in case I need it at a point later in time.

Link: https://blog.thenounproject.com/how-to-create-animated-gif-with-icons-a9eb757948b3

Categories
quick tips

Log into dockerized MySQL

From time to time there is the need to log into a containerized MySQL instance. And of course, when this time comes, I have completely forgotten how this works. Consequently, I should write it down. Here you go:

Bash into the running container

docker exec -t -i <container_id> /bin/bash

Usually, you should end up with something like the following:

root@localhost:~# docker exec -t -i 365a8a95c335 /bin/bash
root@365a8a95c335:/#

Log into MySQL

mysql -u “<useranme>” -p

Once again, it should look similar to the following:

root@365a8a95c335:/# mysql -u "wpuser" -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g. 
Your MySQL connection id is 146
Server version: 5.7.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement

mysql>

Now you should be able to do whatever you want to do with MySQL.

Categories
quick tips

Kubernetes Icon Set

When you need a proper set of Kubernetes icons, just pick them up at GitHub.

This Repo contains a full set of Kubernetes icons to be used under Apache-2.0 or CC-BY-4.0.

You will find png and svg files as well as an extensive Google slide deck with additional information,

Categories
quick tips

Subtle change the Colors of your Visual Studio Code

While I was just writing about using different color schemes for multiple VS Code instances, I just learned about a VS Code extension called Peacock by John Papa which does this job for you.

 A Visual Studio Code extension that subtly changes the workspace color of your workspace. Ideal when you have multiple VS Code instances and you want to quickly identify which is which.

I’ll probably give it a try as VS Code is used on my machine meanwhile for almost anything I write.

Categories
quick tips

Using Different Color Themes in VS Code

As Visual Studio Code became my main editor, I often have more than one VS Code window open. This gets confusing after some time. To keep track in which project you are currently working, I thought of using different color themes by project.

As usual, once you know the trick, this is quite easy.
Navigate to File / Preferences / Settings and select the Workspace tab.

The setting for the Color Theme you choose here will be used whenever this particular folder is opened. That way you can easily distinguish between open Visual Studio Code windows.

Categories
quick tips

SQL Joins Made Easy

I recently came along this great cheat sheet explaining SQL joins. Doe’s not need nay further explanation, though…

SQL Joins

 

Categories
quick tips

Bookmark Backup

Today, TechCrunch reported about Yahoo shutting down the widely used bookmark  service del.icio.us.Right after this, a statement from Yahoo showed a possible alternate future of the service.

Many of you have read the news stories about Delicious that began appearing yesterday. We’re genuinely sorry to have these stories appear with so little context for our loyal users. While we can’t answer each of your questions individually, we wanted to address what we can at this stage and we promise to keep you posted as future plans get finalized.

However, who still wants to quick backup his/her boomarks could use curl following the tips from Martin Koser:

curl --user username:password -o DeliciousBookmarks.xml -O "http://api.del.icio.us/v1/posts/all"
Categories
quick tips

External Applications in MWPSK

My Web Page Starter Kit is a lightweight content management system, entirely written in ASP.NET 2.0. It comes with a wide range of components that can be easily arranged and set up. However, it seems there is no possibility to include external application into the navigation structure of MWPSK.

In the following example you will learn how to integrate a application using the URI http://blog.example.org into a website using MWPSK at http://www.example.org.

Log into the site and navigate to select Administration / Pages and Navigation. Select New Page to create a new

My Web Page Starer Kit - New Page

Choose a virtual path such as blog. This will allow you to use a new URI in the form of http://www.example.org/blog.aspx.

Now open the global.asax file located in the root folder of your MWPSK installation and add the following method.

void Application_BeginRequest(object sender, EventArgs e)
{
    if (HttpContext.Current.Request.Url.ToString().ToLower().Contains
         ("www.example.org/blog.aspx"))
    {
        HttpContext.Current.Response.Status = "301 Moved Permanently";
        HttpContext.Current.Response.AddHeader("Location",
            Request.Url.ToString().ToLower().Replace(
                "www.example.org/blog.aspx",
                "blog.example.org/"));
    }
}

This will cause an URL rewrite of the HTTP-request, which is then sent to the external application at http://blog.example.org.

Categories
quick tips

Visual Studio XAML View

For a while, I am working on a project where I use WPF to its limits. Unfortunately, Visual Studio has its limitations in rendering the stuff we do here.

We started with Visual Studio 2005, without any native support for XAML in Visual Studio doing a lot of the work in Notepad2, using one CTP after another including Visual Studio 2008 Beta 2 up to the final version of Visual Studio 2008. Things became better over time, however, I wished simply to switch off the Design view in in Visual Studio.

Hidden in the Visual Studio settings, there is this switch A hidden jewel for anybody working a lot with the WPF markup language in Visual Studio.

You’ll find it at: Tools / Options… / Text Editor / XAML / Miscellaneous

Open XAML always in XAML view in Visual Studio