Sunday, May 31, 2020

Change lenguaje configuration Oracle SQL Developer 19


Sometimes you need to change  configuration languaje for SQL Developer, in my case, i need translate to english for that i type en, check the example below.


Go to folder installation SQL Developer :

Example on linux: Is similar on Windows.

YOUR_PATH/sqldeveloper/sqldeveloper/bin

Update file: sqldeveloper.conf

Add next row, anywhere part of file, i suggest you in  midle file.

#GUI languaje 
AddVMOption -Duser.language=en


Save file.

Open again SQL Developer, that it is.


Thursday, May 28, 2020

Enable remote desktop Windows 10 to Ubuntu 18.04


Steps:

Step 1:

Ubuntu.

Install next command on terminal:

sudo apt install xrdp

sudo systemctl enable xrdp

If you want check status, change enable to status or if you want disable type disable.


Step 2:

Windows 10.

Type on search: remote desktop.

Type your ip or hostaname on next windows:














When you click on connect automatically open next windows, type your username and password to remote desktop Ubuntu.

























Saturday, May 23, 2020

Kill port on Windows 10 by console


Open console with admin user.

Righ click on CMD open with administrador

Run next command:

netstat -ano | findstr :YOUR_PORT

Find PID and next

taskkill /PID YOUR_PID /F


Example:












Friday, May 22, 2020

Change dynamic value mat icon Angular 8 or greater


I share example how to change dynamic value mat icon with Angular.


Example, In my case, I want to change mat-icon expand_less to expand_more

HTML
 <button mat-icon-button color="primary">
   <mat-icon id="mat-{{name_dynamic_id}}" matTooltip="" aria-label="">
expand_less
</mat-icon>
 </button>

TS, Use native javascript.

Get Id.

var dynamicMatIccon = document.getElementById("mat-" + value);

Change value:

dynamicMatIccon.innerHTML = "expand_more";


That it is.


Monday, May 18, 2020

Linux tips

Number of files

 ls -l filename* | wc -l

Command to print directory structure 
ls -R MY_FOLDER | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//──/g' -e 's/─/├/' -e '$s/├/└/'

List only directories
ls -l | grep '^d'

Count total number of files in particular directory with specific extension.

ls -lR /path/to/dir/*.jpg | wc -l

Max thread, we can use. or number CPU.

lscpu


GREP

-Search multiple strings
grep '1\|2\|3' filename

-Number of lines with specific pattern search
grep -o 'STRING' filename | wc -l


SED
Replace values in file,
sed -i 's/old_string/new_string/' filename

With special character simple quotes
sed -i "s/old_string/'new_string'/g" filename

Add header string in the file.
sed -i '1s/^/addedtext\n/' filename

Add footer string in the file
echo "helloworld" | tee -a filename >/dev/null

Change extension filename in loop

for f in filename.txt;do mv $f  $f.sql;done

Split larger files into smaller parts 

-l number of lines

split -l 500000 filename

--bytes
K
M
G

Execute next the command on terminal example:

split --bytes=1G path/your_file.extension path/your_new_file.extension

Convert file UTF-8

iconv -f ISO-8859-1 -t UTF-8//TRANSLIT filein.txt > fileout.txt

Check special character on file 

grep --color='auto' -P -n "[\x80-\xFF]" file.txt

Could not get lock /var/lib/dpkg/lock-frontend - open

Delete the lock file:

sudo rm /var/lib/apt/lists/lock

Delete the lock file in the cache directory

sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

Generate RSA private and public key

Private key:

openssl genrsa -out private.pem 2048


Public Key from RSA private key:


openssl rsa -in private.pem -outform PEM -pubout -out public.pem

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!


Solution: run next command

ssh-keygen -R  YOUR_IP





Creating REST APIs with OpenAPI, Spring Boot 3.3.3, Java 21, and Jakarta

 Introduction In today's software landscape, designing robust and scalable REST APIs is a crucial aspect of application development. Wit...