Articles & Code Snippets

Articles


List of All Characters Emoji

Posted by Cătălin on Tue, 30 May 2023

Passion for DETAILS. Dedicated to QUALITY

List of All Characters Emoji Smiley Face Emojis Emotional Faces Emojis Faces with Tongue Emojis Neutral Faces Emojis Sleepy Faces Emojis Sick Faces Emojis Concerned Faces Emojis Negative Faces Emojis Costume Faces Emojis Faces that require more than one unicode character Cat Faces Emojis Monkey Faces Emojis Emotion Emojis Hands and other Body Parts Emojis Person Emojis Family Emojis Animals and Nature Emojis Food and Drinks Emojis Travel and Places Emojis Transport Emojis Time Emojis Sky and Weather Emojis Activity Em

design

Display property on Bootstrap 5

Posted by Cătălin on Tue, 4 Apr 2023

For faster mobile-friendly development, use responsive display classes for showing and hiding elements by device. Avoid creating entirely different versions of the same site, instead hide elements responsively for each screen size.

XS SM MD LG XL d-none d-sm-block hidden visible visible visible visible d-none d-md-block hidden hidden visible visible visible d-none d-lg-block hidden hidden hidden visible visible d-none d-xl-block hidden hidden hidden hidden visible

design

Is Apache is experiencing a DDoS attack?

Posted by Cătălin on Fri, 10 Mar 2023

How can I tell if Apache is experiencing a DDoS (Distributed Denial-of-Service) attack?

If Apache is experiencing a DDoS attack, you may notice that your server's Web sites are timing out when loading. You may also observe errors like these in the Apache error log: [Wed Aug 05 21:33:21.543968 2020] [mpm_prefork:error] [pid 10431] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting[Wed Aug 05 21:45:29.942556 2020] [mpm_prefork:error] [pid 13260] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting[Wed Aug 05 21:50:16.215967 2020] [mpm_prefor

design

MaxRequestWorkers for Apache

Posted by Cătălin on Fri, 10 Mar 2023

Tune Apache's MaxRequestWorkers setting to mitigate the risk of resource usage problems

It is essential to tune Apache's MaxRequestWorkers setting to mitigate the risk of resource usage problems that could lead to a crash and to ensure that your server can use the resources available to it. If you see the following in the Apache error log, it is an indicator that you will need to adjust the MaxRequestWorkers setting: AH00286: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting You can search for this message with the following command: grep MaxRequestWorkers /etc/apache2/logs/error_lo

design

PHP-FPM Limit Tuning Basics for Max Children

Posted by Cătălin on Fri, 10 Mar 2023

This resource provides information about tuning the Max Children limit for PHP FPM.

Checking the PHP-FPM Logs for Max Children Limit Hits Access your server as the root user via Terminal or SSH Run the following command to find the FPM logs: find /opt/cpanel/ea-php*/root/usr/var/log/php-fpm/ -type f -name error.log Run the following command on the log corresponding to the version of PHP your domain is using. PHP 8 is used in this example: grep max_children /opt/cpanel/ea-php8X/root/usr/var/log/php-fpm/error.log * Replace X with your PHP version

design

CSF SSH Command Line Commands

Posted by Cătălin on Fri, 3 Jan 2020

ConfigServer Firewall (CSF) SSH command line commands in a "cheat sheet" format.

Command Description Example csf -e Enable CSF csf -e csf -x Disable CSF csf -x csf -s Start the firewall rules csf -s csf -f Flush/Stop firewall rules (note: lfd may restart csf) csf -f

design

Renew Let's Encrypt certificate

Posted by Cătălin on Wed, 27 Nov 2019

Let's encrypt error certificate install error - “Client with the currently selected authenticator does not support any combination of challenges”

certbot --authenticator standalone --installer apache -d your-domain.com \ --pre-hook "systemctl stop apache2" \ --post-hook "systemctl start apache2"

design

How to add $PATH variable value to Debian

Posted by Cătălin on Mon, 2 Sep 2019

How to place composer's system-wide vendor bin directory in your $PATH, so the laravel executable can be located by your system.

To set the $PATH permanently, set the path in your startup file. This directory exists in different locations based on your operating system; however, here is how you can do it in Debian. Edit the startup file: nano ~/.bashrc And paste these lines at the end of the file: alias laravel='~/.config/composer/vendor/bin/laravel' export PATH="$HOME/.composer/vendor/bin:$PATH" restart terminal with: source ~/.bashrc

design

Bash Script Check is Apache is Down

Posted by Cătălin on Wed, 25 Apr 2018

Bash script to check if Apache server is up and running. If server is down, we will do a restart

#!/bin/bash if curl -s --head 'https://your-domain.com/' | grep "200 OK" > /dev/null then echo "Apache server is up!" > /dev/null else echo "Apache server is down!" /etc/init.d/apache2 restart fi

design

Install mod_pagespeed on EasyApache4

Posted by Cătălin on Sat, 14 Apr 2018

How to install google mod_pagespeed on EasyApache4 - WHM/Cpanel

Installation Procedure (CentOS): yum install rpm-build cpio ea-apache24-mod_version wget https://github.com/pagespeed/cpanel/raw/master/EA4/ea-apache24-mod_pagespeed-latest-stable.src.rpm rpmbuild --rebuild ea-apache24-mod_pagespeed-latest-stable.src.rpm rpm -ivh /root/rpmbuild/RPMS/x86_64/ea-apache24-mod_pagespeed*.rpm service httpd restart If you get following error on line 3 "RPM build errors: File must begin with "/": %{_httpd_moddir}/*.so File must begin with "/": %{_httpd_modconfdir}/*.conf" Create a

design

Dental Fonts

Posted by Cătălin on Tue, 13 Feb 2018

SVG with JS dental icons based on Font Awesome framework

<head> <script defer src="//assets.market.dental/fonts/md-dental-fonts/md-dental-fonts-1.0.min.js"></script> </head> <body> <i class="md md-veener fa-lg"></i> <i class="md md-oral-surgery fa-lg"></i> <i class="md md-invisalign fa-lg"></i> <i class="md md-implants fa-lg"></i> <i class="md md-cosmetic fa-lg"></i> <i class="md md-dentures fa-lg"></i> &l

design

.htaccess redirect examples

Posted by Cătălin on Fri, 19 Jan 2018

Common .htaccess Redirect Examples

#Redirect a single page: Redirect 301 /pagename.php http://www.domain.com/pagename.html #Redirect an entire site: Redirect 301 / http://www.domain.com/ #Redirect an entire site to a sub folder Redirect 301 / http://www.domain.com/subfolder/ #Redirect a sub folder to another site Redirect 301 /subfolder http://www.domain.com/ #This will redirect any file with the .html extension to use the same filename but use the .php extension instead. RedirectMatch 301 (.*)\.html$ http://www.domain.com$1.php #Redir

design

Percentage Calculator

Posted by Cătălin on Sat, 6 Jan 2018

Percentage Calculator

What is % of = % /*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k=

design

WHM & CSF - Gmail SMTP connect () failed error

Posted by Cătălin on Fri, 5 Jan 2018

Gmail SMTP connect () failed error using smtp.gmail.com and 587 port with TLS in cPanel

I solved the Gmail SMTP connect () failed error adding user(s) to CSF: Go to: CSF Firewall Configuration SMTP Settings Whitelist user(s) in variable "SMTP_ALLOWUSER" SMTP_ALLOWUSER: cpanel,user1,user2 (user is cPanel username) If still doesn't work: Go to: Home » Server Configuration » Tweak SettingsDocumentation » Mail Select "Off" under: Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak) [?]

design

Hidden Netflix categories

Posted by Cătălin on Tue, 26 Dec 2017

To access the extra content, all you need to do is add the code for the desired genre or sub genre to the end of the usual URL netflix.com/browse/genre/XXXX

Action & Adventure (1365) Asian Action Movies (77232) Classic Action & Adventure (46576) Action Comedies (43040) Action Thrillers (43048) Adventures (7442) Comic Book and Superhero Movies (10118) Westerns (7700) Spy Action & Adventure (10702) Crime Action & Adventure (9584) Foreign Action & Adventure (11828) Martial Arts Movies (8985) Military Action & Adventure (2125) Anime (7424) Adult Animation (11881) Anime Action (2653) Anime Comedies (9302) Anime Dramas (452) Anime Features (3063) Anime Sci-Fi (2729) Anime Horror (1069

design

hidden-* and visible-* classes update for Bootstrap4

Posted by Cătălin on Wed, 20 Dec 2017

The hidden-* and visible-* classes no longer exist in Bootstrap 4 Beta. If you want to hide an element on specific tiers or breakpoints in Bootstrap 4, use the d-* display classes accordingly.

hidden-xs-down = d-none d-sm-block hidden-sm-down = d-none d-md-block hidden-md-down = d-none d-lg-block hidden-lg-down = d-none d-xl-block hidden-xl-down = d-none (same as hidden) hidden-xs-up = d-none (same as hidden) hidden-sm-up = d-sm-none hidden-md-up = d-md-none hidden-lg-up = d-lg-none hidden-xl-up = d-xl-none hidden-xs (only) = d-none d-sm-block (same as hidden-xs-down) hidden-sm (only) = d-block d-sm-none d-md-block hidden-md (only) = d-block d-md-none d-lg-block hidden-lg (only) = d-block d-lg-none d-xl-block hidden

design

Generate password

Posted by Cătălin on Sun, 26 Nov 2017

Refresh the page to generate a 12 characters random password

#/*DlrT6^SZx

design

Font style matcher

Posted by Cătălin on Wed, 15 Nov 2017

If you're using a web font, you're bound to see a flash of unstyled text (or FOUC), between the initial render of your websafe font and the webfont that you've chosen. This usually results in a jarring shift in layout, due to sizing discrepancies between the two fonts. To minimize this discrepancy, you can try to match the fallback font and the intended webfont’s x-heights and widths. This tool helps you do exactly that.

if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/public/vendors/font-style-matcher/sw.js', {scope: '/font-style-matcher/'}).then(_ => { console.log('service worker is cool 🐳'); }).catch(e => { console.error('service worker is not so cool 🔥', e); throw e; }); } Fallback font Font size: 16px

design

Image Placeholder

Posted by Cătălin on Mon, 2 Oct 2017

Use as placeholders in your designs or code

Customize the size and the colour of the image like this: <img src="https://negraru.com/place?size=600x200&bg=e42e36&fg=fff&text=Nice+and+Red+PNG+600x200px" /> Sample:

design

Bootstrap 4 responsive utilities

Posted by Cătălin on Mon, 2 Oct 2017

Bootstrap 4 .hidden-* classes were completely removed

With Bootstrap 4 .hidden-* classes were completely removed. Starting with v4-beta, you can combine .d-*-none and .d-*-block classes to achieve the same result. visible-* was removed as well; instead of using explicit .visible-* classes, make the element visible by not hiding it (again, use combinations of .d-none .d-md-block) <div class="d-none d-sm-block"> hidden-xs <div class="d-none d-md-block"> visible-md and up (hidden-sm and down) <div class="d-none d-lg-block"> visible-lg and up (hidden-md and down)

design

MySQL update to remove whitespaces

Posted by Cătălin on Wed, 13 Sep 2017

This is how you can replace spaces with MySQL update query

Replace spaces UPDATE `table` SET `col_name` = REPLACE(`col_name`, ' ', '') Remove all tabs characters UPDATE `table` SET `col_name` = REPLACE(`col_name`, '\t', '' ) Remove all new line characters UPDATE `table` SET `col_name` = REPLACE(`col_name`, '\n', '') http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace Remove first and last space(s) of column UPDATE `table` SET `col_name` = TRIM(`col_name`) http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_trim

design

Google Chrome (ERR_EMPTY_RESPONSE)

Posted by Cătălin on Wed, 19 Jul 2017

WHM/cPanel AutoSSL issue with Google Chrome (ERR_EMPTY_RESPONSE)

Today few clients complained about their websites not working in Google Chrome. It seems to be an issue caused by a recent EasyApache 4 update where cPanel included a newer version of OpenSSL to be used with EasyApache, and this version of OpenSSL included some code that uses SSE4.1 or SSE4.2 CPU features. The reason that this problem affects Chrome browsers is because it uses the POLY1305 cryptographic algorithm and this triggers the problem in OpenSSL on the server. Until EA-6544 is resolved, this issue can be prevented by removing C

design

HTML Minifier

Posted by Cătălin on Fri, 14 Jul 2017

HTML Minifier - Minify HTML and any CSS or JS included in your markup

This will do the magic: //start HTML Minifier function sanitize_output($html) { $search = array( '/\>[^\S ]+/s', // strip whitespaces after tags, except space '/[^\S ]+\/' // Remove HTML comments ); $replace = array( '', '

design

Compare tables find and update in MySQL

Posted by Cătălin on Thu, 22 Jun 2017

Compare two tables find and update only matching data in MySQL

Find: SELECT id, mailing FROM directory_list a JOIN email_temp b ON a.email=b.email; Update: UPDATE directory_list a JOIN email_temp b ON a.email=b.email SET mailing = concat(COALESCE(mailing, ''), ' --text--');

design

MySQL find duplicates

Posted by Cătălin on Tue, 13 Jun 2017

MySQL query to find duplicates and to select all but ignore duplicates

Find duplicates: SELECT email FROM directory_list GROUP BY email HAVING COUNT(email) >1; Select all but ignore duplicates: SELECT email FROM directory_list WHERE email LIKE '%@%' GROUP BY email ASC;

design

Enable GZIP Compression in WHM

Posted by Cătălin on Fri, 19 May 2017

How to add GZIP compression server-wide in cPanel WHM EasyApache3 or EasyApache4

In cPanel WHM EasyApache3 or EasyApache4, you can add GZIP compression server-wide, including new accounts, by adding the following to Service Configuration → Apache Configuration → Include Editor → Pre Virtualhost Include → All Versions: # Enable GZIP Compression. <IfModule mod_deflate.c> SetOutputFilter DEFLATE <IfModule mod_setenvif.c> BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html # Don

design

Image blur filter

Posted by Cătălin on Wed, 22 Mar 2017

How to apply a Gaussian blur to an image.

CSS The value of ‘radius’ defines the value of the standard deviation to the Gaussian function, or how many pixels on the screen blend into each other, so a larger value will create more blur. If no parameter is provided, then a value 0 is used. The parameter is specified as a CSS length, but does not accept percentage values. .img_blur { -webkit-filter: blur(18px); filter: blur(18px); } Demo codepen.io PHP Imagick::adaptiveBlurImage Adds an adaptive blur filter to image. The intensity of an adaptive blur depends is

design

Encrypt files on OS X

Posted by Cătălin on Thu, 9 Mar 2017

Encrypt any files on OS X with openssl

Encrypt openssl enc -aes-256-cbc -e -in /Users/name/Desktop/file.pdf -out /Users/name/Desktop/file_encrypted.pdf Decrypt openssl enc -aes-256-cbc -d -in /Users/name/Desktop/file_encrypted.pdf -out /Users/name/Desktop/file_decrypted.pdf

design

How to force HTTPS using the .htaccess file

Posted by Cătălin on Wed, 8 Feb 2017

How to force HTTPS using the .htaccess file using mod_rewrite.

RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.example.com/$1 [R,L] To force a specific domain to use HTTPS, use the following lines of code in the .htaccess file in your website's root folder: RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.example.com/$1 [R,L] If you want to force SSL on a specific URL (without www) helpful to avoid duplicate URLs in SEO RewriteCond %{HTTP_HOST} ^www.example.com RewriteRule

design

CentOS cleaning Yum cache

Posted by Cătălin on Wed, 8 Feb 2017

How to lean the cache of YUM on your CentOS?

yum clean packages Now remove any cached XML-based metadata yum clean metadata Remove any cached database files yum clean dbcache Following this you will want to clean all the files to confirm the preceding instructions and to ensure that unnecessary disk space is not used yum clean all Rebuild the Yum cache by typing yum makecache For CPanel or DNSOnly you can also remove manually all the Cpanel_* temp files rm -fv /home/*/tmp/Cpanel_* rm -fv /tmp/Cpanel_*

design

Useful library repository

Posted by Cătălin on Thu, 26 Jan 2017

Useful CDN Javascript and CSS library repository

CDNJS* is a library repository which hosted on cloudflare.com. It’s freely available CDN for common Javascript and CSS libraries. Currently there are 2756 libraries, check it out at: https://cdnjs.com/libraries/ * CDN stands for Content Delivery Network.

design

Encrypt sensitive data with PHP

Posted by Cătălin on Sat, 7 Jan 2017

Encrypt sensitive data with PHP and MySQL

Class created with construct now add methods to encrypt and decrypt: class Encryption { const CIPHER = MCRYPT_RIJNDAEL_128; // Rijndael-128 is AES const MODE = MCRYPT_MODE_CBC; private $key; public function __construct($key) { $this->key = $key; } public function encrypt($plaintext) { $ivSize = mcrypt_get_iv_size(self::CIPHER, self::MODE); //Gets the size of the IV belonging to a specific cipher/mode combination. $iv = mcrypt_create_iv($ivSize, MCRYPT_DEV_RANDOM); //Creates an

design

GST/HST calculator

Posted by Cătălin on Tue, 8 Nov 2016

GST/HST calculator to find out the amount of tax that applies to sales in Canada.

Province or territory SelectAlbertaBritish ColumbiaManitobaNew BrunswickNewfoundland and LabradorNorthwest TerritoriesNova ScotiaNunavutOntarioPrince Edward IslandQuebecSaskatchewanYukon Amount Amount entered is:        Before taxes       After taxes Calculate HST: = Fed. (%):  + Prov. (%):  GST (%):  PST (%):  QST (%):  Total before tax:  Total after tax:  Please enter a numeric value in the Amount fie

design

Script to Backup Mysql Databases

Posted by Cătălin on Mon, 31 Oct 2016

Shell Script to Backup Mysql Databases, you can keep as many versions as you like

Create a cron with this script to backup your databases: #!/bin/sh # List of databases to be backed up separated by space dblist="DATABASE1 DATABASE2 DATABASE3" # Directory for backups backupdir=/PATH/FOR/MYSQL/BACKUPS/gz # Number of versions to keep numversions=7 # Full path for MySQL hotcopy command (find location with: locate mysqldump) hotcopycmd="/usr/local/mysql/bin/mysqldump --user=YOUR-USER --password=YOUR-PASSWORD --lock-tables --lock-tables --databases" # Create directory if needed mkdir -p "$backupdir" if [ !

design

Archive with tar excluding certain files/folders

Posted by Cătălin on Wed, 26 Oct 2016

Here is how to run the tar command with the --exclude functionality

Here is how to run the tar command with the --exclude functionality tar -czvf backup.tar.gz /path/site.com --exclude='/path/site.com/uploads'

design

Find files containing specific text on Linux?

Posted by Cătălin on Mon, 24 Oct 2016

How to find all files containing specific text on Linux?

How to find all files containing specific text on Linux? grep -rnw '/path/to/folder/' -e "string"

design

Linux - How to fix “Read-only file system”?

Posted by Cătălin on Thu, 6 Oct 2016

Passion for DETAILS. Dedicated to QUALITY

# /etc/init.d/apache2 start Starting web server: apache2(30)Read-only file system: apache2: could not open error log file /var/log/apache2/error.log. Unable to open logs Action 'start' failed. The Apache error log may have more information. failed! Fix: sudo fsck.ext4 -f /dev/sda1

design

Resolving Finder Problems in OS X 10.9.5 - OS X

Posted by Cătălin on Mon, 29 Aug 2016

Resolving Finder Problems in OS X 10.9.5 - OS X

Open terminal and paste this line: rm ~/Library/Preferences/com.apple.finder.plist && killall -HUP Finder

design

Let's Encrypt plugin for cPanel/WHM

Posted by Cătălin on Wed, 20 Apr 2016

Let's Encrypt plugin for cPanel/WHM

This is a cPanel/WHM plugin for the Let's Encrypt client. This plugin uses Perl and the WHM API, and requires a server running cPanel and WHM on it. /usr/local/cpanel/3rdparty/bin/git clone https://github.com/Prajithp/letsencrypt-cpanel.git cd letsencrypt-cpanel ./install.sh More info here

design

Authentication with .htpasswd On Mac OS X

Posted by Cătălin on Mon, 1 Jun 2015

Authentication with .htpasswd On Mac OS X

Open Terminal and type: $ htpasswd -c /www/domain.com/.htpasswd yourusername After running the command it will ask for your password. Create a .htaccess file at the directory you want to protect, suppose /www/domain.com/.htaccess. With the following lines: AuthName "Login" AuthUserFile /www/domain.com/.htpasswd AuthGroupFile /dev/null AuthType Basic < LIMIT GET POST > require valid-user < /LIMIT > Now save .htaccess and try running the page, that's it!

design

Apache mod_rewrite

Posted by Cătălin on Wed, 27 May 2015

Apache mod_rewrite

How to redirect domain URL path to main domain: Force Non-www Domain Access RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.(([a-z0-9_]+\.)?example\.com)$ [NC] RewriteRule .? http://%1%{REQUEST_URI} [R=301,L] Force www Domain Access RewriteEngine on RewriteCond %{HTTP_HOST} ^([a-z.]+)?example\.com$ [NC] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .? http://www.%1example.com%{REQUEST_URI} [R=301,L] Force file Domain Access RewriteEngine on RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ R

design

Remove IP from firewall

Posted by Cătălin on Mon, 4 May 2015

Remove IP from firewall

Check if IP is blocked by firewall: iptables -L -v -n | grep 1.2.3.4 Response: 7769 409K DROP all -- * * 1.2.3.4 0.0.0.0/0 Find chain with: iptables -L -n | less Remove IP: iptables -D fail2ban-sasl -s 1.2.3.4 -j DROP

design

How Uninstall Attracta in WHM

Posted by Cătălin on Tue, 28 Apr 2015

How Uninstall Attracta in WHM

You can run below script as root. It disables all traces of Attracta from the server. /usr/local/cpanel/3rdparty/attracta/scripts/uninstall-attracta

design

Secure connection failed in Webmin

Posted by Cătălin on Tue, 2 Dec 2014

Secure connection failed in Webmin

How to bypass the “secure connection failed” warning in Firefox 33 Firefox 33 no longer supports keys less than 1024 bits You can fix this right from Webmin if you: use another browser that lets you bypass this type of error or if you temporarily disable SSL in webmin by setting ssl=0 in /etc/webmin/miniserv.conf and restart webmin with /etc/init.d/webmin restart or login to the Webmin and select: Webmin -> Webmin Configuration -> SSL Encryption -> Self Signed Certificate Fill in the form (or leave the d

design

Find and remove IP blocked in Linux

Posted by Cătălin on Mon, 6 Oct 2014

Find and remove IP blocked in Linux

Find: iptables -L -n | grep 63.227.119.xx DROP all -- 63.227.119.xx 0.0.0.0/0 DROP all -- 63.227.119.xx 0.0.0.0/0 Remove iptables -D fail2ban-SSH -s 63.227.119.xx -j DROP

design

Hide or show content for devices in Bootstrap

Posted by Cătălin on Fri, 3 Oct 2014

Hide or show content for devices in Bootstrap

Using hidden <div class="hidden-sm hidden-md"> hidden-sm hidden-md </div> <div class="hidden-sm hidden-lg"> hidden-sm hidden-lg </div> <div class="hidden-md hidden-lg"> hidden-md hidden-lg </div> <div class="hidden-xs"> hidden-sm hidden-md hidden-lg </div> Equivalent using visible <div class="visible-lg"> hidden-sm hidden-md </div> <div class="visible-md"> hidden-sm hidden-lg </div> <div class="visible-sm"> hidden-md hidden-lg </div> <div class="visible-xs">

design

How To Check If Your Linux Is Vulnerable to Shellshock

Posted by Cătălin on Sat, 27 Sep 2014

How To Check If Your Linux Is Vulnerable to Shellshock

You can test your system by running this test command from Terminal: env x='() { :;}; echo vulnerable' bash -c 'echo hello' If you're not vulnerable, you'll get this result: bash: warning: x: ignoring function definition attempt bash: error importing function definition for `x' hello If you are vulnerable, you'll get: vulnerable hello You can also check the version of bash you're running by entering: bash --version

design

Terminal search files by text that the file names contain

Posted by Cătălin on Mon, 21 Jul 2014

Terminal search files by text that the file names contain

sudo find / -type f -name "*string*"

design

Finding a text string in Linux

Posted by Cătălin on Tue, 15 Jul 2014

Finding a text string in Linux

In this example, search for a string called "jquery-1.6.2" in all text (*.js) files located in "/home/user/public_html/" directory, use: $ grep "jquery-1.6.2" /home/user/public_html/*.js OR $ grep "jquery-1.6.2" ~/*.js Search all subdirectories recursively You can search for a text string all files under each directory, recursively with -R option: $ grep -R "jquery-1.6.2" /home/user/public_html/ Only display filenames By default, the grep command prints the matching lines. You can pass -H option to print the filen

design

How to count all the files recursively?

Posted by Cătălin on Mon, 23 Jun 2014

How to count all the files recursively?

How to count all the files recursively through directories in Linux: find -maxdepth 1 -type d | while read -r dir; do printf "%s:\t" "$dir"; find "$dir" -type f | wc -l; done

design