VirtualBox 7.0.8 on Fedora 38/37/36, CentOS/RHEL 9/8/7

Oracle VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. VirtualBox is a general-purpose full virtualizer for x86 hardware. Targeted at server, desktop and embedded use, it is now the only professional-quality virtualization solution that is also Open Source Software. Check video guide howto install VirtualBox 7.0.8 on Fedora 38/37/36 using Oracle’s own dnf repo: Check video guide howto install VirtualBox 7.0.8 / 7.
Read more →

Linux: Create Text File on Linux Shell / Command Line

This is a very typical case, the need to create a temp file on the command line quickly. Opening editor, writing content, save file and quit editor is not the fastest possible way. A faster way is to use the cat command with the name of the file and write contents of the file and give the end-of-file character (Ctrl-D). This is guide, howto create (or append to) text file without text editor on Linux shell / command line.
Read more →

Install Memcached on Fedora 29/28, CentOS/RHEL 7.5/6.10

Memcached is a high-performance, distributed memory object caching system, generic in nature, but originally intended for use in speeding up dynamic web applications by alleviating database load. Memcached is a very useful also in other cases, than only dynamic web applications. This guide explains howto install Memcached 1.6.14 stable version of distributed memory object caching system on Fedora 2 and CentOS / Red Hat (RHEL) 7.5/6.10. Fedora 29/28/27/26, CentOS 7/6 and Red Hat (RHEL) 7/6 has Memcached on default repos, so extra repositories is not needed.
Read more →

Linux locate command: Find Files and Directories Quickly and Efficiently

This is quick guide howto find files and directories quick and efficiently on Linux with locate command. Linux find command is outdated, slow and complicated to use, so locate command is much better option. Locate basic usage find files and directories locate file # example locate httpd.conf locate path # example locate /X11/ Find (locate) ignore-case (not case sensitive) locate -i file # example locate -i netbeans Find (locate) only file name (basename) locate -b file # example locate -b shadow Limit locate output locate -l 100 file # example locate -l 50 conf Print number of found entries locate -c file # example locate -c conf Find (locate) with full file info Simply locate something and pipe output to ls command.
Read more →

cURL: Check Nginx/Apache Compression (br, gzip, deflate) is Working

This is a quick method to check with using cURL that Nginx/Apache (or any other web server) compression with Nginx ngx_http_gzip_module (gzip), Nginx google/ngx_brotli (br), Apache mod_brotli (br), Apache mod_gzip (gzip) and Apache mod_deflate (deflate) is working. Only the remote server headers are needed. Check that the Nginx/Apache Compression is Working Get headers curl -s -I -H 'Accept-Encoding: br,gzip,deflate' https://www.if-not-true-then-false.com -s option silent, disable progress bar. -I option which will make just HEAD request to server and get headers.
Read more →

YUM History (list, info, summary, repeat, redo, undo, new)

Yum (Yellowdog Update Modified) is RPM Packet Management system for Fedora, CentOS, Red Hat, OpenSuse etc. Yum history (list, info, summary, repeat, redo, undo, new) commands is added on 3.2.25 version. So this works every Linux Distros, which uses yum 3.2.25 or newer. Yum history command is a really useful in situations where the need to example rollback latest yum activity or undelete some deletes or just see what is updated lately.
Read more →

Add Hostname, Date, Time, Uptime, Load Average to Linux Terminal Title

This tip is really useful if you need/want to monitor multiple servers at the same time. This Tip works, as the tip, by which you can add the date and time the title of the Linux terminal, but it adds more usefull info to terminal title. Following bash one liner add hostname, date, time, uptime, users and load Average to Linux Terminal Title and updates it every second. This trick works at least following terminals: Gnome Terminal, xterm, urxvt, rxvt.
Read more →

PHP CLI Colors – PHP Class Command Line Colors (bash)

PHP Command Line Interface (CLI) has not built-in coloring for script output, like example Perl language has (perldoc.perl.org/Term/ANSIColor.html). So I decided to make own class for adding colors on PHP CLI output. This class works only Bash shells. This class is easy to use. Just create new instance of class and call getColoredString function with string and foreground color and/or background color. PHP Class for Coloring PHP Command Line (CLI) Scripts Output <?
Read more →

Delete files securely on Linux – Journaled file systems

Few days ago I write about shred, which work fine for old systems, like EXT2, but not so nice with journaled file systems. Modern file systems need something more robust, like dd and srm (a secure replacement for rm). Unlike the standard rm, srm overwrites and rename the files before unlinking them. This makes it very hard to recovery of the data. Create test file: echo "secure content" > /tmp/secure.
Read more →

Delete files permanently with shred command in Linux – Remove absolutely

Sometimes we need to delete files which content should disappear absolutely, completely and safely. Linux command rm just remove file and it’s still possible to dig out from the disk. Fortunately for Linux can be found in shred program that removes the files permanently. Shred command is easy and quickly to use cases when files need to deleted forever. Shred command usage Create test file: echo "testing testing" > /tmp/test.
Read more →

Format bytes with PHP – B, KB, MB, GB, TB, PB, EB, ZB, YB converter

Simple PHP function that formats the bytes to the desired form. Possible unit options are: Byte (B) Kilobyte (KB) Megabyte (MB) Gigabyte (GB) Terabyte (TB) Petabyte (PB) Exabyte (EB) Zettabyte (ZB) Yottabyte (YB) PHP byteFormat function for formatting bytes Function takes three parameter: (bytes mandatory, unit optional, decimals optional) <?php function byteFormat($bytes, $unit = "", $decimals = 2) { $units = array('B' => 0, 'KB' => 1, 'MB' => 2, 'GB' => 3, 'TB' => 4, 'PB' => 5, 'EB' => 6, 'ZB' => 7, 'YB' => 8); $value = 0; if ($bytes > 0) { // Generate automatic prefix by bytes // If wrong prefix given if (!
Read more →

PHP Script to Generate PostgreSQL Table Partitioning (Part 2)

As Part 1 (Howto create PostgreSQL table partitioning) shows, making of PostgreSQL partitioning needs a lot of SQL commands. So this Part 2 explains how SQL commands for PostgreSQL partitioning can be made with a simple PHP script. This example script make SQL for child tables, indexes, trigger function and parent table trigger. This example script can make PostgreSQL table partitioning with using Date ranges. Script can be configured with following configuration section:
Read more →

Fedora 13 nVidia Drivers Install Guide (disable the nouveau driver)

Looking Fedora 22/21 nVidia Drivers Install Guide? I’ve tried this method in few Fedora 12 and Fedora 13 machine, and looks like it is working. Nouveau has been enabled by default starting from Fedora 11 and looks like nouveau cause some problems on Fedora 12 and Fedora 13, when try to use nVidia proprietary driver. Note: nVidia proprietary drivers on Fedora 12 and Fedora 13 does not support older cards than GeForce 6 cards (except for some exceptions, check this comment).
Read more →

Google search from Linux and UNIX command line

Today I started thinking that how cool is do some Google searches straight from command line. First I try to find some ready tricks from the Internet, but I couldn’t find quickly anything good. So I decide do a simple Bash function that can take Google search as parameter and open Firefox Browser (tab) with Google search. Sounds easy… :) First we need Google search URL without search parameter and it looks like this:
Read more →

Linux Tip: How to handle a files with a dash as first character from command line

Sometimes you maybe have to handle files with a dash (-) as first character from Linux command line. It can be difficult, because the script “thinks” the marks after the dash are parameters. So files which name begins with dash (-) can not be dealt with directly by typing the command and the file name, such as the following: less -file-with-a-dash-as-first-character Files which name begins with dash (-) can be used as follows:
Read more →

Calendar (cal) on Linux command line

Sometimes it feels that many of the excellent and convenient command-line tools is forgotten, when they are replaced by graphical tools. A good example is the cal program, which is a command-line calendar to Linux and UNIX. It displays a simple calendar in text format. Cal usage Displays current month calendar on console cal Output: October 2009 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Displays selected month and year calendar on console cal 11 2012 Output:
Read more →

Nano Text Editor and nanorc Tips and Tricks

Nano is easy to use and lightweight command line text editor for Linux and UNIX systems. Nano text editor can use either the default settings or improve settings with customized nanorc-file. Here are some tips that can improve the usability of Nano. Changes can be made to nanorc file, either locally or to all users or options can be used as command line options. First is good to check Nano compiled options, with command:
Read more →

Microsoft Word doc documents handling on Linux command line with Antiword

Sometimes it is convenient and necessary to deal with Microsoft Word doc documents directly on Linux command line. MS Word documents handling directly from the Linux command line is possible with Antiword program. Anti-Word is a small, easy to use and lightweight command line program that can convert Microsoft Word documents to PDF, PostScript, and XML. For example, the following situations Antiword is a very useful tool: MS Word document can be read from a remote server easily and quickly.
Read more →
Subscribe and follow: