postIt

        Post-It sticky notes with PasteBin sense

  • 1:09 pm on October 14, 2024 | 0 | # |

    Configuration Review :

    HugePages not enable.
    Refferences : When And Why To Use HugePages on Linux x86-64? (Doc ID 2314903.1)

    max locked memory & stack size below oracle recommendation:
    Ref : https://docs.oracle.com/en/database/oracle/oracle-database/19/ladbi/checking-resource-limits-for-oracle-software-installation-users.html

    Swap Spcae Allocation Below Recommendation.
    Ref : https://docs.oracle.com/en/database/oracle/oracle-database/19/ladbi/server-configuration-checklist-for-oracle-database-installation.html

    SELECT session_id
    FROM gv$locked_object v, dba_objects d
    WHERE v.object_id = d.object_id AND object_name = 'YOUR_TABLE_NAME';
    
    ALTER SYSTEM KILL SESSION 'sid,serial#';
    TRUNCATE TABLE your_table_name;
    
    Select object_id from dba_objects where object_name= ' T1 ';
    object_id
    ----------
    52505
    Sql> Select Object_id,session_id,oracle_username,os_user_name,process,locked_mode from V$locked_object where object_id=52505;
    object_id session_id oracle_username os_user_name PROCESS Locked_mode
    --------- ---------- ---------------- ------------- -------- -----------
    52505 149 SCOTT Oracle 5333 3
    Visible from above, it is the user Scott, who is Sid 149, who is working on this table and can get more information by querying V$session:
    Sql> Select sid,serial#,username,process from v$session where sid=149;
    SID serial# USERNAME PROCESS
    --------- ---------- -------------- ------------
    149 136 SCOTT 5333
    Then, if the operation allows, you can kill the transaction:
    Sql> alter system kill session ' 149,136 ';
     
  • 4:37 pm on November 28, 2023 | 0 | # |
    Tags:

    Decrypt SQL file backup

    openssl enc -d -aes256 -in somesql.gz.enc | gunzip > some.sql
     
  • 10:48 am on November 28, 2023 | 0 | # |
    Tags: ,

    Tunnel remote port 8383 to become available as localhost:5433

    ssh -L 5433:localhost:8383 some-user@some-server
     
  • 7:12 am on October 12, 2023 | 0 | # |
    Tags: ,

    Finding annotations XML files for copying

    find /Volumes/KOBOeReader/ -name "*.annot" | sed 's/\ /\\ /g' | sed 's/\&/\\&/g'
     
  • 12:30 pm on November 2, 2021 | 0 | # |
    Tags:

    At the root folder where there is Dockerfile

    docker build -t linkedin-learning-downloader .

    cd to linkedin-learning-downloader

    docker run -ti -v $(pwd):/usr/src/app --rm linkedin-learning-downloader python linkedin_learning.py
     
  • 1:59 pm on December 5, 2020 | 0 | # |
    Tags:

    Add network interface alias

    sudo ifconfig en0 alias 192.168.0.101 255.255.255.0
     
  • 2:40 pm on January 3, 2020 | 0 | # |
    Tags:

    Docker clean up based on ancestor tag

    docker ps -a -q --filter ancestor=azurebot/qna

    then docker rm the containers

     
  • 4:38 pm on January 2, 2020 | 0 | # |
    Tags:

    When put at the root of my Windows user folder C:\Users\[my username]\Dockerfile
    it will fail to find context of related files required in the build

    COPY failed: stat /mnt/sda1/var/lib/docker/tmp/docker-builder746762051/nodejs/package.json: no such file or directory

    Hence, in separate sub-directory:

    <docker Windows User root>
      |
       nodejs (dir)
             |___ Dockerfile
                  .dockerignore
                  resources (dir)
                     |____packages.json
                          serverhello.js

    COPY success during build:

    cd nodejs
    docker build -t bandono/simplenodeweb .

    Instead of -d that exited with code 126 the whole time, run the serverhello.js using:

    $ docker run -p 8286:8080 bandono/simplenodeweb node serverhello.js
    Running on http://0.0.0.0:8080

    References (which not working at first running with -d):

    [1] nodejs org
    [2] DigitalOcean

     
  • 8:08 pm on December 22, 2019 | 0 | # |
    Tags:

    FROM python:2.7
     
    RUN pip install --no-cache-dir pytest
     
  • 10:29 am on April 11, 2013 | 0 | # |
    Tags: , , ,

    Change internet default route in Mac OS X to USB HSDPA modem stick with LAN’ certain subnet routed via a gateway in WiFi (en1).

    In my case DNS will go with the modem interface setting remain routed via USB modem stick

    before routing:

    $ netstat -nr
     
    Routing tables
     
    Internet:
    Destination        Gateway            Flags        Refs      Use   Netif Expire
    default            10.64.64.64        UGSc           72      137    ppp0
    default            link#4             UCSI            0        0     en0
    default            10.1.1.1          UGScI           0        0     en1

    Delete and add routes (desired LAN subnet 192.168.1.0/24:

    sudo route -n delete default 10.1.1.1
    sudo route -n add default 10.64.64.64
    sudo route -n add 192.168.1.0/24 10.1.1.1

    after routing:

    $ netstat -nr
     
    Routing tables
     
    Internet:
    Destination        Gateway            Flags        Refs      Use   Netif Expire
    default            10.64.64.64        UGSc           21        0    ppp0
    default            link#4             UCSI            0        0     en0
    default            10.1.1.1          UGScI           0        0     en1
    10.1.1/24         link#5             UCS             6        0     en1
    ...
    192.168.1         10.1.1.1          UGSc            0        0     en1
    ...