Skip to content

Instantly share code, notes, and snippets.

View nchillal's full-sized avatar
🕶️
Hello!

Nagendra Chillale nchillal

🕶️
Hello!
View GitHub Profile
@nchillal
nchillal / What does this do exec 2>&- do.md
Last active August 25, 2023 17:40
What does this do exec 2>&- do?

The command exec 2>&- is used in Unix-like shells (including Bash and KornShell) to close the standard error (stderr) stream for the current shell or script. This essentially means that any error messages or output sent to stderr will no longer be displayed in the terminal or captured in log files.

Here's what each part of the command does:

  • exec: This command in Unix-like shells is used to redirect or manipulate file descriptors, which are handles to input and output streams.
  • 2>&-: This part of the command is used to close the file descriptor for stderr (2 represents stderr). The >&- syntax is used to close a file descriptor.

For example, if you have a script and you use exec 2>&- at the beginning of the script, any subsequent error messages generated by commands within that script will not be shown on the terminal or logged.

However, be cautious when using this command, as it can make debugging and troubleshooting more difficult, since error messages are an important tool for diagnosing i

What is Dirty reads?

Dirty reads refer to a phenomenon in database systems where a transaction reads data that has been modified by another transaction but not yet committed. In other words, a dirty read occurs when a transaction reads uncommitted data from another transaction.

The isolation level associated with dirty reads is known as "Read Uncommitted" or "Dirty Read" isolation level, which is the lowest level of isolation. In this isolation level, transactions do not wait for other transactions to commit their changes before accessing their data. As a result, a transaction can read data that may be modified or rolled back by another transaction before it is finalized.

Here's an example to illustrate a dirty read scenario:

Transaction A updates a specific row in a table:

What are different types in go?

In Go, there are several built-in types that you can use to define variables, constants, and function signatures. Here are the different types in Go:

  1. Basic Types:
    • bool: Represents boolean values (true or false).
    • string: Represents a sequence of characters.
    • Numeric Types:
      • int: Represents signed integers.
  • uint: Represents unsigned integers.
@nchillal
nchillal / disk_io.md
Last active May 25, 2023 09:34
Why is the CPU not needed to service I/O requests?

It would help to understand the role of 3 important aspects of I/O in computer architecture

  1. Interrupts,
  2. DMA and
  3. Hardware Controllers.

When the CPU issues an I/O request to the hard disk, the hard disk has its own specialized chip called a device (or hardware) controller designed solely for processing commands from the CPU, such as reading from the disk. Originally these were simple chips that performed specific operations for the CPU, but modern hardware controllers are basically their own microprocessors with firmware and everything, so they are capable of very complex operations without the main CPU's help. While the hard drive's controller is busy performing the request, the main CPU is free to do whatever it wishes, such as execute process 2 in your example. The controller is able to read and write directly to and from system RAM using what is called a Direct Memory Access (DMA) controller, a special unit that transfers data from the hardware controller to main RAM without the CPU needing to d

@nchillal
nchillal / logdump.md
Last active May 11, 2023 01:21
GoldenGate
GHDR ON
DETAIL DATA
USERTOKEN DETAIL
GGSTOKEN DETAIL
GGSTOKEN DETAIL
FILEHEADER DETAIL
RECLEN 500
SHOW ENV
@nchillal
nchillal / listener_status.md
Last active September 26, 2020 20:19
Listener Status

Linux

if [[ $(pgrep -flu oracle tnslsnr) ]]; then
    for line in $(pgrep -flu oracle tnslsnr|sed -e 's/\s/,/g'); do
        pid=$(echo "${line}"|awk -F',' '{print $1}')
        listener=$(echo "${line}"|awk -F',' '{print $3}')
        TNS_ADMIN=$(strings /proc/"${pid}"/environ|egrep 'TNS_ADMIN'|awk -F'=' '{print $2}'); export TNS_ADMIN
        ORACLE_HOME=$(strings /proc/"${pid}"/environ|egrep 'ORACLE_HOME'|awk -F'=' '{print $2}'); export ORACLE_HOME
        PATH=${ORACLE_HOME}/bin:${PATH}; export PATH
        lsnrctl status "${listener}"
@nchillal
nchillal / Coalescing Fragmented Space.md
Last active January 11, 2020 20:51
Coalescing Fragmented Space

Released space may or may not be contiguous with the main area of free space in a data block. Noncontiguous free space is called fragmented space.

Oracle Database automatically and transparently coalesces the free space of a data block only when the following conditions are true:

An INSERT or UPDATE statement attempts to use a block that contains sufficient free space to contain a new row piece.
The free space is fragmented so that the row piece cannot be inserted in a contiguous section of the block.

After coalescing, the amount of free space is identical to the amount before the operation, but the space is now contiguous.