Get a filename only list of files in a folder

To get a list of all files in a folder without path, you can use the following snippet:

Example result:

Prefix files: If you want to prefix files, you can use the same command too:

Example result:

 

Base64 encode on shell

Sometimes you need to encode a string  with a base64 encoding. For example when trying to send a HTTP request with a Basic Authentication header like that:

As you can see the Basic Auth username and password are included in the request as a base64 encoded string. On the Linux shell this string can […]

Get the currently installed Java version and vendor on Ubuntu / Debian Linux

To day I had to  figure out the Java version installed on my machine while digging through some problems with my IntelliJ IDE. This is how you can get the currently installed Java version and vendor on Ubuntu or other debian derivatives on bash.

That gives you something like that:

As you can […]

Tunnel MySQL through SSH

Recently I had the challenge, that the MySQL database of one of the Magento shops I maintain wasn’t accessible directly through the Net. The access was restricted to the Webserver only. So I had to tunnel MySQL through SSH. And that worked like that: edit the ssh config (~/.ssh/config) on the remote Webserver

create  […]

Remove all files and folders including hidden files on bash

To remove all files and folders including hidden files such .gitignore, .htaccess, .git etc. on bash you can use the following command:

Is the same as:

But ever shorter. 😉

Mount a ssh filesystem under Linux or How I mounted my webspace into my root server

Today I had to mount a ssh filesystem under Linux. The reason was, that I had the perception that I would be a very cool idea, to use my old webspace package from all-inkl.com, that I only kept because of the 10 included domains, as a backup storage for my root server. The plan was […]

Split webm files into chunks on Linux

Today I had to split webm files into chunks on Linux.  The reason was, that I recorded  a screencast for a documentary. Therefore I used the Nimbus Chrome Browser Plugin (https://nimbus.everhelper.me/screenshot.php). The problem was, that the resulting video files in webm format were much to big to upload them to our Confluence Wiki. That’s why […]

GIT – reconnect remote branch

Sometimes it is necessary to remap a local git  branch to a remote one (reconnect remote branch). For me it was the case, because I accidentally removed all origins in a multi-origin setup. Hence I got the following error message when trying to pull without naming remote and branch, although I re-added and fetched all […]

Restrict root ssh access to a single IP under Raspbian / Debian / Ubuntu

Today I configured a new backup solution that required me to restrict root ssh access to a single IP for the root user. I got tis to work by going the following steps (on Raspbian GNU/Linux 9): login via ssh on the maschine to access via root modify the /etc/ssh/sshd_config like that

add the following […]