Nicely Displayed Tweets

While looking at how to get a tweet from Twitter nicely formatted, I tried all kinds of tools, web sites and tips. In my case, I wanted to put a nice screenshot of the tweet by Alex Yates into my DevOps lecture slides.

Sharing the tweet via e-mail seemed to be a possibility, but it did not look as nice as I expected.

It turned out, that Twitter provides functionality to nicely display Twitter URLs out of the box via https://publish.twitter.com.

All you have to do is to paste the Twitter link into the text box and everything ios nicely rendered for you.

Link: https://publish.twitter.com/#

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.

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

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.

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.

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.

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"

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.