Blog

How to find out which version of GNOME you’re using

Posted by on 2:35 pm in Knowledge Base | Comments Off on How to find out which version of GNOME you’re using

In the GNOME desktop, there is no obvious way to tell which version you’re running by way of the GUI. Instead, we need to consult the command line and try out a couple of commands to find out more. Here’s how. Let’s open a Terminal session and do some hacking. GNOME 2.x If you’re running GNOME 2.x (under CentOS 6 for example), you need to run the following command: gnome-session --version gnome-session 2.28.0 You may need to prefix this command with sudo, otherwise it will tell you that you’re alrady running a...

read more

How to fix the Visual Editor or Text Editor in WordPress when it’s not working

Posted by on 4:47 pm in Knowledge Base | Comments Off on How to fix the Visual Editor or Text Editor in WordPress when it’s not working

I had a weird phenomenon on a Multisite installation the other day. I can’t tell you with which update exactly it happened, as I only write a post on that site once every couple of months, but it must have been around the 4.7 or 4.8 upgrade. Here’s what was happening: I could log into the site fine, I could display all posts in the backend fine, but editing them, or creating a new post (or page) resulted in an unresponsive editor window. Neither the Visual Editor nor the standard Text Editor wanted to accept any keyboard input....

read more

How to use Xcode for C and C++ development

Posted by on 8:54 pm in Knowledge Base | Comments Off on How to use Xcode for C and C++ development

Not only is Xcode an excellent IDE for iOS and macOS apps in both Swift and Objective-C; it does just as fine a job for regular C and C++ code. This includes all the features we know and love, such as code completion, version control, and all the rest of it. Let’s see how to use Xcode 8.3 for C and C++ development. Starting a new C Project Even the shortest programmes you’ll ever write with Xcode are a project. Everything’s a project in Xcode. Start a new one under File – New Project. Under the macOS tab, find the...

read more

How to fix “can’t log into YouTube from Safari” on macOS

Posted by on 7:39 pm in Knowledge Base | Comments Off on How to fix “can’t log into YouTube from Safari” on macOS

Something rather strange happened to me today: Safari 10 on macOS Sierra refused to let me login to YouTube. All it did was constantly refresh the page in an endless loop, or just display the front page of YouTube. I cleared the caches, reset the history, but no trick seemed to solve the problem. When I dug deeper into the Preferences, I found something under Privacy that finally fixed it. Let me share with you what worked on my system. head over to Safari – Preferences select the Privacy tab you’ll see a window like this one:...

read more

How to rename a batch of files in Linux

Posted by on 7:11 pm in Knowledge Base | Comments Off on How to rename a batch of files in Linux

Bulk renaming files can be done with the rename command. It shares many similarities with cp and mv, but its simplicity can be so staggering that its difficult to figure out how to use it. If we just type “rename” at the command prompt, all we get is the message rename call: rename from to files... While technically correct, what on earth does it mean? How do we use rename? Let’s do a little exercise. Imagine we had a batch of files, perhaps something like “Title 101.mp4” to “Title 110.mp4”....

read more

How to exit VI with or without saving

Posted by on 4:01 pm in Knowledge Base | Comments Off on How to exit VI with or without saving

Although many alternatives exist, I like using vi for all my command line editing needs. To save changes, I usually use SHIFT + Z + Z, exiting vi under most circumstances. But sometimes, this trick doesn’t work because of write permission problems. In such cases, vi doesn’t close with the above command. Instead, we must either stash our changes in another file, or quit the session without saving. Here’s how to do that. Quit vi without saving: :q! Save current file under a different name: :w newfile...

read more

How to read command line parameters in BASH Scripts

Posted by on 8:36 pm in Knowledge Base | Comments Off on How to read command line parameters in BASH Scripts

Shell Scripts (BASH Scripts) can access command line parameters using the the variables $1, $2, $2 and so forth, up to $9. In fact, more parameters can be accessed by using curly brackets, like ${10}, ${187} and so forth. Here’s an example: #!/bin/bash if [[ $1 == "x" ]]; then echo "Statement is true" else echo "Statement is false" fi If we run the script with like this script.sh x it will tell us the statement is true. Otherwise, it’ll tell us the opposite. Note the whitespace around the evaluation:...

read more

How to read command line parameters in PHP Shell Scripts

Posted by on 7:10 pm in Knowledge Base | Comments Off on How to read command line parameters in PHP Shell Scripts

We can access parameters passed via the command line in our PHP shell scripts. Those are stored as an array in the variable $argv. Consider this: #!/usr/bin/php <?php echo var_dump($argv); echo "\n"; if ($argv[1] == 'x') { echo "The parameter is x."; } else { echo "The parameter was something else."; } The first part of the script prints out all parameters that have been given, while the second part checks if the parameter was “x” or not. Note that the first item in the array ($argv[0])...

read more

How to extract files from a bz2 archive in Linux

Posted by on 3:29 pm in Knowledge Base | Comments Off on How to extract files from a bz2 archive in Linux

If you’ve ever tried to decompress a file that ends in tar.bz2 using the tar command, you’ll have noticed that it doesn’t work. That’s because the tar command does not understand the binzip codec used in these archives. Instead, we can use the bzip2 command like so: bzip2 -d yourfile.tar.bz2 The -d switch stands for “decompress”. Notice that this will extract all files and delete the original .bz2 file by default. Very convenient indeed! If you’d like to keep it, just pass the -k switch (for...

read more

How to start a Windows app with arguments from a shortcut

Posted by on 12:47 pm in Knowledge Base | Comments Off on How to start a Windows app with arguments from a shortcut

create a shortcut for your app somewhere right-click on the shortcut and head over to the Shortcut tab under Target, add your argument(s) after the closing quote hit OK, then double-click the shortcut...

read more