Subversion is a version and revision control framework utilized by engineers to track and keep up prior version of their source codes. Subversion oversees file and directory, and the changes made to them, over time.This …


This guide is for installing the latest release of Git on CentOS 7 server. The git version available on CentOS 7 repository is a bit old, 1.x. If you need a newer version of Git, then use this guide to install it.

Git is a distributed version control system used…


In a previous tutorial, we have showed you how to install MariaDB 10 in CentOS 7. In this guide, we will show you how to install and secure MariaDB 10.1 stable version in RHEL/CentOS 6 distributions.

Note that in this tutorial, we’ll assume your working on the server as root


public String getLongestCommonSubstring(String str1, String str2)
{
int m = str1.length();
int n = str2.length();

int max = 0;

int[][] dp = new int[m][n];
int endIndex=-1;
for(int i=0; i<m; i++){
for(int j=0; j<n; j++){
if(str1.charAt(i) == str2.charAt(j)){

// If first row or column
if(i==0 || j==0){
dp[i][j]=1;
}else{
// Add 1 to the diagonal value
dp[i][j] = dp[i-1][j-1]+1;
}

if(max < dp[i][j])
{
max = dp[i][j];
endIndex=i;
}
}

}
}
// We want String upto endIndex, we are using endIndex+1 in substring.
return str1.substring(endIndex-max+1,endIndex+1);
}
}


#php

<?php
$inputdata = @$_POST[‘inputdata’];
if(empty($inputdata))
{
$inputdata = @$_GET[‘inputdata’];
}
$result = array();if(is_numeric($inputdata))
{
if(!empty($inputdata))
{

$result = array();

for ($i = 0; $i < $inputdata; $i++)
{
$dataseriestemp=series($i);
if($dataseriestemp==0)
{
}
else if($dataseriestemp%2==1)
{
$result[]=$dataseriestemp;
}
}
}
}function series($num)
{
if($num == 0)
{
return 0;
}
else if($num == 1)
{
return 1;
}
else
{
return (series($num-1) + series($num-2));
}
}
rsort($result);
header(‘Content-Type: application/json’);
echo json_encode($result);
?>

#php

function getLongestMatchingSubstring($str1, $str2)
{
$len_1 = strlen($str1);
$longest = ‘’;
for($i = 0; $i < $len_1; $i++)
{
for($j = $len_1 — $i; $j > 0; $j — )
{
$sub = substr($str1, $i, $j);
if (strpos($str2, $sub) !== false && strlen($sub) > strlen($longest))
{
$longest = $sub;
break;
}
}
}
return $longest;
}

ON .htaccess Add =


Options -Indexes
<Files ~
“\.(env|json|config.js|md|gitignore|gitattributes|lock)$”>
Order allow,deny
Deny from all
</Files>
<Files ~ “(artisan)$”>
Order allow,deny
Deny from all
</Files>
<Files *.php>
Order Deny,Allow
Deny from all
</Files>
<Files index.php>
Order Allow,Deny
Allow from all
</Files>

hide .env passwords in Laravel Debug output on config/app.php file add inside return

return ['debug_blacklist' => [
'_ENV' => [
'APP_KEY',
'DB_PASSWORD',
'REDIS_PASSWORD',
'MAIL_PASSWORD',
'PUSHER_APP_KEY',
'PUSHER_APP_SECRET',
],
'_SERVER' => [
'APP_KEY',
'DB_PASSWORD',
'REDIS_PASSWORD',
'MAIL_PASSWORD',
'PUSHER_APP_KEY',
'PUSHER_APP_SECRET',
],
'_POST' => [
'password',
],
],
`];`

function number_to_alphabet($number) {
$number = intval($number);
if ($number <= 0) {
return '';
}
$alphabet = '';
while($number != 0) {
$p = ($number - 1) % 26;
$number = intval(($number - $p) / 26);
$alphabet = chr(65 + $p) . $alphabet;
}
return $alphabet;
}
function alphabet_to_number($string) {
$string = strtoupper($string);
$length = strlen($string);
$number = 0;
$level = 1;
while ($length >= $level ) {
$char = $string[$length - $level];
$c = ord($char) - 64;
$number += $c * (26 ** ($level-1));
$level++;
}
return $number;
}

# Enable rewrite engine
RewriteEngine On
# Block suspicious request methods
RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK|DEBUG) [NC]
RewriteRule ^(.*)$ — [F,L]# Block WP timthumb hack
RewriteCond %{REQUEST_URI} (timthumb\.php|phpthumb\.php|thumb\.php|thumbs\.php) [NC]
RewriteRule . — [S=1]# Block suspicious user agents and requests
RewriteCond %{HTTP_USER_AGENT} (libwww-perl|wget|python|nikto|curl|scan|java|winhttp|clshttp|loader) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (<|>|’|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (;|<|>|’|”|\)|\(|%0A|%0D|%22|%27|%28|%3C|%3E|%00).*(libwww-perl|wget|python|nikto|curl|scan|java|winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) [NC,OR]
RewriteCond %{THE_REQUEST} \?\…


Elasticsearch is flexible and powerful open-source, distributed real-time search and analytics engine. Using a simple set of APIs provides the ability for full-text search. Elastic search is freely available under the Apache 2 license, which provides the most flexibility.

This tutorial will help you to setup Elasticsearch single node cluster…

Teddy Zugana

aku, selagi hidup telah menaklukan semesta

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store