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.
[inttf_post_ad1]
This guide explains howto install Memcached 1.5.10/1.4.17/1.4.36 stable version of distributed memory object caching system on Fedora 29/28/27/26 and CentOS / Red Hat (RHEL) 7.5/6.10. Fedora...
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
[inttf_post_ad1]
Get headers
curl -s -I -H 'Accept-Encoding: br,gzip,deflate' https://www.if-not-true-then-false.com
-s option...
Sometimes it is very useful to delete / remove Bash history partially or completely when log out. Here is my favourite methods howto log out / quit / exit Bash shell without saving Bash history.
Remove Only Current Session Bash History and Leave Older History Untouched
[inttf_post_ad1]
1. Quit Bash Shell Without Saving History: Unset HISTFILE
unset HISTFILE && exit
2. Quit Bash Shell Without Saving History: Kill Console
kill -9 $$
Remove/Delete Bash History...
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.
[inttf_post_ad1]
PHP Class for Coloring PHP Command Line (CLI) Scripts...
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/
(more…)
I write before guide, howto create file on Linux shell / command line without text editor (with cat command) and this is guick tip howto display / show file contents (tabs, line-breaks, non-printing characters (ASCII control characters: octal 000 - 037)) and display all on Linux shell / command line. This is very useful when you want to know the entire contents of the file.
Example file
I use /tmp/testing.txt example file on this guide. File is created simply with following...
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.
Create Text File Without Text Editor on 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... :)
(more…)
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.txt
(more…)
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.
Add hostname, date, time, uptime,...
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.
Yum history and Yum history list
yum history lists...
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:
Initial...
Sometimes need to delete files whose contents should disappear absolutely, completely and safely. Linux command rm just remove file and it is 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.txt
Delete file with shred command:
shred -v -n 25 -u...