How to Install Visual Studio Code on Debian 9

Visual Studio Code is a free and open source cross-platform code editor developed by Microsoft. It has a built-in debugging support, embedded Git control, syntax highlighting, code completion, integrated terminal, code refactoring and snippets. Visual Studio Code functionality can be extended using extensions.

This tutorial explains how to install Visual Studio Code editor on Debian using apt from the VS Code repository.

Prerequisites

The user you are logged in as must have sudo privileges to be able to install packages.

Installing Visual Studio Code on Debian

Complete the following steps to install Visual Studio Code on your Debian system:

  1. Start by updating the packages index and installing the dependencies by typing:

    sudo apt update
    sudo apt install software-properties-common apt-transport-https curl

  2. Import the Microsoft GPG key using the following curl command:

    curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add –

    Add the Visual Studio Code repository to your system:

    sudo add-apt-repository “deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main”

  3. Once the repository is added, install the latest version of Visual Studio Code with:

    sudo apt update
    sudo apt install code

That’s it. Visual Studio Code has been installed on your Debian desktop and you can start using it.

Starting Visual Studio Code

Once the VS Code is installed on your Debian system you can launch it either from the command line by typing code or by clicking on the VS Code icon (Activities -> Visual Studio Code).

When you start VS Code for the first time, a window like the following will be displayed:

You can now start installing extensions and configuring VS Code according to your preferences.

Updating Visual Studio Code

When a new version of Visual Studio Code is released you can update the package through your desktop standard Software Update tool or by running the following commands in your terminal:

sudo apt update
sudo apt upgrade

Conclusion

You have successfully installed VS Code on your Debian 9 machine. Your next step could be to install Additional Components and customize your User and Workspace Settings.

If you have any question, please leave a comment below.

Source

Germany Dedicated Server

Emoji-Log: A new way to write Git commit messages

I’m a full-time open source developer—or, as I like to call it, an 🎩 open sourcerer. I’ve been working with open source software for over a decade and built hundreds of open source software applications.

I also am a big fan of the Don’t Repeat Yourself (DRY) philosophy and believe writing better Git commit messages—ones that are contextual enough to serve as a changelog for your open source software—is an important component of DRY. One of the many workflows I’ve written is Emoji-Log, a straightforward, open source Git commit log standard. It improves the developer experience (DX) by using emoji to create better Git commit messages.

I’ve used Emoji-Log while building the VSCode Tips & Tricks repo, my 🦄 Shades of Purple VSCode theme repo, and even an automatic changelog that looks beautiful.

Emoji-Log’s philosophy

I like emoji (which is, in fact, the plural of emoji). I like ’em a lot. Programming, code, geeks/nerds, open source… all of that is inherently dull and sometimes boring. Emoji help me add colors and emotions to the mix. There’s nothing wrong with wanting to attach feelings to the 2D, flat, text-based world of code.

Instead of memorizing hundreds of emoji, I’ve learned it’s better to keep the categories small and general. Here’s the philosophy that guides writing commit messages with Emoji-Log:

  1. Imperative
    • Make your Git commit messages imperative.
    • Write commit message like you’re giving an order.
      • e.g., Use ✅ Add instead of ❌ Added
      • e.g., Use ✅ Create instead of ❌ Creating
  2. Rules
    • A small number of categories are easy to memorize.
    • Nothing more, nothing less
      • e.g. 📦 NEW, 👌 IMPROVE, 🐛 FIX, 📖 DOC, 🚀 RELEASE, and ✅ TEST
  3. Actions
    • Make Git commits based on actions you take.
    • Use a good editor like VSCode to commit the right files with commit messages.

Writing commit messages

Use only the following Git commit messages. The simple and small footprint is the key to Emoji-Logo.

  1. 📦 NEW: IMPERATIVE_MESSAGE
    • Use when you add something entirely new.
      • e.g., 📦 NEW: Add Git ignore file
  2. 👌 IMPROVE: IMPERATIVE_MESSAGE
    • Use when you improve/enhance piece of code like refactoring etc.
      • e.g., 👌 IMPROVE: Remote IP API Function
  3. 🐛 FIX: IMPERATIVE_MESSAGE
    • Use when you fix a bug. Need I say more?
      • e.g., 🐛 FIX: Case converter
  4. 📖 DOC: IMPERATIVE_MESSAGE
    • Use when you add documentation, like README.md or even inline docs.
      • e.g., 📖 DOC: API Interface Tutorial
  5. 🚀 RELEASE: IMPERATIVE_MESSAGE
    • Use when you release a new version. e.g., 🚀 RELEASE: Version 2.0.0
  6. ✅ TEST: IMPERATIVE_MESSAGE
    • Use when you release a new version.
      • e.g., ✅ TEST: Mock User Login/Logout

That’s it for now. Nothing more, nothing less.

Emoji-Log functions

For quick prototyping, I have made the following functions that you can add to your .bashrc/.zshrc files to use Emoji-Log quickly.

#.# Better Git Logs.
### Using EMOJI-LOG (https://github.com/ahmadawais/Emoji-Log).

# Git Commit, Add all and Push — in one step.
function gcap() {
git add . && git commit -m “$*” && git push
}

# NEW.
function gnew() {
gcap “📦 NEW: $@”
}

# IMPROVE.
function gimp() {
gcap “👌 IMPROVE: $@”
}

# FIX.
function gfix() {
gcap “🐛 FIX: $@”
}

# RELEASE.
function grlz() {
gcap “🚀 RELEASE: $@”
}

# DOC.
function gdoc() {
gcap “📖 DOC: $@”
}

# TEST.
function gtst() {
gcap “✅ TEST: $@”
}

To install these functions for the fish shell, run the following commands:

function gcap; git add .; and git commit -m “$argv”; and git push; end;
function gnew; gcap “📦 NEW: $argv”; end
function gimp; gcap “👌 IMPROVE: $argv”; end;
function gfix; gcap “🐛 FIX: $argv”; end;
function grlz; gcap “🚀 RELEASE: $argv”; end;
function gdoc; gcap “📖 DOC: $argv”; end;
function gtst; gcap “✅ TEST: $argv”; end;
funcsave gcap
funcsave gnew
funcsave gimp
funcsave gfix
funcsave grlz
funcsave gdoc
funcsave gtst

If you prefer, you can paste these aliases directly in your ~/.gitconfig file:

# Git Commit, Add all and Push — in one step.
cap = “!f() { git add .; git commit -m “$@”; git push; }; f”

# NEW.
new = “!f() { git cap “📦 NEW: $@”; }; f”
# IMPROVE.
imp = “!f() { git cap “👌 IMPROVE: $@”; }; f”
# FIX.
fix = “!f() { git cap “🐛 FIX: $@”; }; f”
# RELEASE.
rlz = “!f() { git cap “🚀 RELEASE: $@”; }; f”
# DOC.
doc = “!f() { git cap “📖 DOC: $@”; }; f”
# TEST.
tst = “!f() { git cap “✅ TEST: $@”; }; f”

Emoji-Log examples

Here’s a list of repos that use Emoji-Log.

Source

Germany Dedicated Server

it – Bash Framework to Control Your Scripts and Aliases

by Aaron Kili | Published: February 7, 2019 |

February 7, 2019

‘,
enableHover: false,
enableTracking: true,
buttons: { twitter: },
click: function(api, options){
api.simulateClick();
api.openPopup(‘twitter’);
}
});
jQuery(‘#facebook’).sharrre({
share: {
facebook: true
},
template: ‘

‘,
enableHover: false,
enableTracking: true,
click: function(api, options){
api.simulateClick();
api.openPopup(‘facebook’);
}
});
jQuery(‘#googleplus’).sharrre({
share: {
googlePlus: true
},
template: ‘

‘,
enableHover: false,
enableTracking: true,
urlCurl: ‘https://www.tecmint.com/wp-content/themes/tecmint/js/sharrre.php’,
click: function(api, options){
api.simulateClick();
api.openPopup(‘googlePlus’);
}
});
jQuery(‘#linkedin’).sharrre({
share: {
linkedin: true
},
template: ‘

‘,
enableHover: false,
enableTracking: true,
buttons: {
linkedin: {
description: ‘Bash-it – Bash Framework to Control Your Scripts and Aliases’,media: ‘https://www.tecmint.com/wp-content/uploads/2019/02/Bash-It-Manage-Scripts-and-Linux-Aliases.png’ }
},
click: function(api, options){
api.simulateClick();
api.openPopup(‘linkedin’);
}
});
// Scrollable sharrre bar, contributed by Erik Frye. Awesome!
var shareContainer = jQuery(“.sharrre-container”),
header = jQuery(‘#header’),
postEntry = jQuery(‘.entry’),
$window = jQuery(window),
distanceFromTop = 20,
startSharePosition = shareContainer.offset(),
contentBottom = postEntry.offset().top + postEntry.outerHeight(),
topOfTemplate = header.offset().top;
getTopSpacing();
shareScroll = function(){
if($window.width() > 719){
var scrollTop = $window.scrollTop() + topOfTemplate,
stopLocation = contentBottom – (shareContainer.outerHeight() + topSpacing);
if(scrollTop > stopLocation){
shareContainer.offset();
}
else if(scrollTop >= postEntry.offset().top-topSpacing){
shareContainer.offset();
}else if(scrollTop 1024)
topSpacing = distanceFromTop + jQuery(‘.nav-wrap’).outerHeight();
else
topSpacing = distanceFromTop;
}
});

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter – Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

View all Posts

Aaron Kili

Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Source

Germany Dedicated Server

How Java has stood the test of time

“);
});
try {
$(“div.lazyload_blox_ad”).lazyLoadAd({
threshold : 0, // You can set threshold on how close to the edge ad should come before it is loaded. Default is 0 (when it is visible).
forceLoad : false, // Ad is loaded even if not visible. Default is false.
onLoad : false, // Callback function on call ad loading
onComplete : false, // Callback function when load is loaded
timeout : 1500, // Timeout ad load
debug : false, // For debug use : draw colors border depends on load status
xray : false // For debug use : display a complete page view with ad placements
}) ;
}
catch (exception){
console.log(“error loading lazyload_ad ” + exception);
}
});

Java has survived for more than two decades and continues to be one of the top programming languages in use today. What accounts for the language’s success, and how has it changed to accommodate more modern technology?

Java’s rise to power

Java initially appeared in 1995, evolving from a 1991 innovation called “Oak.” It was apparently the right time for engineers looking to grow distributed systems. Some of the more popular languages back then — C, C++, and even Cobol for some efforts — involved steep learning curves. Java’s multi-threading, allowing the concurrent execution of two or more parts of a program, ended the struggle to get multi-tasking working.

Java quickly became the de facto language for mission-critical systems. Since that time, new languages have come and gone, but Java has remained entrenched and hard to replace. In fact, Java has stood as one of the top two computing languages practically since its initial appearance, as this Top Programming Languages article suggests.

It was James Gosling at Sun Microsystems, considered the “father” of Java, who came up with the idea for the language. He worked at Sun until Sun was acquired by Oracle in 2010. In the transference of power, Java became an Oracle product, but it hasn’t remained static. Continued innovation have allowed it to remain the most popular programming language. In addition, the Java community has had time to establish superior tools for writing, maintaining, and debugging code.

The appeal of bytecode and portability

Java implementations typically use a two-step compilation process. In other words, the source code is turned into bytecode by the Java compiler. The bytecode is then executed by the Java Virtual Machine (JVM). JVMs today use a technique called Just-in-Time (JIT) compilation to produce native instructions that the system’s CPU can execute. This promotes the “write once, run anywhere” (WORA) approach that Sun espoused in Java’s early days.

Why compilation matters

The flexibility of bytecode provides a real boon to portability. Instead of compiling applications for every platform, the same code is distributed to every system and the JVM in residence manages it. The problem comes in when small footprint devices don’t deal well with the overhead of interpretation that is required.

In addition, the Java machine has grown considerably and is far too monolithic for small footprint applications that need to react quickly. As a result, we are seeing offshoots that involve significantly less overhead such as Avian (a lightweight virtual machine with a subset of Java’s features) and Excelsior JET (a complete Java Virtual Machine implementation enhanced with an ahead-of-time compiler) that provide optimized native executables that sacrifice portability for performance. Both cloud and Internet of Things (IoT) applications benefit.

Shifting directions

Other innovations in the Java world include GraalVM and SubstrateVM.

GraalVM is a new just-in-time compiler for the JVM and works with other languages, as well as Java (e.g., JavaScript, Python, and Ruby). GraalVM can run in the context of OpenJDK to make Java applications run even faster with a new just-in-time compilation technology. It includes a new high-performance Java compiler called Graal that can be used with HotSpot VM or for an ahead-of-time setup with SubstrateVM.

SubstrateVM greatly improves startup time and makes short-lived applications run faster. It’s a framework that allows ahead-of-time (AOT) compilation of Java applications into executable images or shared objects (ELF-64 or 64-bit Mach-O).

Open vs. proprietary

Oracle announced last year that the technical differences between JDK and OpenJDK would go away. The differences between the two today is largely cosmetic.

Java is still free. Rumors of its imminent death arose a few years back, but OpenJDK has not lost any momentum.

What roles do Oracle and Red Hat play?

When Oracle announced it would no longer supply free binary downloads for JDK releases or write bug patches for OpenJDK after a six-month period, Java users were initially concerned. But the transition of support has been working well. Red Hat takes over when Oracle backs off. The passing of the baton seems to be smooth and reliable. When Oracle stops providing support, Red Hat takes over.

The key to Java’s continued success

While Oracle and Red Hat continue to provide a gap-free approach to supporting OpenJDK, Java’s earliest developers and these two companies can claim only part of the credit for Java’s eminence. As Red Hat’s Mark Little says, 50 percent of the credit for Java’s continued success goes to the developer community.

Join the Network World communities on

Facebook

and

LinkedIn

to comment on topics that are top of mind.

Sandra Henry-Stocker has been administering Unix systems for more than 30 years. She describes herself as “USL” (Unix as a second language) but remembers enough English to write books and buy groceries. She lives in the mountains in Virginia where, when not working with or writing about Unix, she’s chasing the bears away from her bird feeders.

Source

Germany Dedicated Server

Get started and organized with TiddlyWiki

When you think of the word wiki, chances are the first thing that comes to mind is Wikipedia. That’s not a surprise, considering that Wikipedia did help put the concept of the wiki into the popular consciousness. Wikis, which are websites you can edit, are great tools for collaborating and organizing. But wikis usually require a lot of digital plumbing and a bit of care to use and maintain. All of that’s overkill for personal use.

While you can install desktop wikis on your computer, they’re not as portable as some people want or need them to be.

Enter TiddlyWiki, the brainchild of British software developer Jeremy Ruston. Not only is it great for organizing yourself, but it’s also easy to use and very portable.

Let’s take a quick look at the basics of using TiddlyWiki to get organized.

What’s TiddlyWiki?

TiddlyWiki isn’t software quite as you know it. It’s a large web page (consisting of HTML and a lot of JavaScript) that weighs in at around 2MB. You can edit and save the file in a web browser.

It’s very flexible. You can use TiddlyWiki to take notes, manage task lists, save bookmarks, publish a blog or website, create a presentation, and a lot more. And people have used it to do some interesting things.

As I mentioned, TiddlyWiki is very portable. You can put it in a folder in, say, Nextcloud and share a TiddlyWiki between computers and mobile devices. Or, you can carry it around on a flash drive.

Getting started

Head over to the TiddlyWiki website and download the file empty.html. Rename that file to something a bit more meaningful and descriptive. Then open it in a web browser.

You’ll see the Getting Started tiddler (more on tiddlers in a moment):

Click the pencil icon in the top-right corner and change the information. Then, click the checkmark icon to save the TiddlyWiki.

A note about saving your TiddlyWiki

Since your web browser thinks a TiddlyWiki is a file, it’ll save your TiddlyWiki to the folder on your computer where downloads go. And when it does that, your browser will probably save it with a file name like tiddlywiki(1).html. You don’t want that.

If you’re using Chrome or Chromium, set the browser to ask you where to save files by selecting Settings, then clicking Show advanced settings on the Settings page. Then click the Ask where to save each file before downloading option.

If you’re using Firefox, click on the stacker menu in the top-right corner and select Options. Find the Downloads option, and click Always ask you where to save files.

Working with TiddlyWiki

You can use TiddlyWiki for just about anything. And people have done just that. But instead of jumping into the scary depths, let’s look at the basics of using TiddlyWiki.

Since I prefer to focus on specific tasks with my tools, I’m going to look at using TiddlyWiki for:

  • Taking notes
  • Managing tasks
  • Keeping a journal

Taking notes

To get going, create a new tiddler, which is an individual page within TiddlyWiki. To be honest, I don’t know how many tiddlers a single TiddlyWiki can contain before it slows down, but I wouldn’t be surprised if it’s in the hundreds or thousands.

Create a new tiddler by clicking the + icon.

Give your tiddler a name, like Notes for netbooks essay. You can also type a tag in the Tag name field—doing that will let you filter your tiddlers so you can find them quickly when you have a lot of them. Then start typing.

You can format your tiddler using TiddlyWiki’s markup. You can also use the formatting toolbar to add character formatting, lists, quotes, headings, images, and links.

When you’re done, click the checkmark icon to save the tiddler.

Creating a task list

Again, create a new tiddler. Give it a name like Tasks – 4 May 2019 and type Tasks in the Tag name field.

From there, type your tasks—one line for each. Put an asterisk (*) in front of each one to create a bullet list. Then save your list.

To mark off a completed task, edit the tiddler, highlight the task, and click the Strikethrough button on the toolbar.

That’s a pretty simple, and frankly lame, way to deal with tasks. If you’re looking for something more visually appealing, watch this video. This method requires a bit more setup, but you also get nifty checkboxes that you can click when you finish a task.

Keeping a journal

If you want to keep a journal, first click the Tools tab and select the New journal option. That puts the Create a new journal tiddler button on the main TiddlyWiki toolbar.

Click that button and you’ll notice that the journal tiddler has today’s date as its name and has been tagged Journal.

As with any other tiddler, type your text and save the tiddler when you’re done.

The power of plugins

What if you want or need more from TiddlyWiki? You can use plugins to extend and customize TiddlyWiki’s capabilities. You can change its appearance, add editors and support for Markdown, turn TiddlyWiki into a personal kanban board (à la WeKan), add a more powerful search engine, and more.

TiddlyWiki has a plugin library, which you can access from its control panel. There’s a list of plugins created by users, and this toolmap lists over 600 plugins, tips, and tricks.

One TiddlyWiki or several?

You can load up your TiddlyWiki with everything you need to do. Eventually, though, it could get so full of tiddlers that it’s difficult to easily find what you need to find, even with good tagging.

An alternative to that is to have several TiddlyWiki files—for example, one for notes, one for tasks, one for outlines, one for journaling. Keeping track of those files could become a chore. The desktop version can help you better organize two or more TiddlyWiki files.

Learning more

I’ve only covered the basics of using TiddlyWiki. There is a lot you can do with it, even if (like me) you’re using it just for simple tasks.

Here are some good resources that can help you learn more about using TiddlyWiki:

Source

Germany Dedicated Server

How to Install WordPress with Apache on CentOS 7

WordPress is the most popular open source blogging and CMS platform worldwide, powering a quarter of all websites on the Internet today. It is based on PHP and MySQL and packs a ton of features that can be extended with free and premium plugins and themes. WordPress is the simplest way to create your online store, website, or blog.

In this tutorial we will explain how to install WordPress on CentOS 7. At the time of writing this article, the latest version of WordPress is version 5.0.3.

We’ll be using a LAMP stack with Apache as a web server, SSL certificate, the latest PHP 7.2 and MySQL/MariaDB as a database server.

Prerequisites

Ensure the following prerequisites are met before continuing with this tutorial:

Creating MySQL Database

WordPress stores its data and configuration in a MySQL database. If you already don’t have MySQL or MariaDB installed on your CentOS server you can install by following one of the guides below:

Login to the MySQL shell by executing the following command:

From inside the mysql console, run the following SQL statement to create a new database named wordpress:

CREATE DATABASE wordpress CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

Next, create a MySQL user account named wordpressuser and grant the necessary permissions to the user by running the following command:

GRANT ALL ON wordpress.* TO ‘wordpressuser’@’localhost’ IDENTIFIED BY ‘change-with-strong-password’;

Once done, exit the mysql console by typing:

Downloading WordPress

The following command will download the latest version of WordPress from the WordPress download page with wget and extract the archive to the domain’s document root directory:

wget -q -O – “http://wordpress.org/latest.tar.gz” | sudo tar -xzf – -C /var/www/html –transform s/wordpress/example.com/

Set the correct permissions so that the web server can have full access to the site’s files and directories:

sudo chown -R apache: /var/www/html/example.com

Configuring Apache

By now, you should already have Apache with SSL certificate installed on your system, if not check the prerequisites for this tutorial.

Open your text editor and edit the domain’s Apache virtual hosts configuration:

sudo nano /etc/httpd/conf.d/example.com.conf

Don’t forget to replace example.com with your WordPress domain and set the correct path to the SSL certificate files.

/etc/httpd/conf.d/example.com.conf

<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com

Redirect permanent / https://example.com/
</VirtualHost>

<VirtualHost *:443>
ServerName example.com
ServerAlias www.example.com

<If “% == ‘www.example.com'”>
Redirect permanent / https://example.com/
</If>

DirectoryIndex index.html index.php
DocumentRoot /var/www/html/example.com

ErrorLog /var/log/httpd/example.com-error.log
CustomLog /var/log/httpd/example.com-access.log combined

SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem

<Directory /var/www/html/example.com>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

</VirtualHost>

The configuration will tell Apache to redirects http to https and www to non-www version of your domain.

Restart the Apache service for the changes to take effect:

sudo systemctl restart httpd

Completing the WordPress Installation

Now that WordPress is downloaded and the Apache server is configured, you can finish the installation through the web interface.

Open your browser, type your domain and a screen similar to the following will appear:

Select the language you would like to use and click on the Continue button.

Next, you will see the following information page, click on the Let’s go! button.

On the next screen the setup wizard will ask you to enter your database connection details. Enter the MySQL user and database details you previously created.

Start the WordPress installation by clicking on the Run the Installation button.

On the next step you’ll need to enter a name for your WordPress site and choose a username (for security purposes do not use “admin” ).

The installer will automatically generate a strong password for you. Do not forget to save this password. You can also set the password by yourself.

Enter your email address and select whether you want to discourage search engines from indexing the site (not recommended).

Click Install WordPress and once the installation is completed you will be taken to a page informing you that WordPress has been installed.

To access your WordPress login page click on the Log in button.

Enter your username and password.

You will be redirected to the WordPress administration dashboard.

From here your can start customizing your WordPress installation by installing new themes and plugins.

Conclusion

Congratulations, you have successfully installed WordPress with Apache on your CentOS 7 server. First Steps With WordPress is a good starting place to learn more about how to make your new WordPress site your own.

If you have questions feel free to leave a comment below.

Source

Germany Dedicated Server

Top Hex Editors for Linux

by Marin Todorov | Published: February 8, 2019 |

February 8, 2019

‘,
enableHover: false,
enableTracking: true,
buttons: { twitter: },
click: function(api, options){
api.simulateClick();
api.openPopup(‘twitter’);
}
});
jQuery(‘#facebook’).sharrre({
share: {
facebook: true
},
template: ‘

‘,
enableHover: false,
enableTracking: true,
click: function(api, options){
api.simulateClick();
api.openPopup(‘facebook’);
}
});
jQuery(‘#googleplus’).sharrre({
share: {
googlePlus: true
},
template: ‘

‘,
enableHover: false,
enableTracking: true,
urlCurl: ‘https://www.tecmint.com/wp-content/themes/tecmint/js/sharrre.php’,
click: function(api, options){
api.simulateClick();
api.openPopup(‘googlePlus’);
}
});
jQuery(‘#linkedin’).sharrre({
share: {
linkedin: true
},
template: ‘

‘,
enableHover: false,
enableTracking: true,
buttons: {
linkedin: {
description: ‘Top Hex Editors for Linux’,media: ‘https://www.tecmint.com/wp-content/uploads/2019/02/Linux-Hex-Editors.png’ }
},
click: function(api, options){
api.simulateClick();
api.openPopup(‘linkedin’);
}
});
// Scrollable sharrre bar, contributed by Erik Frye. Awesome!
var shareContainer = jQuery(“.sharrre-container”),
header = jQuery(‘#header’),
postEntry = jQuery(‘.entry’),
$window = jQuery(window),
distanceFromTop = 20,
startSharePosition = shareContainer.offset(),
contentBottom = postEntry.offset().top + postEntry.outerHeight(),
topOfTemplate = header.offset().top;
getTopSpacing();
shareScroll = function(){
if($window.width() > 719){
var scrollTop = $window.scrollTop() + topOfTemplate,
stopLocation = contentBottom – (shareContainer.outerHeight() + topSpacing);
if(scrollTop > stopLocation){
shareContainer.offset();
}
else if(scrollTop >= postEntry.offset().top-topSpacing){
shareContainer.offset();
}else if(scrollTop 1024)
topSpacing = distanceFromTop + jQuery(‘.nav-wrap’).outerHeight();
else
topSpacing = distanceFromTop;
}
});

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter – Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

View all Posts

Marin Todorov

I am a bachelor in computer science and a Linux Foundation Certified System Administrator. Currently working as a Senior Technical support in the hosting industry. In my free time I like testing new software and inline skating.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Source

Germany Dedicated Server

Working with tarballs on Linux

Tarballs provide a versatile way to back up and manage groups of files on Linux systems. Follow these tips to learn how to create them, as well as extract and remove individual files from them.

“);
});
try {
$(“div.lazyload_blox_ad”).lazyLoadAd({
threshold : 0, // You can set threshold on how close to the edge ad should come before it is loaded. Default is 0 (when it is visible).
forceLoad : false, // Ad is loaded even if not visible. Default is false.
onLoad : false, // Callback function on call ad loading
onComplete : false, // Callback function when load is loaded
timeout : 1500, // Timeout ad load
debug : false, // For debug use : draw colors border depends on load status
xray : false // For debug use : display a complete page view with ad placements
}) ;
}
catch (exception){
console.log(“error loading lazyload_ad ” + exception);
}
});

The word “tarball” is often used to describe the type of file used to back up a select group of files and join them into a single file. The name comes from the .tar file extension and the tar command that is used to group together the files into a single file that is then sometimes compressed to make it smaller for its move to another system.

Tarballs are often used to back up personal or system files in place to create an archive, especially prior to making changes that might have to be reversed. Linux sysadmins, for example, will often create a tarball containing a series of configuration files before making changes to an application just in case they have to reverse those changes. Extracting the files from a tarball that’s sitting in place will generally be faster than having to retrieve the files from backups.

How to create a tarball on Linux

You can create a tarball and compress it in a single step if you use a command like this one:

$ tar -cvzf PDFs.tar.gz *.pdf

The result in this case is a compressed (gzipped) file that contains all of the PDF files that are in the current directory. The compression is optional, of course. A slightly simpler command would just put all of the PDF files into an uncompressed tarball:

$ tar -cvf PDFs.tar *.pdf

Note that it’s the z in that list of options that causes the file to be compressed or “zipped”. The c specifies that you are creating the file and the v (verbose) indicates that you want some feedback while the command is running. Omit the v if you don’t want to see the files listed.

Another common naming convention is to give zipped tarballs the extension .tgz instead of the double extension .tar.gz as shown in this command:

$ tar cvzf MyPDFs.tgz *.pdf

How to extract files from a tarball

To extract all of the files from a gzipped tarball, you would use a command like this:

$ tar -xvzf file.tar.gz

If you use the .tgz naming convention, that command would look like this:

$ tar -xvzf MyPDFs.tgz

To extract an individual file from a gzipped tarball, you do almost the same thing but add the file name:

$ tar -xvzf PDFs.tar.gz ShenTix.pdf
ShenTix.pdf
ls -l ShenTix.pdf
-rw-rw-r– 1 shs shs 122057 Dec 14 14:43 ShenTix.pdf

You can even delete files from a tarball if the tarball is not compressed. For example, if we wanted to remove tile file that we extracted above from the PDFs.tar.gz file, we would do it like this:

$ gunzip PDFs.tar.gz
$ ls -l PDFs.tar
-rw-rw-r– 1 shs shs 10700800 Dec 15 11:51 PDFs.tar
$ tar -vf PDFs.tar –delete ShenTix.pdf
$ ls -l PDFs.tar
-rw-rw-r– 1 shs shs 10577920 Dec 15 11:45 PDFs.tar

Notice that we shaved a little space off the tar file while deleting the ShenTix.pdf file. We can then compress the file again if we want:

$ gzip -f PDFs.tar
ls -l PDFs.tar.gz
-rw-rw-r– 1 shs shs 10134499 Dec 15 11:51 PDFs.tar.gzFlickr / James St. John

The versatility of the command line options makes working with tarballs easy and very convenient.

Join the Network World communities on

Facebook

and

LinkedIn

to comment on topics that are top of mind.

Sandra Henry-Stocker has been administering Unix systems for more than 30 years. She describes herself as “USL” (Unix as a second language) but remembers enough English to write books and buy groceries. She lives in the mountains in Virginia where, when not working with or writing about Unix, she’s chasing the bears away from her bird feeders.

Source

Germany Dedicated Server

How to Install Minecraft Server on CentOS 7

Minecraft is one of the most popular games of all time. It is a sandbox video game about placing blocks and going on adventures.

In this tutorial, we’ll go through the steps necessary to install and configure Minecraft Server on CentOS 7. We’ll use Systemd to run the Minecraft server and the mcrcon utility for connecting to the running instance. We’ll also show you how to schedule automated server backups using a Cron job.

Prerequisites

The user you are logged in as must have sudo privileges to be able to install packages.

Install the packages required to build the mcrcon tool:

sudo yum install git
sudo yum group install “Development Tools”

Installing Java Runtime Environment

Minecraft requires Java 8 or greater. Because the Minecraft Server doesn’t need a graphical user interface, we’ll install the headless version of the JRE. This version is more suitable for server applications since it has less dependencies and uses less system resources.

The installation of Java is pretty simple, just run:

sudo yum install java-1.8.0-openjdk-headless

Verify the installation by printing the java version:

openjdk version “1.8.0_191”
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

Creating Minecraft User

Running services as Minecraft under the root user is not recommended for security reasons.

We’ll create a new system user and group minecraft with home directory /opt/minecraft that will run the Minecraft server:

sudo useradd -r -m -U -d /opt/minecraft -s /bin/bash minecraft

We are not going to set password for this user. This is good security practice because this user will not be able to login via SSH. To change to the minecraft user you’ll need to be logged in to the server as root or user with sudo privileges.

Installing Minecraft on CentOS

Before starting with the installation process, make sure you switch to minecraft user.

Create three new directories inside the user home directory using the following command:

mkdir -p ~/

  • The backups directory will store your server backup. You can later synchronize this directory to your remote backup server.
  • The tools directory will be store the mcrcon client and the backup script.
  • The server directory will contain the actual Minecraft server and its data.

Downloading and Compiling mcrcon

RCON is a protocol that allows you to connect to the Minecraft servers and execute commands. mcron is RCON client built in C.

We’ll download the source code from GitHub and build the mcrcon binary.

Start by navigating to the ~/tools directory and clone the Tiiffi/mcrcon repository from GitHub using the following command:

cd ~/tools && git clone https://github.com/Tiiffi/mcrcon.git

Once the repository is cloned, navigate to its directory:

Start the compilation of the mcrcon utility by typing:

gcc -std=gnu11 -pedantic -Wall -Wextra -O2 -s -o mcrcon mcrcon.c

When completed, test it by typing:

The output will look something like this:

Usage: mcrcon [OPTIONS]… [COMMANDS]…
Sends rcon commands to minecraft server.

Option:
-h Prints usage.
-s Silent mode. Do not print data received from rcon.
-t Terminal mode. Acts as interactive terminal.
-p Rcon password. Default: “”.
-H Host address or ip.
-P Port. Default: 25575.
-c Do not print colors. Disables bukkit color printing.

Individual commands must be separated with spaces.

Example:
mcrcon -c -H 192.168.1.42 -P 9999 -p password cmd1 “cmd2 with spaces”

minecraft rcon (mcrcon) 0.0.5.
Report bugs to tiiffi_at_gmail_dot_com.

Downloading Minecraft Server

There are several Minecraft server mods like Craftbukkit or Spigot that allows you to add features (plugins) on your server and further customize and tweak the server settings. In this tutorial we will install the latest Mojang’s official vanilla Minecraft server.

The latest Minecraft server’s Java archive file (JAR) is variable for download from the Minecraft download page.

At the time of writing, the latest version is 1.13.2. Before continuing with the next step you should check the download page for a new version.

Run the following wget command to download the Minecraft jar file in the ~/server directory:

wget https://launcher.mojang.com/v1/objects/3737db93722a9e39eeada7c27e7aca28b144ffa7/server.jar -P ~/server

Configuring Minecraft Server

Navigate to the ~/server directory and start the Minecraft server:

cd ~/server
java -Xmx1024M -Xms512M -d64 -jar server.jar nogui

When you start the server for the first time it executes some operations and creates the server.properties and eula.txt files and stops.

[14:33:16] [main/INFO]: Loaded 0 recipes
[14:33:16] [main/INFO]: Loaded 0 advancements
[14:33:16] [Server thread/INFO]: Starting minecraft server version 1.13.2
[14:33:16] [Server thread/INFO]: Loading properties
[14:33:16] [Server thread/WARN]: server.properties does not exist
[14:33:16] [Server thread/INFO]: Generating new properties file
[14:33:16] [Server thread/WARN]: Failed to load eula.txt
[14:33:16] [Server thread/INFO]: You need to agree to the EULA in order to run the server. Go to eula.txt for more info.
[14:33:16] [Server thread/INFO]: Stopping server
[14:33:16] [Server thread/INFO]: Saving worlds
[14:33:16] [Server Shutdown Thread/INFO]: Stopping server
[14:33:16] [Server Shutdown Thread/INFO]: Saving worlds

You’ll need to agree to the Minecraft EULA in order to run the server. Open the eula.txt file and change eula=false to eula=true:

~/server/eula.txt

#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).
#Thu Dec 27 03:33:56 PST 2018
eula=true

Close and save the file.

Next, open the server.properties file, enable the rcon protocol and set the rcon password. You will use this settings to connect to the Minecraft server with the mcrcon tool.

nano ~/server/server.properties

~/server/server.properties

rcon.port=23888
rcon.password=strong-password
enable-rcon=true

Do not forget to change the strong-password to something more secure. Alternatively you can specify another port.
If you dont want to connect to the Minecraft server from remote locations make sure the rcon port is blocked by your firewall.

While here, you can also adjust the server’s default properties. For more information about the possible settings visit the server.properties page.

Creating Systemd Unit File

To run Minecraft as a service we will create a new Systemd unit file.

Switch back to your sudo user by typing exit.

Open your text editor and create a file named minecraft.service in the /etc/systemd/system/:

sudo nano /etc/systemd/system/minecraft.service

Paste the following configuration:

/etc/systemd/system/minecraft.service

[Unit]
Description=Minecraft Server
After=network.target

[Service]
User=minecraft
Nice=1
KillMode=none
SuccessExitStatus=0 1
ProtectHome=true
ProtectSystem=full
PrivateDevices=true
NoNewPrivileges=true
WorkingDirectory=/opt/minecraft/server
ExecStart=/usr/bin/java -Xmx1024M -Xms512M -jar server.jar nogui –noconsole
ExecStop=/opt/minecraft/tools/mcrcon/mcrcon -H 127.0.0.1 -P 23888 -p strong-password stop

[Install]
WantedBy=multi-user.target

Modify the Xmx and Xms flags according to your server resources. The Xmx flag defines the maximum memory allocation pool for a Java virtual machine (JVM), while Xms defines the initial memory allocation pool. Also make sure that your are using the correct rcon port and password.

Save and close the file and notify systemd that we created a new unit file:

sudo systemctl daemon-reload

Now you can start the Minecraft server by executing:

sudo systemctl start minecraft

The fist time you start the service it will generate several configuration files and directories including the Minecraft world.

Check the service status with the following command:

sudo systemctl status minecraft● minecraft.service – Minecraft Server
Loaded: loaded (/etc/systemd/system/minecraft.service; disabled; vendor preset: disabled)
Active: active (running) since Sat 2019-01-19 14:35:52 UTC; 4s ago
Main PID: 17356 (java)
CGroup: /system.slice/minecraft.service
└─17356 /usr/bin/java -Xmx1024M -Xms512M -jar server.jar nogui –noconsole

Enable the Minecraft service to be automatically started at boot time:

sudo systemctl enable minecraft

Adjusting Firewall

If your server is protected by a firewall to access Minecraft server from the outside of your local network you need to open port 25565:

sudo firewall-cmd –permanent –zone=public –add-port=25565/tcp
sudo firewall-cmd –reload

Configuring Backups

In this section we’ll create a backup script and cron job to automatically backup the Minecraft server.

Start by switching to minecraft user:

Open your text editor and create the following file:

nano /opt/minecraft/tools/backup.sh

Paste the following configuration:

/opt/minecraft/tools/backup.sh

#!/bin/bash

function rcon {
/opt/minecraft/tools/mcrcon/mcrcon -H 127.0.0.1 -P 23888 -p strong-password “$1”
}

rcon “save-off”
rcon “save-all”
tar -cvpzf /opt/minecraft/backups/server-$(date +%F_%R).tar.gz /opt/minecraft/server
rcon “save-on”

## Delete older backups
find /opt/minecraft/backups/ -type f -mtime +7 -name ‘*.gz’ -delete

Save the file and make it executable:

chmod +x /opt/minecraft/tools/backup.sh

Open the crontab file and create a cron job that will run once in a day automatically at a fixed time:

We’ll run the backup script every day at 23:00h:

0 23 * * * /opt/minecraft/tools/backup.sh

Accessing Minecraft Console

To access the Minecraft Console you can use the mcrcon utility.

The syntax is as follows, you need to specify the host, rcon port, rcon password and use the -t switch that enables the mcrcon terminal mode:

/opt/minecraft/tools/mcrcon/mcrcon -H 127.0.0.1 -P 23888 -p strong-password -tLogged in. Type “Q” to quit!
>

If you are regularly connecting to the Minecraft console, instead of typing this long command you should create a bash alias.

Conclusion

You have successfully installed Minecraft server on your CentOS 7 system and setup a daily backup.

If you hit a problem or have feedback, leave a comment below.

Source

Germany Dedicated Server

How a fiscal sponsor can help your open source project grow

“We were handling money from Google Summer of Code. We almost certainly weren’t doing the taxes correctly, but worse, we started needing to hold project money from year to year. Doing that in one of the project member’s checking accounts was awkward and error-prone.”

According to Jeff “Peff” King, that’s how the Git project maintainers realized that they were in over their heads and needed help, which led them to join the Software Freedom Conservancy (aka Conservancy). They were the lucky ones. Many free and open source software (FOSS) projects reach the same sort of financial and tax situation but don’t know there are organizations dedicated to helping with these tricky problems. Instead, those projects go it alone, adding accounting, tax, and legal challenges on top of the already considerable ones of developing software and managing a FOSS community. What these projects need—as Peff and the Git project realized—was a fiscal sponsor.

What is a fiscal sponsor?

The short explanation of fiscal sponsorship is “someone else manages the accounting, finances, and taxes,” but it’s much more than that. A fiscal sponsor is a registered nonprofit. Projects that sign on with a fiscal sponsor benefit from that nonprofit status. For instance, if the project wishes to start receiving monetary donations, depending upon the tax laws, those donations can be tax-deductible.

Some fiscal sponsors, such as Conservancy, also offer legal assistance as well as travel and event coordination to their projects. “Through the assistance of Software Freedom Conservancy, our fiscal sponsor, our code was properly licensed and we gained access to free software licensing and community experts,” says Eric Schultz, project leader of the Houdini open source fundraising software project.

Fiscal sponsorship also can help a corporate-founded project gain credibility as an independent and truly open project and community. According to Schultz, Houdini found this to be the case when it joined Conservancy. “When were launching the Houdini Project, we wanted to make clear that this software belonged to the community, not the originating company, CommitChange… Our community has a stronger guarantee of the Houdini Project’s independence, and Houdini receives instant credibility through its association with Conservancy.”

While Conservancy provides fiscal sponsorship for a great number of projects, it’s far from the only fiscal sponsor option in the FOSS world. Software in the Public Interest provides fiscal sponsorship services to projects like Debian, PostgreSQL, and Jenkins. The Free Software Foundation is the fiscal sponsor of SeaGL, the Seattle GNU/Linux Conference. Open Source Initiative is the fiscal sponsor of ClearlyDefined. These are four of the many options available.

What to look for in a fiscal sponsor

When choosing a fiscal sponsor, your project should be aware of its own requirements as well as any of the potential sponsor’s constraints. You may find that the two don’t match up well. According to Peff, Git discovered this when the maintainers did their own fiscal sponsor search. “We looked at a few sponsorship organizations. One of the things I liked about Conservancy is that it was easy to just use the services we needed. Some umbrella organizations have opinions on particular licenses, copyright assignment, project hosting, and so on. But we were able to just handle the fiscal and legal parts through Conservancy, and leave the code development process as it was.” Make sure you get a complete picture from each fiscal sponsor candidate before the project makes its final decision.

An alternative to signing on with a nonprofit fiscal sponsor is for your project to become a nonprofit of its own. While this is certainly a valid option, it’s far from the easiest. There’s a great deal of administrative overhead required for running a nonprofit, and most projects are not equipped to handle that. As well, at least in the United States, the process is quite complex. Applying for 501(c)(3) tax-exempt status can take years and, even after all that work and time, the tax-exempt status is not guaranteed.

For most projects, the time and expense required to gain and maintain nonprofit status doesn’t make sense. For them, fiscal sponsorship is the perfect option for helping the project move to the next stage of its development and maturation. “All things considered, I’m not even sure we would have been able to get Houdini Project ‘out the door’ without the help of Software Freedom Conservancy,” says Schultz.

As your project considers its plans and strategy for growth in 2019, keep the possibility of getting a fiscal sponsor in mind. Doing so might help your project level up while also removing some pesky and potentially troublesome administrative duties from your plate so you can focus on software and community development instead.

Source

Germany Dedicated Server