Execute: SELECT to_char(sysdate,’YYYY-MON-DD HH24:MI:SS’) FROM dual; Result: 2019-SEP-26 15:24:40 To extract the hour:: SELECT TO_CHAR(SYSDATE,’HH24′) AS CURRENT_HOUR FROM DUAL;
Install Firefox with Java support in Ubuntu Linux 18.04
Install Firefox with java support Ubuntu 18.0 Installation: First, make sure you have installed the JRE or JDK. For this example I use the JDK installed in the directory: /opt/jdk1.8.0_201 Execute these commands: sudo dpkg –add-architecture i386 sudo apt update Leer más
Oracle Linunx Kernel limits
Oracle recommendatios for operating limits /etc/sysctl.conf kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 4194304 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 fs.aio-max-nr = 1048576 fs.file-max = 6815744 Then execute: /sbin/sysctl -p /etc/security/limits.conf Leer más
net/http: Golang socket: too many open files
Error: [2019-05-25 10:44:08] dial tcp 127.0.0.1:5432: socket: too many open files Ulimits are Linux and Unix features that allows limiting how much resources a user uses, such as processes, CPU time, and various types of memory. You can view Leer más
ERROR: must be superuser or a member of the pg_read_server_files role to COPY from a file without SUPERUSER privileges
When executing the postgres copy command in a terminal, postgres shows the following error: ERROR: must be superuser or a member of the pg_read_server_files role to COPY from a file HINT: Anyone can COPY to stdout or from stdin. psql’s Leer más
postgres install extensions (pgcrypto) without giving the application superuser rights
In this example, I’m going to install the pgcrypto extension to be able to generate UUID data type. Procedure 1. Access as Postgres superuser. By default, it is the postgres user. sudo su – postgres 2. Access to the database Leer más
Linux disk usage
Find disk usage by hidden directories du -sch .[!.]* * |sort -h
Failed to connect to lvmetad. Falling back to device scanning. Ubuntu 18.04
Problem: Ubuntu tales more than 30 to boot. In the console show a message “Failed to connect to lvmetad. Falling back to device scanning.” Workaround : delete This file to avoid resume the computer : sudo rm /etc/initramfs-tools/conf.d/resume
Iptables by example
Insert rule at a specific position (prepend) To start, figure out which line should be used for the new rule. iptables -L -n –line-numbers #insert at position 9 iptables -I INPUT 9 -p tcp –dport 5222 -j ACCEPT Add comments Leer más
Nice bash prompt PS1
Nice Bash prompt. export PS1=”\[\e[36m\]\u\[\e[m\]@\[\e[33m\]\h\[\e[m\]:\[\e[32m\]\w\[\e[m\] $ ”