postIt

        Post-It sticky notes with PasteBin sense

Updates from RSS

  • 02:40:16 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

     
  • 04:38:16 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

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

    FROM python:2.7
     
    RUN pip install --no-cache-dir pytest

     
  • 10:29:58 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
    ...

     
  • 05:31:19 pm on February 12, 2013 | 0 | # |
    Tags: , ,

    Check apache2 enabled modules:

    $ sudo apache2ctl -M
    Loaded Modules:
     core_module (static)
     log_config_module (static)
     logio_module (static)
     mpm_prefork_module (static)
     ...

    mod_rewrite (rewrite_module usually manipulated in .htaccess) and ssl (for HTTPS) for examples aren’t enabled by default in Ubuntu’ installation of apache2.

    Enable one or more of them via:

    $ sudo a2enmod

     
  • 11:31:47 am on July 19, 2012 | 0 | # |
    Tags: , ,

    Restoring a production database into VM and change date to make it looks like some point of time inside the production server i.e. in this case May 4, 2010

    $ /etc/init.d/mysqld stop
    $ /etc/init.d/httpd stop
    $ date +%D -s 2010-05-04
    $ date +%T -s 23:00:00 -u

    Check date

    $ date
    Tue May  4 19:00:01 EDT 2010

    Import database

    /etc/init.d/mysqld start
    /etc/init.d/httpd start
    mysql -u some-username -p < some-db.sql

    Note: Hardware clock option in the VirtualBox VM setting is disabled

     
  • 11:49:45 am on March 8, 2012 | 0 | # |
    Tags: , ,

    Check ssh key RSA fingerprint:

    $ ssh-keygen -l -f /home/myusername/.ssh/id_rsa.pub
    7b:e5:6f:a7:xx:xx:xx:xx:xx:xx:xx:xx:8b:57:xx:xx /home/myusername/.ssh/id_rsa.pub (RSA)

     
  • 08:35:25 am on January 28, 2012 | 0 | # |
    Tags: , ,

    Running separate version of wine in separate config directory (to isolate errors of running or installation failure)

    env WINEPREFIX="/home/arif/.wine-newapps" /usr/local/bin/wine-1.1.31/usr/bin/wine /home/arif/.wine-newapps/drive_c/Program\ Files/newapps/newapps.exe

     
  • 01:44:07 pm on January 25, 2012 | 0 | # |
    Tags: ,

    grep omit empty lines:

    cat <something> | grep -v "^$"

    I keep forgetting this regexp of “match expression at the star of the line”: the “^”

     
  • 09:50:01 am on January 11, 2012 | 0 | # |
    Tags: ,

    Custom run level init.d script:

    startup script on run level 0 and 6, as 34th start only e.g.

    update-rc.d which-tty start 34 0 6 .

    will create

    /etc/rc0.d/S34which-tty
    /etc/rc6.d/S34which-tty

     
Next Page »